Audit Events API

Tier: 프리미엄, 얼티메이트 Offering: GitLab.com, Self-managed, GitLab Dedicated

인스턴스 감사 이벤트

Tier: 프리미엄, 얼티메이트 Offering: Self-managed, GitLab Dedicated

이 API를 사용하여 인스턴스 감사 이벤트를 검색합니다.

API를 사용하여 감사 이벤트를 검색하려면 권한을 가진 관리자로 인증해야 합니다.

모든 인스턴스 감사 이벤트 검색

GET /audit_events
속성 유형 필수 설명
created_after 문자열 아니요 지정된 시간 이후에 생성된 감사 이벤트를 반환합니다. 형식: ISO 8601 (YYYY-MM-DDTHH:MM:SSZ)
created_before 문자열 아니요 지정된 시간 이전에 생성된 감사 이벤트를 반환합니다. 형식: ISO 8601 (YYYY-MM-DDTHH:MM:SSZ)
entity_type 문자열 아니요 지정된 엔터티 유형에 대한 감사 이벤트를 반환합니다. 유효한 값은 User, Group, Project, 또는 Gitlab::Audit::InstanceScope입니다.
entity_id 정수 아니요 지정된 엔터티 ID에 대한 감사 이벤트를 반환합니다. entity_type 속성이 있어야 합니다.

이 엔드포인트는 오프셋 기반 및 키셋 기반 페이지네이션을 모두 지원합니다. 결과의 연속된 페이지를 요청할 때는 키셋 기반 페이지네이션을 사용해야 합니다.

자세한 내용은 페이지네이션을 참조하세요.

curl --header "PRIVATE-TOKEN: <your_access_token>" "https://primary.example.com/api/v4/audit_events"

예시 응답:

[
  {
    "id": 1,
    "author_id": 1,
    "entity_id": 6,
    "entity_type": "Project",
    "details": {
      "custom_message": "프로젝트 보관됨",
      "author_name": "관리자",
      "author_email": "admin@example.com",
      "target_id": "flightjs/flight",
      "target_type": "프로젝트",
      "target_details": "flightjs/flight",
      "ip_address": "127.0.0.1",
      "entity_path": "flightjs/flight"
    },
    "created_at": "2019-08-30T07:00:41.885Z"
  },
  {
    "id": 2,
    "author_id": 1,
    "entity_id": 60,
    "entity_type": "그룹",
    "details": {
      "add": "그룹",
      "author_name": "관리자",
      "author_email": "admin@example.com",
      "target_id": "flightjs",
      "target_type": "그룹",
      "target_details": "flightjs",
      "ip_address": "127.0.0.1",
      "entity_path": "flightjs"
    },
    "created_at": "2019-08-27T18:36:44.162Z"
  },
  {
    "id": 3,
    "author_id": 51,
    "entity_id": 51,
    "entity_type": "사용자",
    "details": {
      "change": "이메일 주소",
      "from": "hello@flightjs.com",
      "to": "maintainer@flightjs.com",
      "author_name": "Andreas",
      "author_email": "admin@example.com",
      "target_id": 51,
      "target_type": "사용자",
      "target_details": "Andreas",
      "ip_address": null,
      "entity_path": "Andreas"
    },
    "created_at": "2019-08-22T16:34:25.639Z"
  },
  {
    "id": 4,
    "author_id": 43,
    "entity_id": 1,
    "entity_type": "Gitlab::Audit::InstanceScope",
    "details": {
      "author_name": "관리자",
      "author_class": "사용자",
      "target_id": 32,
      "target_type": "AuditEvents::Streaming::InstanceHeader",
      "target_details": "알 수 없음",
      "custom_message": "키 X-arg로 사용자 정의 HTTP 헤더 생성됨.",
      "ip_address": "127.0.0.1",
      "entity_path": "gitlab_instance"
    },
    "ip_address": "127.0.0.1",
    "author_name": "관리자",
    "entity_path": "gitlab_instance",
    "target_details": "알 수 없음",
    "created_at": "2023-08-01T11:29:44.764Z",
    "target_type": "AuditEvents::Streaming::InstanceHeader",
    "target_id": 32,
    "event_type": "audit_events_streaming_instance_headers_create"
  }
]

