오디트 이벤트 API
- 작성자 이메일이 응답 본문에 추가됨 GitLab 15.9에서.
인스턴스 오디트 이벤트
이 API를 사용하여 인스턴스 오디트 이벤트를 검색합니다.
API를 사용하여 오디트 이벤트를 검색하려면 관리자로 인증해야 합니다.
모든 인스턴스 오디트 이벤트 검색
GET /audit_events
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
created_after
| 문자열 | 아니요 | 지정된 시간 이후에 생성된 오디트 이벤트를 반환합니다. 형식: ISO 8601 (년-월-일T시:분:초Z )
|
created_before
| 문자열 | 아니요 | 지정된 시간 이전에 생성된 오디트 이벤트를 반환합니다. 형식: ISO 8601 (년-월-일T시:분:초Z )
|
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": "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": "프로젝트 보관됨",
"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
| 정수/문자열 | 예 | 그룹의 ID 또는 URL 인코딩된 경로 |
created_after
| 문자열 | 아니요 | 지정된 시간 이후에 생성된 그룹 오디트 이벤트를 반환합니다. 형식: ISO 8601 (년-월-일T시:분:초Z)
|
created_before
| 문자열 | 아니요 | 지정된 시간 이전에 생성된 그룹 오디트 이벤트를 반환합니다. 형식: ISO 8601 (년-월-일T시:분:초Z )
|
기본적으로 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": "그룹 삭제 표시됨",
"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": "그룹",
"details": {
"custom_message": "삭제를 위해 그룹 표시됨",
"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-28T19:36:44.162Z"
}
프로젝트 감사 이벤트
이 API를 사용하여 프로젝트 감사 이벤트를 검색합니다.
Maintainer 역할(또는 그 이상)을 가진 사용자는 모든 사용자의 프로젝트 감사 이벤트를 검색할 수 있습니다. Developer 역할을 가진 사용자는 개별 조치에 기반한 프로젝트 감사 이벤트에 제한됩니다.
모든 프로젝트 감사 이벤트 검색
- GitLab 15.10에서 소개된 키셋 페이지네이션을 지원합니다.
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개씩 반환합니다.
연속된 페이지 결과를 요청할 때는 키셋 페이지네이션을 사용해야 합니다.
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": "프로젝트",
"details": {
"change": "협업자의 Merge Request 승인 방지",
"from": "",
"to": "true",
"author_name": "관리자",
"author_email": "admin@example.com",
"target_id": 7,
"target_type": "프로젝트",
"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": "프로젝트",
"details": {
"change": "저자의 Merge Request 승인 방지",
"from": "false",
"to": "true",
"author_name": "관리자",
"author_email": "admin@example.com",
"target_id": 7,
"target_type": "프로젝트",
"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
Attribute | Type | Required | Description |
---|---|---|---|
id
| integer/string | yes | 프로젝트의 ID 또는 URL로 인코딩된 경로 |
audit_event_id
| integer | yes | 감사 이벤트의 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": "프로젝트",
"details": {
"change": "협업자의 Merge Request 승인 방지",
"from": "",
"to": "true",
"author_name": "관리자",
"author_email": "admin@example.com",
"target_id": 7,
"target_type": "프로젝트",
"target_details": "twitter/typeahead-js",
"ip_address": "127.0.0.1",
"entity_path": "twitter/typeahead-js"
},
"created_at": "2020-05-26T22:55:04.230Z"
}