감사 로그
REST API를 사용하여 엔터프라이즈에 대한 감사 로그를 검색합니다.
이러한 엔드포인트는 personal access token (classic)를 사용하는 인증만 지원합니다. 자세한 내용은 "개인용 액세스 토큰 만들기"을 참조하세요.
Get the audit log for an enterprise
Gets the audit log for an enterprise. To use this endpoint, you must be an enterprise admin, and you must use an access token with the read:audit_log
scope.
"Get the audit log for an enterprise"에 대한 매개 변수
헤더 |
---|
속성, 형식, Description |
accept string Setting to |
경로 매개 변수 |
속성, 형식, Description |
enterprise string 필수The slug version of the enterprise name. You can also substitute this value with the enterprise id. |
쿼리 매개 변수 |
속성, 형식, Description |
phrase string A search phrase. For more information, see Searching the audit log. |
include string The event types to include:
The default is 다음 중 하나일 수 있습니다.: |
after string A cursor, as given in the Link header. If specified, the query only searches for events after this cursor. |
before string A cursor, as given in the Link header. If specified, the query only searches for events before this cursor. |
order string The order of audit log events. To list newest events first, specify The default is 다음 중 하나일 수 있습니다.: |
page integer Page number of the results to fetch. 기본값: |
per_page integer The number of results per page (max 100). 기본값: |
"Get the audit log for an enterprise"에 대한 HTTP 응답 상태 코드
상태 코드 | Description |
---|---|
200 | OK |
"Get the audit log for an enterprise"에 대한 코드 샘플
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>"\
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/enterprises/ENTERPRISE/audit-log
Response
Status: 200
[
{
"@timestamp": 1606929874512,
"action": "team.add_member",
"actor": "octocat",
"created_at": 1606929874512,
"_document_id": "xJJFlFOhQ6b-5vaAFy9Rjw",
"org": "octo-corp",
"team": "octo-corp/example-team",
"user": "monalisa"
},
{
"@timestamp": 1606507117008,
"action": "org.create",
"actor": "octocat",
"created_at": 1606507117008,
"_document_id": "Vqvg6kZ4MYqwWRKFDzlMoQ",
"org": "octocat-test-org"
},
{
"@timestamp": 1605719148837,
"action": "repo.destroy",
"actor": "monalisa",
"created_at": 1605719148837,
"_document_id": "LwW2vpJZCDS-WUmo9Z-ifw",
"org": "mona-org",
"repo": "mona-org/mona-test-repo",
"visibility": "private"
}
]