Audit 이벤트 스트리밍 GraphQL API
- GitLab 14.5에서
ff_external_audit_events_namespace
이라는 플래그로 도입된 API. 기본 설정으로 비활성화됨.- GitLab 14.7에서 GitLab.com 및 Self-managed에서 기본으로 활성화된 API.
- GitLab 14.8에서 API 피처 플래그
ff_external_audit_events_namespace
제거됨.- GitLab 15.1에서
streaming_audit_event_headers
이라는 플래그로 도입된 사용자 지정 HTTP 헤더 API. 기본 설정으로 비활성화됨.- GitLab 15.2에서 GitLab.com 및 Self-managed에서 활성화됨 사용자 지정 HTTP 헤더 API.
- GitLab 15.3에서 사용자 지정 HTTP 헤더 API가 일반 사용 가능해짐. 피처 플래그
streaming_audit_event_headers
제거됨.- GitLab 15.4에서 사용자 지정 검증 토큰 API 지원이 도입됨.
- GitLab 16.1에서
ff_external_audit_events
이라는 플래그로 도입된 인스턴스 레벨 스트리밍 대상용 사용자 지정 HTTP 헤더 API. 기본 설정으로 비활성화됨.- GitLab 16.2에서 피처 플래그
ff_external_audit_events
가 기본으로 활성화됨.- GitLab 16.2에서 사용자 지정 대상 이름 API 지원이 도입됨.
- GitLab 16.4에서 API 피처 플래그
ff_external_audit_events
가 제거됨.
GraphQL API를 사용하여 Audit 이벤트 스트리밍 대상을 유지할 수 있습니다.
최상위 그룹 스트리밍 대상
최상위 그룹의 스트리밍 대상을 관리합니다.
HTTP 대상
최상위 그룹의 HTTP 스트리밍 대상을 관리합니다.
새 스트리밍 대상 추가
최상위 그룹에 새 스트리밍 대상을 추가합니다.
필수 조건:
- 최상위 그룹의 소유자 권한.
스트리밍을 활성화하고 최상위 그룹에 대상을 추가하려면 externalAuditEventDestinationCreate
뮤테이션을 사용하세요.
mutation {
externalAuditEventDestinationCreate(input: { destinationUrl: "https://mydomain.io/endpoint/ingest", groupPath: "my-group" } ) {
errors
externalAuditEventDestination {
id
name
destinationUrl
verificationToken
group {
name
}
}
}
}
기본 GitLab 생성값 대신 고유한 검증 토큰을 지정할 수 있습니다. 이를 위해 GraphQL externalAuditEventDestinationCreate
뮤테이션을 사용하세요. 검증 토큰 길이는 16에서 24자여야 하며 후행 공백은 자르지 않습니다. 암호학적으로 무작위이고 고유한 값을 설정해야 합니다. 예:
mutation {
externalAuditEventDestinationCreate(input: { destinationUrl: "https://mydomain.io/endpoint/ingest", groupPath: "my-group", verificationToken: "unique-random-verification-token-here" } ) {
errors
externalAuditEventDestination {
id
name
destinationUrl
verificationToken
group {
name
}
}
}
}
기본 GitLab 생성값 대신 고유한 대상 이름을 지정할 수 있습니다. 이를 위해 GraphQL externalAuditEventDestinationCreate
뮤테이션을 사용하세요. 이름 길이는 72자를 초과해서는 안 되며 후행 공백은 자르지 않습니다. 이 값은 그룹 범위에서 고유해야 합니다. 예:
mutation {
externalAuditEventDestinationCreate(input: { destinationUrl: "https://mydomain.io/endpoint/ingest", name: "destination-name-here", groupPath: "my-group" }) {
errors
externalAuditEventDestination {
id
name
destinationUrl
verificationToken
group {
name
}
}
}
}
다음과 같은 경우 이벤트 스트리밍이 활성화됩니다:
- 반환된
errors
객체가 비어 있음. - API가
200 OK
로 응답함.
GraphQL auditEventsStreamingHeadersCreate
뮤테이션을 사용하여 HTTP 헤더를 추가할 수 있습니다. 그룹에 대한 모든 스트리밍 대상을 나열하거나 위의 뮤테이션에서 대상 ID를 검색할 수 있습니다.
mutation {
auditEventsStreamingHeadersCreate(input: {
destinationId: "gid://gitlab/AuditEvents::ExternalAuditEventDestination/1",
key: "foo",
value: "bar",
active: false
}) {
errors
header {
id
key
value
active
}
}
}
반환된 errors
객체가 비어 있으면 헤더가 생성됩니다.
스트리밍 대상 나열
최상위 그룹의 스트리밍 대상을 나열합니다.
필수 조건:
- 최상위 그룹의 소유자 권한
externalAuditEventDestinations
쿼리 타입을 사용하여 최상위 그룹의 스트리밍 대상 디렉터리을 볼 수 있습니다.
query {
group(fullPath: "my-group") {
id
externalAuditEventDestinations {
nodes {
destinationUrl
verificationToken
id
name
headers {
nodes {
key
value
id
active
}
}
eventTypeFilters
namespaceFilter {
id
namespace {
id
name
fullName
}
}
}
}
}
}
결과 디렉터리이 비어 있다면 해당 그룹에 대해 Audit 스트리밍이 활성화되지 않은 것입니다.
스트리밍 대상 수정
최상위 그룹의 스트리밍 대상을 수정합니다.
전제 조건:
- 최상위 그룹에 대한 소유자 역할.
그룹의 스트리밍 대상을 업데이트하려면 externalAuditEventDestinationUpdate
뮤테이션 유형을 사용하십시오. 대상 ID를 검색할 수 있습니다.
그룹의 모든 스트리밍 대상을 나열함으로써.
mutation {
externalAuditEventDestinationUpdate(input: {
id:"gid://gitlab/AuditEvents::ExternalAuditEventDestination/1",
destinationUrl: "https://www.new-domain.com/webhook",
name: "destination-name"} ) {
errors
externalAuditEventDestination {
id
name
destinationUrl
verificationToken
group {
name
}
}
}
}
스트리밍 대상은 다음과 같은 경우에 업데이트됩니다:
- 반환된
errors
객체가 비어 있는 경우. - API가
200 OK
로 응답하는 경우.
그룹의 소유자 역할을 하는 사용자는 auditEventsStreamingHeadersUpdate
뮤테이션 유형을 사용하여 스트리밍 대상의 사용자 지정 HTTP 헤더를 업데이트할 수 있습니다. 그룹의 사용자 지정 HTTP 헤더 ID를 검색할 수 있습니다.
그룹의 모든 사용자 지정 HTTP 헤더를 나열함으로써.
mutation {
auditEventsStreamingHeadersUpdate(input: { headerId: "gid://gitlab/AuditEvents::Streaming::Header/2", key: "new-key", value: "new-value", active: false }) {
errors
header {
id
key
value
active
}
}
}
그룹 소유자는 GraphQL auditEventsStreamingHeadersDestroy
뮤테이션을 사용하여 HTTP 헤더를 제거할 수 있습니다. 그룹의 헤더 ID를 검색할 수 있습니다.
그룹의 모든 사용자 지정 HTTP 헤더를 나열함으로써.
mutation {
auditEventsStreamingHeadersDestroy(input: { headerId: "gid://gitlab/AuditEvents::Streaming::Header/1" }) {
errors
}
}
반환된 errors
객체가 비어 있는 경우 헤더가 삭제됩니다.
스트리밍 대상 삭제
최상위 그룹의 스트리밍 대상을 삭제합니다.
마지막 대상이 성공적으로 삭제되면, 그룹의 스트리밍이 비활성화됩니다.
전제 조건:
- 최상위 그룹에 대한 소유자 역할.
그룹의 소유자 역할을 하는 사용자는 externalAuditEventDestinationDestroy
뮤테이션 유형을 사용하여 스트리밍 대상을 삭제할 수 있습니다. 대상 ID를 검색할 수 있습니다.
그룹의 모든 스트리밍 대상을 나열함으로써.
mutation {
externalAuditEventDestinationDestroy(input: { id: destination }) {
errors
}
}
스트리밍 대상은 다음과 같은 경우에 삭제됩니다:
- 반환된
errors
객체가 비어 있는 경우. - API가
200 OK
로 응답하는 경우.
그룹 소유자는 GraphQL auditEventsStreamingHeadersDestroy
뮤테이션을 사용하여 HTTP 헤더를 제거할 수 있습니다. 그룹의 헤더 ID를 검색할 수 있습니다.
그룹의 모든 사용자 지정 HTTP 헤더를 나열함으로써.
mutation {
auditEventsStreamingHeadersDestroy(input: { headerId: "gid://gitlab/AuditEvents::Streaming::Header/1" }) {
errors
}
}
반환된 errors
객체가 비어 있는 경우 헤더가 삭제됩니다.
이벤트 유형 필터
- Event type filters API introduced in GitLab 15.7.
이 기능이 그룹에 대해 활성화되면, API를 사용하여 대상별로 스트리밍된 감사 이벤트를 필터링할 수 있습니다. 기능에 필터가 설정되지 않은 경우, 대상이 모든 감사 이벤트를 수신합니다.
이벤트 유형 필터가 설정된 스트리밍 대상에는 filtered () 라벨이 표시됩니다.
API를 사용하여 이벤트 유형 필터 추가
전제 조건:
- 그룹에 대한 소유자 역할이 있어야 합니다.
auditEventsStreamingDestinationEventsAdd
쿼리 유형을 사용하여 이벤트 유형 필터 디렉터리을 추가할 수 있습니다.
mutation {
auditEventsStreamingDestinationEventsAdd(input: {
destinationId: "gid://gitlab/AuditEvents::ExternalAuditEventDestination/1",
eventTypeFilters: ["list of event type filters"]}){
errors
eventTypeFilters
}
}
이벤트 유형 필터가 다음의 경우에 추가됩니다:
- 반환된
errors
객체가 비어 있는 경우. - API가
200 OK
로 응답하는 경우.
API를 사용하여 이벤트 유형 필터 제거
전제 조건:
- 그룹에 대한 소유자 역할이 있어야 합니다.
auditEventsStreamingDestinationEventsRemove
뮤테이션 유형을 사용하여 이벤트 유형 필터 디렉터리을 제거할 수 있습니다.
mutation {
auditEventsStreamingDestinationEventsRemove(input: {
destinationId: "gid://gitlab/AuditEvents::ExternalAuditEventDestination/1",
eventTypeFilters: ["list of event type filters"]
}){
errors
}
}
이벤트 유형 필터가 다음의 경우에 제거됩니다:
- 반환된
errors
객체가 비어 있는 경우. - API가
200 OK
로 응답하는 경우.
네임스페이스 필터
- 네임스페이스 필터 API introduced in GitLab 16.7.
그룹에 네임스페이스 필터를 적용하면, 사용자는 그룹의 특정 하위 그룹 또는 프로젝트에 대해 대상별로 스트리밍된 감사 이벤트를 필터링할 수 있습니다. 그렇지 않으면, 대상이 모든 감사 이벤트를 수신합니다.
네임스페이스 필터가 설정된 스트리밍 대상에는 filtered () 라벨이 표시됩니다.
API를 사용하여 네임스페이스 필터 추가
전제 조건:
- 그룹에 대한 소유자 역할이 있어야 합니다.
하위 그룹 및 프로젝트 모두에 대해 auditEventsStreamingHttpNamespaceFiltersAdd
뮤테이션 유형을 사용하여 네임스페이스 필터를 추가할 수 있습니다.
네임스페이스 필터가 다음의 경우에 추가됩니다:
- API가 빈
errors
객체를 반환하는 경우. - API가
200 OK
로 응답하는 경우.
하위 그룹을 위한 뮤테이션
mutation auditEventsStreamingHttpNamespaceFiltersAdd {
auditEventsStreamingHttpNamespaceFiltersAdd(input: {
destinationId: "gid://gitlab/AuditEvents::ExternalAuditEventDestination/1",
groupPath: "path/to/subgroup"
}) {
errors
namespaceFilter {
id
namespace {
id
name
fullName
}
}
}
}
프로젝트를 위한 뮤테이션
mutation auditEventsStreamingHttpNamespaceFiltersAdd {
auditEventsStreamingHttpNamespaceFiltersAdd(input: {
destinationId: "gid://gitlab/AuditEvents::ExternalAuditEventDestination/1",
projectPath: "path/to/project"
}) {
errors
namespaceFilter {
id
namespace {
id
name
fullName
}
}
}
}
API를 사용하여 네임스페이스 필터 제거하기
전제 조건:
- 그룹에 대한 소유자 역할이어야 합니다.
auditEventsStreamingHttpNamespaceFiltersDelete
뮤테이션 유형을 사용하여 네임스페이스 필터를 제거할 수 있습니다.
mutation auditEventsStreamingHttpNamespaceFiltersDelete {
auditEventsStreamingHttpNamespaceFiltersDelete(input: {
namespaceFilterId: "gid://gitlab/AuditEvents::Streaming::HTTP::NamespaceFilter/5"
}) {
errors
}
}
네임스페이스 필터가 제거됩니다:
- 반환된
errors
객체가 비어 있는 경우 - API가
200 OK
로 응답하는 경우
Google Cloud Logging destinations
- GitLab 16.1에서 소개됨 (링크).
최상위 그룹에 대한 Google Cloud Logging 대상 관리.
Google Cloud Logging 스트리밍 감사 이벤트를 설정하기 전에 전제 조건을 충족해야 합니다.
새로운 Google Cloud Logging 대상 추가
최상위 그룹으로 새로운 Google Cloud Logging 구성 대상을 추가합니다.
전제 조건:
- 최상위 그룹에 대한 소유자 역할이어야 합니다.
- 서비스 계정을 생성하고 Google Cloud Logging을 활성화할 필요한 권한을 가진 Google Cloud 프로젝트가 있어야 합니다.
스트리밍을 활성화하고 구성을 추가하려면 GraphQL API에서 googleCloudLoggingConfigurationCreate
뮤테이션을 사용하세요.
mutation {
googleCloudLoggingConfigurationCreate(input: { groupPath: "my-group", googleProjectIdName: "my-google-project", clientEmail: "my-email@my-google-project.iam.gservice.account.com", privateKey: "YOUR_PRIVATE_KEY", logIdName: "audit-events", name: "destination-name" } ) {
errors
googleCloudLoggingConfiguration {
id
googleProjectIdName
logIdName
clientEmail
name
}
errors
}
}
이벤트 스트리밍이 활성화됩니다:
- 반환된
errors
객체가 비어 있는 경우 - API가
200 OK
로 응답하는 경우
Google Cloud Logging 구성 디렉터리
최상위 그룹에 대한 모든 Google Cloud Logging 구성 대상 디렉터리을 표시합니다.
전제 조건:
- 최상위 그룹에 대한 소유자 역할이어야 합니다.
최상위 그룹의 스트리밍 구성 디렉터리을 보려면 googleCloudLoggingConfigurations
쿼리 유형을 사용하세요.
query {
group(fullPath: "my-group") {
id
googleCloudLoggingConfigurations {
nodes {
id
logIdName
googleProjectIdName
clientEmail
name
}
}
}
}
결과 디렉터리이 비어 있는 경우, 그룹에 대한 감사 스트리밍이 활성화되어 있지 않습니다.
이 쿼리에서 반환된 ID 값을 업데이트 및 삭제 뮤테이션에 사용해야 합니다.
Google Cloud Logging 구성 업데이트
최상위 그룹에 대한 Google Cloud Logging 구성 대상을 업데이트합니다.
전제 조건:
- 최상위 그룹에 대한 소유자 역할이어야 합니다.
최상위 그룹에 대한 스트리밍 구성을 업데이트하려면 googleCloudLoggingConfigurationUpdate
뮤테이션 유형을 사용하세요. 구성 ID를 가져오려면 외부 대상을 모두 나열하세요.
mutation {
googleCloudLoggingConfigurationUpdate(
input: {id: "gid://gitlab/AuditEvents::GoogleCloudLoggingConfiguration/1", googleProjectIdName: "my-google-project", clientEmail: "my-email@my-google-project.iam.gservice.account.com", privateKey: "YOUR_PRIVATE_KEY", logIdName: "audit-events", name: "updated-destination-name" }
) {
errors
googleCloudLoggingConfiguration {
id
logIdName
googleProjectIdName
clientEmail
name
}
}
}
스트리밍 구성이 업데이트됩니다:
- 반환된
errors
객체가 비어 있는 경우 - API가
200 OK
로 응답하는 경우
Google Cloud Logging 구성 삭제
최상위 그룹에 대한 스트리밍 대상 삭제.
마지막 대상이 성공적으로 삭제되면 그룹의 스트리밍이 비활성화됩니다.
전제 조건:
- 최상위 그룹에 대한 소유자 역할이어야 합니다.
그룹의 소유자 역할을 가진 사용자는 googleCloudLoggingConfigurationDestroy
뮤테이션 유형을 사용하여 스트리밍 구성을 삭제할 수 있습니다. 구성 ID는 그룹의 모든 스트리밍 대상 디렉터리을 열거하거나 위의 뮤테이션에서 가져올 수 있습니다.
mutation {
googleCloudLoggingConfigurationDestroy(input: { id: "gid://gitlab/AuditEvents::GoogleCloudLoggingConfiguration/1" }) {
errors
}
}
스트리밍 구성이 삭제됩니다:
- 반환된
errors
객체가 비어 있는 경우 - API가
200 OK
로 응답하는 경우
인스턴스 스트리밍 대상
- 링크에서 GitLab 16.0에 도입됨.
ff_external_audit_events
라는 플래그로 비활성화됨.- GitLab 16.2에서 기본적으로 활성화됨
ff_external_audit_events
플래그.- 인스턴스 스트리밍 대상은 GitLab 16.4에서 일반적으로 사용 가능해짐. 피처 플래그
ff_external_audit_events
이 제거됨.
전체 인스턴스에 대한 스트리밍 대상 관리.
HTTP 대상
전체 인스턴스에 대한 HTTP 스트리밍 대상 관리.
새로운 HTTP 대상 추가
인스턴스에 새로운 HTTP 스트리밍 대상을 추가합니다.
전제 조건:
- 인스턴스에서의 관리자 액세스 권한이 있어야 합니다.
스트리밍을 활성화하고 대상을 추가하려면 GraphQL API에서 instanceExternalAuditEventDestinationCreate
뮤테이션을 사용하세요.
mutation {
instanceExternalAuditEventDestinationCreate(input: { destinationUrl: "https://mydomain.io/endpoint/ingest"}) {
errors
instanceExternalAuditEventDestination {
destinationUrl
id
name
verificationToken
}
}
}
이벤트 스트리밍이 활성화됩니다:
- 반환된
errors
객체가 비어 있는 경우 - API가
200 OK
로 응답하는 경우
기본적으로 GitLab에서 생성된 대신 고유한 대상 이름(기본값 대신)을 지정할 수 있습니다. GraphQL instanceExternalAuditEventDestinationCreate
뮤테이션을 사용하여 고유한 대상 이름(기본값 대신)을 지정할 수 있습니다. 이름의 길이는 72자를 초과할 수 없으며 끝에 공백은 자르지 않습니다. 이 값은 고유해야 합니다. 예:
mutation {
instanceExternalAuditEventDestinationCreate(input: { destinationUrl: "https://mydomain.io/endpoint/ingest", name: "destination-name-here"}) {
errors
instanceExternalAuditEventDestination {
destinationUrl
id
name
verificationToken
}
}
}
인스턴스 관리자는 GraphQL auditEventsStreamingInstanceHeadersCreate
뮤테이션을 사용하여 HTTP 헤더를 추가할 수 있습니다. 인스턴스가 반환하는 대상 ID를 가져오려면 스트리밍 대상을 모두 나열하거나 위의 뮤테이션에서 가져올 수 있습니다.
mutation {
auditEventsStreamingInstanceHeadersCreate(input:
{
destinationId: "gid://gitlab/AuditEvents::InstanceExternalAuditEventDestination/42",
key: "foo",
value: "bar",
active: true
}) {
errors
header {
id
key
value
active
}
}
}
반환된 errors
객체가 비어 있는 경우 헤더가 생성됩니다.
스트리밍 대상 디렉터리
인스턴스의 모든 HTTP 스트리밍 대상을 나열합니다.
필수 조건:
- 인스턴스에서의 관리자 액세스
인스턴스의 스트리밍 대상 디렉터리을 보려면 instanceExternalAuditEventDestinations
쿼리 유형을 사용하세요.
query {
instanceExternalAuditEventDestinations {
nodes {
id
name
destinationUrl
verificationToken
headers {
nodes {
id
key
value
active
}
}
eventTypeFilters
}
}
}
결과 디렉터리이 비어 있으면 인스턴스의 감사 스트리밍이 활성화되어 있지 않습니다.
이 쿼리에서 반환된 ID 값을 업데이트 및 삭제 변이에 사용해야 합니다.
스트리밍 대상 업데이트
인스턴스의 HTTP 스트리밍 대상을 업데이트합니다.
필수 조건:
- 인스턴스에서의 관리자 액세스
인스턴스의 스트리밍 대상을 업데이트하려면 instanceExternalAuditEventDestinationUpdate
변이 유형을 사용하세요. 목적지 ID를 검색할 수 있습니다
외부 대상 모두 나열.
mutation {
instanceExternalAuditEventDestinationUpdate(input: {
id: "gid://gitlab/AuditEvents::InstanceExternalAuditEventDestination/1",
destinationUrl: "https://www.new-domain.com/webhook",
name: "destination-name"}) {
errors
instanceExternalAuditEventDestination {
destinationUrl
id
name
verificationToken
}
}
}
스트리밍 대상은 다음과 같은 경우에 업데이트됩니다:
- 반환된
errors
객체가 비어 있는 경우. - API가
200 OK
로 응답한 경우.
인스턴스 관리자는 auditEventsStreamingInstanceHeadersUpdate
변이 유형을 사용하여 스트리밍 대상 사용자 지정 HTTP 헤더를 업데이트할 수 있습니다. 사용자 정의 HTTP 헤더 ID를 검색할 수 있습니다
스트리밍 대상 모두 나열.
mutation {
auditEventsStreamingInstanceHeadersUpdate(input: { headerId: "gid://gitlab/AuditEvents::Streaming::InstanceHeader/2", key: "new-key", value: "new-value", active: false }) {
errors
header {
id
key
value
active
}
}
}
반환된 errors
객체가 비어 있는 경우 헤더가 업데이트됩니다.
스트리밍 대상 삭제
인스턴스 전체의 스트리밍 대상을 삭제합니다.
마지막 목적지가 성공적으로 삭제되면 해당 인스턴스에서 스트리밍이 비활성화됩니다.
필수 조건:
- 인스턴스에서의 관리자 액세스
스트리밍 대상 삭제에는 instanceExternalAuditEventDestinationDestroy
변이 유형을 사용하세요. 목적지 ID를 검색할 수 있습니다
스트리밍 대상 모두 나열.
mutation {
instanceExternalAuditEventDestinationDestroy(input: { id: "gid://gitlab/AuditEvents::InstanceExternalAuditEventDestination/1" }) {
errors
}
}
스트리밍 대상은 다음과 같은 경우에 삭제됩니다:
- 반환된
errors
객체가 비어 있는 경우. - API가
200 OK
로 응답한 경우.
HTTP 헤더를 제거하려면 GraphQL auditEventsStreamingInstanceHeadersDestroy
변이를 사용하세요.
헤더 ID를 검색하려면 사용자 정의 HTTP 헤더를 모두 나열하세요.
mutation {
auditEventsStreamingInstanceHeadersDestroy(input: { headerId: "gid://gitlab/AuditEvents::Streaming::InstanceHeader/<id>" }) {
errors
}
}
반환된 errors
객체가 비어 있는 경우 헤더가 삭제됩니다.
이벤트 유형 필터
- 이벤트 유형 필터 API는 GitLab 16.2에서 소개되었습니다.
인스턴스에서이 기능을 활성화하면 API를 사용하여 사용자에게 대상별로 스트리밍 감사 이벤트 필터링을 허용할 수 있습니다. 필터가 없이 기능이 활성화된 경우 대상은 모든 감사 이벤트를 수신합니다.
이벤트 유형 필터가 설정된 스트리밍 대상에는 필터링됨 () 라벨이 있습니다.
API를 사용하여 이벤트 유형 필터 추가
필수 조건:
- 인스턴스에 대한 관리자 액세스가 있어야 합니다.
auditEventsStreamingDestinationInstanceEventsAdd
변이를 사용하여 이벤트 유형 필터 디렉터리을 추가할 수 있습니다.
mutation {
auditEventsStreamingDestinationInstanceEventsAdd(input: {
destinationId: "gid://gitlab/AuditEvents::InstanceExternalAuditEventDestination/1",
eventTypeFilters: ["이벤트 유형 필터 디렉터리"]}){
errors
eventTypeFilters
}
}
이벤트 유형 필터가 추가되면 다음과 같은 경우입니다:
- 반환된
errors
객체가 비어 있는 경우. - API가
200 OK
로 응답한 경우.
API를 사용하여 이벤트 유형 필터 제거
필수 조건:
- 인스턴스에 대한 관리자 액세스가 있어야 합니다.
auditEventsStreamingDestinationInstanceEventsRemove
변이를 사용하여 이벤트 유형 필터 디렉터리을 제거할 수 있습니다.
mutation {
auditEventsStreamingDestinationInstanceEventsRemove(input: {
destinationId: "gid://gitlab/AuditEvents::InstanceExternalAuditEventDestination/1",
eventTypeFilters: ["이벤트 유형 필터 디렉터리"]
}){
errors
}
}
이벤트 유형 필터가 제거되면 다음과 같은 경우입니다:
- 반환된
errors
객체가 비어 있는 경우. - API가
200 OK
로 응답한 경우.
Google Cloud Logging 대상
- GitLab 16.5에서 소개되었습니다.
전체 인스턴스를 위한 Google Cloud Logging 대상을 관리합니다.
Google Cloud Logging으로 스트리밍 감사 이벤트를 설정하기 전에 필수 조건을 충족해야 합니다.
새 Google Cloud Logging 대상 추가
인스턴스에 새 Google Cloud Logging 구성 대상을 추가합니다.
필수 조건:
- 인스턴스에 대한 관리자 액세스가 있어야 합니다.
- Google Cloud 프로젝트에서 서비스 계정을 만들고 Google Cloud Logging을 활성화하는 데 필요한 권한이 있어야 합니다.
스트리밍을 활성화하고 구성을 추가하려면 GraphQL API에서 instanceGoogleCloudLoggingConfigurationCreate
변이를 사용하세요.
mutation {
instanceGoogleCloudLoggingConfigurationCreate(input: { googleProjectIdName: "my-google-project", clientEmail: "my-email@my-google-project.iam.gservice.account.com", privateKey: "YOUR_PRIVATE_KEY", logIdName: "audit-events", name: "destination-name" } ) {
errors
googleCloudLoggingConfiguration {
id
googleProjectIdName
logIdName
clientEmail
name
}
errors
}
}
이벤트 스트리밍이 활성화되면 다음과 같은 경우입니다:
- 반환된
errors
객체가 비어 있는 경우. - API가
200 OK
로 응답한 경우.
Google Cloud Logging 구성 디렉터리
인스턴스의 Google Cloud Logging 구성 대상을 모두 나열합니다.
전제 조건:
- 해당 인스턴스에 대한 관리자 액세스 권한이 있어야 합니다.
instanceGoogleCloudLoggingConfigurations
쿼리 유형을 사용하여 인스턴스의 스트리밍 구성 디렉터리을 볼 수 있습니다.
query {
instanceGoogleCloudLoggingConfigurations {
nodes {
id
logIdName
googleProjectIdName
clientEmail
name
}
}
}
결과 디렉터리이 비어 있다면, 해당 인스턴스에 대해 감사 스트리밍이 활성화되어 있지 않습니다.
업데이트 및 삭제 뮤테이션을 위해 이 쿼리에서 반환된 ID 값을 필요로 합니다.
Google Cloud Logging 구성 업데이트
인스턴스의 Google Cloud Logging 구성 대상을 업데이트합니다.
전제 조건:
- 해당 인스턴스에 대한 관리자 액세스 권한이 있어야 합니다.
인스턴스의 스트리밍 구성을 업데이트하려면 instanceGoogleCloudLoggingConfigurationUpdate
변이 유형을 사용하십시오. 모든 외부 대상을 나열하여 구성 ID를 검색할 수 있습니다.
mutation {
instanceGoogleCloudLoggingConfigurationUpdate(
input: {id: "gid://gitlab/AuditEvents::Instance::GoogleCloudLoggingConfiguration/1", googleProjectIdName: "updated-google-id", clientEmail: "updated@my-google-project.iam.gservice.account.com", privateKey: "YOUR_PRIVATE_KEY", logIdName: "audit-events", name: "updated name"}
) {
errors
instanceGoogleCloudLoggingConfiguration {
id
logIdName
googleProjectIdName
clientEmail
name
}
}
}
다음이 적용되면 스트리밍 구성이 업데이트됩니다:
- 반환된
errors
객체가 비어 있어야 합니다. - API가
200 OK
로 응답해야 합니다.
Google Cloud Logging 구성 삭제
인스턴스의 스트리밍 대상을 삭제합니다.
마지막 대상이 성공적으로 삭제되면 해당 인스턴스에서 스트리밍이 비활성화됩니다.
전제 조건:
- 해당 인스턴스에 대한 관리자 액세스 권한이 있어야 합니다.
스트리밍 구성을 삭제하려면 instanceGoogleCloudLoggingConfigurationDestroy
뮤테이션 유형을 사용하십시오. 인스턴스의 모든 스트리밍 대상을 나열하여 구성 ID를 검색할 수 있습니다.
mutation {
instanceGoogleCloudLoggingConfigurationDestroy(input: { id: "gid://gitlab/AuditEvents::Instance::GoogleCloudLoggingConfiguration/1" }) {
errors
}
}
다음이 적용되면 스트리밍 구성이 삭제됩니다:
- 반환된
errors
객체가 비어 있어야 합니다. - API가
200 OK
로 응답해야 합니다.