# GitLab 로그

## 개요

Panther는 다음을 사용하여 GitLab 로그 온보딩을 지원합니다 [데이터 전송](https://docs.panther.com/ko/data-onboarding/data-transports) 메커니즘.

이 페이지에서는 두 가지 프로세스를 설명합니다: GitLab 감사 로그 온보딩 프로세스와 기타 모든 GitLab 로그 유형의 온보딩 프로세스. 감사 로그는 를 통해 수집되므로 이들 프로세스는 다릅니다 [GitLab 감사 이벤트 스트리밍](https://docs.gitlab.com/ee/administration/audit_event_streaming/), 비감사 로그는 GitLab API를 통해 가져옵니다.

감사 로그는 로 수집할 수 있습니다 [HTTP 소스](https://docs.panther.com/ko/data-onboarding/data-transports/http), 다른 GitLab 로그는 Amazon Web Services (AWS)로 수집할 수 있습니다 [S3](https://docs.panther.com/ko/data-onboarding/data-transports/aws/s3) 와 [SQS](https://docs.panther.com/ko/data-onboarding/data-transports/aws/sqs).

{% hint style="warning" %}
다음을 사용하여 Panther에 GitLab 감사 로그를 수집하려면 [감사 이벤트 스트리밍](https://docs.gitlab.com/ee/administration/audit_event_streaming/) 아래에 설명된 대로, 귀하는 다음을 보유해야 합니다 [GitLab Ultimate](https://about.gitlab.com/pricing/).
{% endhint %}

## GitLab 감사 스트리밍 로그를 Panther에 온보딩하는 방법

이 프로세스는 GitLab [감사](#gitlab.audit) 로그를 온보딩하는 방법을 설명합니다. 예를 들어 다음과 같은 다른 유형의 GitLab 로그를 온보딩하려면 [API](#gitlab.api), [예외](#gitlab.exceptions), [통합](#gitlab.integrations), [Git](#gitlab.git)및 [프로덕션](#gitlab.production) 로그의 경우 아래의 별도 [비감사 GitLab 로그를 Panther에 온보딩하는 방법](#how-to-onboard-non-audit-gitlab-logs-to-panther) 프로세스를 따르세요.

### 1단계: Panther에서 HTTP 소스 생성

1. Panther 콘솔의 왼쪽 탐색 창에서 **구성** > **로그 소스**.
2. 를 선택하고 Panther가 설치된 계정 ID를 입력하십시오. **새로 만들기**.
3. “GitLab”을 검색한 다음 해당 타일을 클릭하세요.
   * 슬라이드아웃 패널에서 **전송 메커니즘** 오른쪽 상단의 드롭다운이 미리 채워져 있으며 **HTTP** 옵션입니다.
4. 를 선택하고 Panther가 설치된 계정 ID를 입력하십시오. **설정 시작**.\
   ![On the GitLab page of the source setup process in Panther, there is a Transport Mechanism dropdown field with a value of HTTP. To its right is a Start Setup button.](https://2400888838-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LgdiSWdyJcXPahGi9Rs-2910905616%2Fuploads%2Fgit-blob-ddbbd6a5ef0b668e0933eb437d7210cdd2350a0d%2Fgitlab%20setup.png?alt=media)
5. Panther의 [HTTP 소스 구성에 대한 지침을 따르세요](https://docs.panther.com/ko/data-transports/http#how-to-set-up-an-http-log-source-in-panther)5단계부터 시작하여.
   * 다음 사용을 요구합니다 [공유 비밀 인증](https://docs.panther.com/ko/data-transports/http#shared-secret)입니다. 이것이 GitLab에서 지원하는 유일한 인증 방법입니다.
   * 사용자를 사용할 것이며, **헤더 이름** 연결된 **비밀 키 값** 은 다음 값으로 잠겨 있습니다 `x-panther-gitlab`.
   * 이 소스로 전송된 페이로드는 다음의 적용을 받습니다 [모든 HTTP 소스에 대한 페이로드 요구사항](https://docs.panther.com/ko/data-transports/http#payload-requirements).
   * HTTP 엔드포인트 생성이 완료될 때까지 다음 단계로 진행하지 마세요.

### 2단계: GitLab에서 감사 로그 스트리밍 설정

* GitLab 문서에서 다음을 따르세요 [새 HTTP 대상 추가](https://docs.gitlab.com/ee/administration/audit_event_streaming/#add-a-new-http-destination) 프로세스.
  * 일반 구성 **대상** 필드에 1단계에서 생성한 URL을 입력하세요.
  * 이름이 있는 헤더를 추가하고 `x-panther-gitlab` 1단계에서 Panther에 구성한 비밀을 입력하세요.

## 비감사 GitLab 로그를 Panther에 온보딩하는 방법

아래 프로세스는 예를 들어 [API](#gitlab.api), [예외](#gitlab.exceptions), [Git](#gitlab.git), [통합](#gitlab.integrations)및 [프로덕션](#gitlab.production) 로그와 같은 비감사 GitLab 로그를 Panther에 온보딩하는 방법을 설명합니다. 감사를 온보딩하려면 [감사](#gitlab.audit) 로그의 경우 아래의 별도 [GitLab 감사 스트리밍 로그를 Panther에 온보딩하는 방법](#how-to-onboard-gitlab-audit-streaming-logs-to-panther) 위의 프로세스를 따르세요.

이 로그를 Panther에 연결하려면:

1. Panther 콘솔에 로그인하십시오.
2. 왼쪽 사이드바에서 클릭하세요 **설정 > 로그 소스**.
3. 를 선택하고 Panther가 설치된 계정 ID를 입력하십시오. **새로 만들기**.
4. 온보딩하려는 로그 유형을 검색한 다음 해당 타일을 클릭하세요.
5. 이 통합에 사용할 데이터 전송 방법을 선택한 다음 해당 방법을 구성하기 위한 Panther의 지침을 따르세요:
   * [AWS S3 버킷](https://docs.panther.com/ko/data-onboarding/data-transports/aws/s3)
   * [AWS SQS](https://docs.panther.com/ko/data-onboarding/data-transports/aws/sqs)
6. GitLab을 구성하여 로그를 데이터 전송 소스로 푸시하세요.
   * 선택한 데이터 전송 소스로 로그를 푸시하는 방법은 GitLab 문서를 참조하세요.

## 지원되는 로그 유형

### GitLab.API

Panther는 최신 버전의 GitLab API 로그를 사용합니다. 일부 필드는 공식 문서와 다를 수 있습니다.

참고: [API JSON 로그에 대한 GitLab 문서](https://docs.gitlab.com/ee/administration/logs/#api_jsonlog).

```yaml
스키마: GitLab.API
설명: |-
    GitLab에서 수신된 API 요청에 대한 GitLab 로그.
    참고: 우리는 최신 버전의 GitLab API 로그를 사용하고 있습니다. 일부 필드는 공식 문서와 다를 수 있습니다
참고URL: https://docs.gitlab.com/ee/administration/logs/#api_jsonlog
필드:
    - 이름: time
      required: true
      설명: 요청 타임스탬프
      type: timestamp
      timeFormats:
        - rfc3339
      isEventTime: true
    - 이름: severity
      required: true
      설명: 로그 레벨
      type: string
    - 이름: duration_s
      required: true
      설명: 요청을 처리하는 데 소요된 시간(초)
      type: float
    - 이름: db_duration_s
      설명: 데이터베이스 쿼리에 소요된 시간(초)
      type: float
    - 이름: view_duration_s
      설명: Rails 컨트롤러 뷰 렌더링에 소요된 시간(초)
      type: float
    - 이름: status
      required: true
      설명: HTTP 응답 상태 코드
      유형: smallint
    - 이름: method
      required: true
      설명: 요청의 HTTP 메서드
      type: string
    - 이름: path
      required: true
      설명: 요청의 URL 경로
      type: string
    - 이름: params
      설명: URL 쿼리 매개변수
      type: array
      element:
        type: object
        필드:
            - 이름: key
              required: true
              설명: 쿼리 매개변수 이름
              type: string
            - 이름: value
              설명: 쿼리 매개변수 값
              유형: json
    - 이름: host
      required: true
      설명: 요청을 제공하는 호스트명
      type: string
      지표:
        - 호스트명
    - 이름: ua
      설명: User-Agent HTTP 헤더
      type: string
    - 이름: route
      required: true
      설명: API 엔드포인트의 Rails 라우트
      type: string
    - 이름: remote_ip
      설명: HTTP 요청의 원격 IP 주소
      type: string
      지표:
        - ip
    - 이름: user_id
      설명: 요청을 한 사용자의 id
      type: bigint
    - 이름: username
      설명: 요청을 한 사용자의 사용자명
      type: string
      지표:
        - 사용자명
    - 이름: gitaly_calls
      설명: Gitaly에 대한 총 호출 횟수
      type: bigint
    - 이름: gitaly_duration_s
      설명: Gitaly 호출에 소요된 총 시간
      type: float
    - 이름: redis_calls
      설명: Redis에 대한 총 호출 횟수
      type: bigint
    - 이름: redis_duration_s
      설명: Redis에서 데이터를 가져오는 데 소요된 총 시간
      type: float
    - 이름: correlation_id
      설명: 로그 전반에 걸친 요청 고유 id
      type: string
      지표:
        - trace_id
    - 이름: queue_duration_s
      설명: 요청이 GitLab Workhorse 내부에서 대기된 총 시간
      type: float
    - 이름: meta.user
      설명: 요청을 호출한 사용자
      type: string
      지표:
        - 사용자명
    - 이름: meta.project
      설명: 요청과 관련된 프로젝트
      type: string
    - 이름: meta.root_namespace
      설명: 루트 네임스페이스
      type: string
    - 이름: meta.caller_id
      설명: 호출자 ID
      type: string
```

### GitLab.Audit

자체 호스팅된 감사 로그 파일과 GitLab의 감사 이벤트 스트리밍 기능 모두에서 발생하는 GitLab 감사 이벤트에 대한 다목적 스키마.

자세한 내용은 [감사 JSON 로그에 대한 GitLab 문서](https://docs.gitlab.com/ee/administration/logs/#audit_jsonlog) 와 [감사 이벤트 스트리밍에 대한 GitLab 문서](https://docs.gitlab.com/ee/administration/audit_event_streaming/).

```yaml
스키마: GitLab.Audit
설명: 자체 호스팅된 감사 로그 파일과 GitLab의 감사 이벤트 스트리밍 기능 모두에서 발생하는 GitLab 감사 이벤트에 대한 다목적 스키마: https://docs.gitlab.com/ee/administration/audit_event_streaming/
참고URL: https://docs.gitlab.com/ee/administration/logs/#audit_jsonlog
필드:
    - 이름: severity
      설명: 로그 레벨. 감사 로그 파일에만 존재합니다.
      type: string
    - 이름: time
      설명: 이벤트 타임스탬프. 감사 로그 파일에만 존재합니다.
      type: timestamp
      timeFormats:
        - rfc3339
      isEventTime: true
    - 이름: author_id
      required: true
      설명: 변경을 수행한 사용자 id
      type: bigint
    - 이름: entity_id
      required: true
      설명: 수정된 엔터티의 id
      type: bigint
    - 이름: entity_type
      required: true
      설명: 수정된 엔터티의 유형
      type: string
    - 이름: change
      설명: 설정 변경 유형. 감사 로그 파일에만 존재합니다.
      type: string
    - 이름: from
      설명: 이전 설정 값. 감사 로그 파일에만 존재합니다.
      type: string
    - 이름: to
      설명: 새로운 설정 값. 감사 로그 파일에만 존재합니다.
      type: string
    - 이름: author_name
      required: true
      설명: 변경을 수행한 사용자의 이름
      type: string
    - 이름: target_id
      설명: 수정된 설정의 대상 id
      type: bigint
    - 이름: target_type
      설명: 수정된 설정의 대상 유형
      type: string
    - 이름: target_details
      설명: 수정된 설정 대상의 세부 정보
      type: string
    - 이름: created_at
      설명: 이벤트가 트리거된 타임스탬프. 감사 이벤트 스트리밍에만 존재합니다.
      type: timestamp
      timeFormats:
        - rfc3339
      isEventTime: true
    - 이름: details
      설명: 추가 메타데이터를 포함하는 JSON 객체. 감사 이벤트 스트리밍에만 존재합니다.
      유형: json
    - 이름: entity_path
      설명: 감사 가능한 이벤트의 영향을 받은 엔터티의 전체 경로. 감사 이벤트 스트리밍에만 존재합니다.
      type: string
    - 이름: event_type
      설명: 감사 이벤트 유형의 문자열 표현. 감사 이벤트 스트리밍에만 존재합니다.
      type: string
    - 이름: id
      설명: 감사 이벤트의 고유 식별자. 감사 이벤트 스트리밍에만 존재합니다.
      type: string
    - 이름: ip_address
      설명: 이벤트를 트리거하는 데 사용된 호스트의 IP 주소. 감사 이벤트 스트리밍에만 존재합니다.
      type: string
      지표:
        - ip
```

### GitLab.Exceptions

그룹 또는 프로젝트 설정 변경을 포함하는 GitLab 로그 파일

참고: [JSON 로그에 대한 예외에 관한 GitLab 문서](https://docs.gitlab.com/ee/administration/logs/#exceptions_jsonlog).

```yaml
스키마: GitLab.Exceptions
설명: 그룹 또는 프로젝트 설정 변경을 포함하는 GitLab 로그 파일
참고URL: https://docs.gitlab.com/ee/administration/logs/#exceptions_jsonlog
필드:
    - 이름: severity
      required: true
      설명: 로그 레벨
      type: string
    - 이름: time
      required: true
      설명: 이벤트 타임스탬프
      type: timestamp
      timeFormats:
        - rfc3339
      isEventTime: true
    - 이름: correlation_id
      설명: 로그 전반에 걸친 요청 고유 id
      type: string
      지표:
        - trace_id
    - 이름: extra.server
      설명: 예외가 발생한 서버에 대한 정보
      type: object
      필드:
        - 이름: os
          설명: 서버 OS 정보
          type: object
          필드:
            - 이름: name
              설명: OS 이름
              type: string
            - 이름: version
              설명: OS 버전
              type: string
            - 이름: build
              설명: OS 빌드
              type: string
        - 이름: runtime
          설명: GitLab 코드를 실행하는 런타임
          type: object
          필드:
            - 이름: name
              설명: 런타임 이름
              type: string
            - 이름: version
              설명: 런타임 버전
              type: string
    - 이름: extra.project_id
      설명: 예외가 발생한 프로젝트 id
      type: bigint
    - 이름: extra.relation_key
      설명: 예외가 발생한 관계
      type: string
    - 이름: extra.relation_index
      설명: 예외가 발생한 관계 인덱스
      type: bigint
    - 이름: exception.class
      required: true
      설명: 발생한 예외의 클래스 이름
      type: string
    - 이름: exception.message
      required: true
      설명: 발생한 예외의 메시지
      type: string
    - 이름: exception.backtrace
      설명: 발생한 예외의 스택 트레이스
      type: array
      element:
        type: string
```

### GitLab.Git

GitLab에서 Git 저장소로의 모든 실패한 요청을 포함하는 GitLab 로그 파일.

참고: [JSON 로그에 대한 git 관련 GitLab 문서](https://docs.gitlab.com/ee/administration/logs/#git_jsonlog).

```yaml
스키마: GitLab.Git
설명: GitLab에서 Git 저장소로의 모든 실패한 요청을 포함하는 GitLab 로그 파일.
참고URL: https://docs.gitlab.com/ee/administration/logs/#git_jsonlog
필드:
    - 이름: severity
      required: true
      설명: 로그 레벨
      type: string
    - 이름: time
      required: true
      설명: 이벤트 타임스탬프
      type: timestamp
      timeFormats:
        - rfc3339
      isEventTime: true
    - 이름: correlation_id
      설명: 로그 전반에 걸친 고유 id
      type: string
      지표:
        - trace_id
    - name: message
      required: true
      설명: git에서 발생한 오류 메시지
      type: string
```

### GitLab.Integrations

Jira, Asana 및 Irker 서비스와 같은 통합 활동에 대한 정보를 포함하는 GitLab 로그.

참고: [JSON 로그에 대한 통합 관련 GitLab 문서](https://docs.gitlab.com/ee/administration/logs/#integrations_jsonlog).

```yaml
스키마: GitLab.Integrations
설명: Jira, Asana 및 Irker 서비스와 같은 통합 활동에 대한 정보를 포함하는 GitLab 로그.
참고URL: https://docs.gitlab.com/ee/administration/logs/#integrations_jsonlog
필드:
    - 이름: severity
      required: true
      설명: 로그 레벨
      type: string
    - 이름: time
      required: true
      설명: 이벤트 타임스탬프
      type: timestamp
      timeFormats:
        - rfc3339
      isEventTime: true
    - 이름: service_class
      required: true
      설명: 통합된 서비스의 클래스 이름
      type: string
    - 이름: project_id
      required: true
      설명: 통합이 실행된 프로젝트 id
      type: bigint
    - 이름: project_path
      required: true
      설명: 통합이 실행된 프로젝트 경로
      type: string
    - name: message
      required: true
      설명: 서비스에서 나온 로그 메시지
      type: string
    - 이름: client_url
      required: true
      설명: 서비스의 클라이언트 URL
      type: string
      지표:
        - url
    - 이름: error
      설명: 오류가 발생한 경우 오류 이름
      type: string
```

### GitLab.Production

GitLab에서 수신된 Production 컨트롤러 요청에 대한 GitLab 로그

참고: [JSON 로그에 대한 production 관련 GitLab 문서](https://docs.gitlab.com/ee/administration/logs/#production_jsonlog).

```yaml
스키마: GitLab.Production
설명: GitLab에서 수신된 Production 컨트롤러 요청에 대한 GitLab 로그
참고URL: https://docs.gitlab.com/ee/administration/logs/#production_jsonlog
필드:
    - 이름: method
      required: true
      설명: 요청의 HTTP 메서드
      type: string
    - 이름: path
      required: true
      설명: 요청의 URL 경로
      type: string
    - 이름: format
      설명: 응답 출력 형식
      type: string
    - 이름: controller
      설명: Production 컨트롤러 클래스 이름
      type: string
    - 이름: action
      설명: Production 컨트롤러 액션
      type: string
    - 이름: status
      required: true
      설명: HTTP 응답 상태 코드
      type: bigint
    - 이름: time
      required: true
      설명: 요청 타임스탬프
      type: timestamp
      timeFormats:
        - rfc3339
      isEventTime: true
    - 이름: params
      설명: URL 쿼리 매개변수
      type: array
      element:
        type: object
        필드:
            - 이름: key
              required: true
              설명: 쿼리 매개변수 이름
              type: string
            - 이름: value
              설명: 쿼리 매개변수 값
              유형: json
    - 이름: remote_ip
      설명: HTTP 요청의 원격 IP 주소
      type: string
      지표:
        - ip
    - 이름: user_id
      설명: 요청을 한 사용자의 id
      type: bigint
    - 이름: username
      설명: 요청을 한 사용자의 사용자명
      type: string
      지표:
        - 사용자명
    - 이름: ua
      설명: 요청자의 User-Agent
      type: string
    - 이름: queue_duration_s
      설명: 요청이 GitLab Workhorse 내부에서 대기된 총 시간
      type: float
    - 이름: gitaly_calls
      설명: Gitaly에 대한 총 호출 횟수
      type: bigint
    - 이름: gitaly_duration_s
      설명: Gitaly 호출에 소요된 총 시간
      type: float
    - 이름: redis_calls
      설명: Redis에 대한 총 호출 횟수
      type: bigint
    - 이름: redis_duration_s
      설명: Redis에서 데이터를 가져오는 데 소요된 총 시간
      type: float
    - 이름: redis_read_bytes
      설명: Redis에서 읽은 총 바이트 수
      type: bigint
    - 이름: redis_write_bytes
      설명: Redis에 기록된 총 바이트 수
      type: bigint
    - 이름: correlation_id
      설명: 로그 전반에 걸친 요청 고유 id
      type: string
      지표:
        - trace_id
    - 이름: cpu_s
      설명: CPU에서 소비된 총 시간
      type: float
    - 이름: db_duration_s
      설명: PostgreSQL에서 데이터를 가져오는 데 소요된 총 시간
      type: float
    - 이름: view_duration_s
      설명: Rails 뷰 내부에서 소요된 총 시간
      type: float
    - 이름: duration_s
      required: true
      설명: 요청을 검색하는 데 소요된 총 시간
      type: float
    - 이름: meta.caller_id
      설명: 호출자 ID
      type: string
    - 이름: location
      설명: (리디렉션에만 적용) 리디렉션 URL
      type: string
    - 이름: exception.class
      설명: 발생한 예외의 클래스 이름
      type: string
    - 이름: exception.message
      설명: 발생한 예외의 메시지
      type: string
    - 이름: exception.backtrace
      설명: 발생한 예외의 스택 트레이스
      type: array
      element:
        type: string
    - 이름: etag_route
      설명: 라우트 이름 etag(리디렉션 시)
      type: string
```