단일 인스턴스 감사 이벤트 검색

GET /audit_events/:id
속성 유형 필수 설명
id integer 감사 이벤트의 ID
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://primary.example.com/api/v4/audit_events/1"

예시 응답:

{
  "id": 1,
  "author_id": 1,
  "entity_id": 6,
  "entity_type": "Project",
  "details": {
    "custom_message": "프로젝트 보관됨",
    "author_name": "관리자",
    "author_email": "admin@example.com",
    "target_id": "flightjs/flight",
    "target_type": "Project",
    "target_details": "flightjs/flight",
    "ip_address": "127.0.0.1",
    "entity_path": "flightjs/flight"
  },
  "created_at": "2019-08-30T07:00:41.885Z"
}

그룹 감사 이벤트

  • GitLab 15.2에서 도입된 키셋 페이지네이션 지원.

그룹 감사 이벤트를 검색하려면 이 API를 사용하십시오.

다음 권한이 있는 사용자:

  • 소유자 역할은 모든 사용자의 그룹 감사 이벤트를 검색할 수 있습니다.
  • 개발자 또는 유지 관리자 역할은 개별 작업에 기반하여 그룹 감사 이벤트에 제한됩니다.

이 엔드포인트는 오프셋 기반과 키셋 기반 페이지네이션을 모두 지원합니다. 연속적인 결과 페이지를 요청할 때는 키셋 기반 페이지네이션을 권장합니다.

모든 그룹 감사 이벤트 검색

  • GitLab 15.2에서 도입된 키셋 페이지네이션 지원.
GET /groups/:id/audit_events
속성 유형 필수 설명
id integer/string 그룹의 ID 또는 URL 인코딩된 경로
created_after string 아니요 주어진 시간 이후에 생성된 그룹 감사 이벤트를 반환합니다. 형식: ISO 8601 (YYYY-MM-DDTHH:MM:SSZ)
created_before string 아니요 주어진 시간 이전에 생성된 그룹 감사 이벤트를 반환합니다. 형식: ISO 8601 (YYYY-MM-DDTHH:MM:SSZ)

기본적으로 GET 요청은 API 결과를 페이지별로 20개씩 반환합니다. pagination에서 자세히 알아보세요.

curl --header "PRIVATE-TOKEN: <your_access_token>" "https://primary.example.com/api/v4/groups/60/audit_events"

예시 응답:

[
  {
    "id": 2,
    "author_id": 1,
    "entity_id": 60,
    "entity_type": "Group",
    "details": {
      "custom_message": "그룹 삭제 예정",
      "author_name": "관리자",
      "author_email": "admin@example.com",
      "target_id": "flightjs",
      "target_type": "Group",
      "target_details": "flightjs",
      "ip_address": "127.0.0.1",
      "entity_path": "flightjs"
    },
    "created_at": "2019-08-28T19:36:44.162Z"
  },
  {
    "id": 1,
    "author_id": 1,
    "entity_id": 60,
    "entity_type": "Group",
    "details": {
      "add": "group",
      "author_name": "관리자",
      "author_email": "admin@example.com",
      "target_id": "flightjs",
      "target_type": "Group",
      "target_details": "flightjs",
      "ip_address": "127.0.0.1",
      "entity_path": "flightjs"
    },
    "created_at": "2019-08-27T18:36:44.162Z"
  }
]

특정 그룹 감사 이벤트 검색

그룹 소유자 및 관리자만 사용 가능.

GET /groups/:id/audit_events/:audit_event_id
속성 유형 필수 설명
id integer/string 그룹의 ID 또는 URL 인코딩된 경로
audit_event_id integer 감사 이벤트의 ID
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://primary.example.com/api/v4/groups/60/audit_events/2"

예시 응답:

