감사 이벤트 API

Tier: Premium, Ultimate Offering: GitLab.com, Self-managed, GitLab Dedicated

인스턴스 감사 이벤트

Tier: Premium, Ultimate Offering: Self-managed, GitLab Dedicated

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

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

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

  • 키셋 페이지네이션 지원이 도입됨 in GitLab 15.11.
  • 인스턴스 감사 이벤트에 대한 엔티티 유형 Gitlab::Audit::InstanceScope도입됨 in GitLab 16.2.
GET /audit_events  
속성 유형 필수 설명
created_after string 아니오 주어진 시간 이후 또는 그 시점에 생성된 감사 이벤트를 반환합니다. 형식: ISO 8601 (YYYY-MM-DDTHH:MM:SSZ)
created_before string 아니오 주어진 시간 이전 또는 그 시점에 생성된 감사 이벤트를 반환합니다. 형식: ISO 8601 (YYYY-MM-DDTHH:MM:SSZ)
entity_type string 아니오 주어진 엔티티 유형에 대한 감사 이벤트를 반환합니다. 유효한 값: User, Group, Project, 또는 Gitlab::Audit::InstanceScope.
entity_id integer 아니오 주어진 엔티티 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": "Project",  
      "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": "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"  
  },  
  {  
    "id": 3,  
    "author_id": 51,  
    "entity_id": 51,  
    "entity_type": "User",  
    "details": {  
      "change": "이메일 주소",  
      "from": "hello@flightjs.com",  
      "to": "maintainer@flightjs.com",  
      "author_name": "Andreas",  
      "author_email": "admin@example.com",  
      "target_id": 51,  
      "target_type": "User",  
      "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": "User",  
      "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 정수 감사 이벤트의 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": "Project archived",
    "author_name": "Administrator",
    "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 정수/문자열 그룹의 ID 또는 URL 인코딩 경로
created_after 문자열 아니오 주어진 시간 이후에 생성된 그룹 감사 이벤트를 반환합니다. 형식: ISO 8601 (YYYY-MM-DDTHH:MM:SSZ)
created_before 문자열 아니오 주어진 시간 이전에 생성된 그룹 감사 이벤트를 반환합니다. 형식: ISO 8601 (YYYY-MM-DDTHH:MM:SSZ)

기본적으로 GET 요청은 API 결과가 페이지네이션되기 때문에 한 번에 20개의 결과를 반환합니다.

페이지네이션에 대한 더 많은 정보를 읽어보세요.

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": "Group marked for deletion",
      "author_name": "Administrator",
      "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": "Administrator",
      "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를 사용하여 프로젝트 감사 이벤트를 검색하세요.

유지 관리자 역할 이상을 가진 사용자는 모든 사용자의 프로젝트 감사 이벤트를 검색할 수 있습니다.

개발자 역할의 사용자는 개인 행동에 기반한 프로젝트 감사 이벤트에 제한됩니다.

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

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개의 결과를 반환합니다.

연속 페이지의 결과를 요청할 때는 키셋 페이지 매김을 사용해야 합니다.

페이지 네이션에 대해 자세히 읽어보세요.

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": "커밋 권한이 있는 사용자의 병합 요청 승인을 방지합니다.",
        "from": "",
        "to": "true",
        "author_name": "관리자",
        "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": "작성자의 병합 요청 승인을 방지합니다.",
          "from": "false",
          "to": "true",
          "author_name": "관리자",
          "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": "커미터로부터 병합 요청 승인을 방지",
      "from": "",
      "to": "true",
      "author_name": "관리자",
      "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"
}