{
  "id": 2,
  "author_id": 1,
  "entity_id": 60,
  "entity_type": "Group",
  "details": {
    "custom_message": "그룹 삭제 예정",
    "author_name": "관리자",
    "author_email": "admin@example.com",
    "target_id": "flightjs",
    "target_type": "Group",
    "target_details": "flightjs",
    "ip_address": "127.0.0.1",
    "entity_path": "flightjs"
  },
  "created_at": "2019-08-28T19:36:44.162Z"
}

프로젝트 감사 이벤트

프로젝트 감사 이벤트를 검색하는 데에는 이 API를 사용하세요.

Maintainer 역할(또는 그 이상)을 가진 사용자는 모든 사용자의 프로젝트 감사 이벤트를 검색할 수 있습니다. Developer 역할을 가진 사용자는 개별 작업에 기반한 프로젝트 감사 이벤트에 대해 제한됩니다.

모든 프로젝트 감사 이벤트 검색

  • GitLab 15.10에서 keyset 페이징이 지원되었습니다.
GET /projects/:id/audit_events
속성 타입 필수 설명
id integer/string 프로젝트의 ID 또는 URL 인코딩된 경로
created_after string 아니요 주어진 시간 이후에 생성된 프로젝트 감사 이벤트를 반환합니다. 형식: ISO 8601 (YYYY-MM-DDTHH:MM:SSZ)
created_before string 아니요 주어진 시간 이전에 생성된 프로젝트 감사 이벤트를 반환합니다. 형식: ISO 8601 (YYYY-MM-DDTHH:MM:SSZ)

기본적으로 GET 요청은 API 결과가 페이지별로 반환되기 때문에 한 번에 20개의 결과를 반환합니다. 연속 페이지의 결과를 요청할 때는 keyset pagination을 사용해야 합니다.

더 자세한 내용은 페이지네이션을 참조하세요.

curl --header "PRIVATE-TOKEN: <your_access_token>" "https://primary.example.com/api/v4/projects/7/audit_events"

예시 응답:

[
  {
    "id": 5,
    "author_id": 1,
    "entity_id": 7,
    "entity_type": "Project",
    "details": {
        "change": "prevent merge request approval from committers",
        "from": "",
        "to": "true",
        "author_name": "Administrator",
        "author_email": "admin@example.com",
        "target_id": 7,
        "target_type": "Project",
        "target_details": "twitter/typeahead-js",
        "ip_address": "127.0.0.1",
        "entity_path": "twitter/typeahead-js"
    },
    "created_at": "2020-05-26T22:55:04.230Z"
  },
  {
    "id": 4,
    "author_id": 1,
    "entity_id": 7,
    "entity_type": "Project",
    "details": {
        "change": "prevent merge request approval from authors",
        "from": "false",
        "to": "true",
        "author_name": "Administrator",
        "author_email": "admin@example.com",
        "target_id": 7,
        "target_type": "Project",
        "target_details": "twitter/typeahead-js",
        "ip_address": "127.0.0.1",
        "entity_path": "twitter/typeahead-js"
    },
    "created_at": "2020-05-26T22:55:04.218Z"
  }
]

특정 프로젝트 감사 이벤트 검색

프로젝트에 적어도 Maintainer 역할을 가진 사용자에게만 사용 가능합니다.

GET /projects/:id/audit_events/:audit_event_id
속성 타입 필수 설명
id integer/string 프로젝트의 ID 또는 URL 인코딩된 경로
audit_event_id integer 감사 이벤트의 ID
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://primary.example.com/api/v4/projects/7/audit_events/5"

예시 응답:

{
  "id": 5,
  "author_id": 1,
  "entity_id": 7,
  "entity_type": "Project",
  "details": {
      "change": "prevent merge request approval from committers",
      "from": "",
      "to": "true",
      "author_name": "Administrator",
      "author_email": "admin@example.com",
      "target_id": 7,
      "target_type": "Project",
      "target_details": "twitter/typeahead-js",
      "ip_address": "127.0.0.1",
      "entity_path": "twitter/typeahead-js"
  },
  "created_at": "2020-05-26T22:55:04.230Z"
}