Linux 감사 및 AIX 시스템 로그 수집

다음에서 지원:

이 파서는 SYSLOG 형식의 Linux 감사 로그를 처리하여 UDM으로 변환합니다. JSON 형식 및 일반 텍스트 로그 메시지를 모두 처리하고, grok, XML 파싱, JSON 파싱 기법을 사용하여 필드를 추출하고, 이벤트 유형에 따라 적절한 UDM 필드에 매핑합니다. 파서는 AIX 시스템의 특정 감사 로그 형식도 처리하고 security_result 및 중간 세부정보와 같은 추가 필드로 UDM을 보강합니다.

시작하기 전에

  • Google Security Operations 인스턴스가 있는지 확인합니다.
  • Auditd 호스트에 대한 루트 액세스 권한이 있는지 확인합니다.
  • Auditd 호스트에 rsyslog를 설치했는지 확인합니다.
  • systemd가 있는 Windows 2012 SP2 이상 또는 Linux 호스트가 있는지 확인합니다.
  • 프록시 뒤에서 실행하는 경우 방화벽 포트가 열려 있는지 확인합니다.

Google SecOps 수집 인증 파일 가져오기

  1. Google SecOps 콘솔에 로그인합니다.
  2. SIEM 설정 > 수집 에이전트로 이동합니다.
  3. 수집 인증 파일을 다운로드합니다.

Google SecOps 고객 ID 가져오기

  1. Google SecOps 콘솔에 로그인합니다.
  2. SIEM 설정 > 프로필로 이동합니다.
  3. 조직 세부정보 섹션에서 고객 ID를 복사하여 저장합니다.

Bindplane 에이전트 설치

  1. Windows 설치의 경우 다음 스크립트를 실행합니다.
    msiexec /i "https://github.com/observIQ/bindplane-agent/releases/latest/download/observiq-otel-collector.msi" /quiet
  2. Linux 설치의 경우 다음 스크립트를 실행합니다.
    sudo sh -c "$(curl -fsSlL https://github.com/observiq/bindplane-agent/releases/latest/download/install_unix.sh)" install_unix.sh
  3. 추가 설치 옵션은 이 설치 가이드를 참고하세요.

Syslog를 수집하여 Google SecOps로 전송하도록 Bindplane 에이전트 구성

  1. Bindplane이 설치된 머신에 액세스합니다.
  2. 다음과 같이 config.yaml 파일을 수정합니다.

    receivers:
      tcplog:
        # Replace the below port <54525> and IP <0.0.0.0> with your specific values
        listen_address: "0.0.0.0:54525" 
    
    exporters:
        chronicle/chronicle_w_labels:
            compression: gzip
            # Adjust the creds location below according the placement of the credentials file you downloaded
            creds: '{ json file for creds }'
            # Replace <customer_id> below with your actual ID that you copied
            customer_id: <customer_id>
            endpoint: malachiteingestion-pa.googleapis.com
            # You can apply ingestion labels below as preferred
            ingestion_labels:
            log_type: SYSLOG
            namespace: auditd
            raw_log_field: body
    service:
        pipelines:
            logs/source0__chronicle_w_labels-0:
                receivers:
                    - tcplog
                exporters:
                    - chronicle/chronicle_w_labels
    
  3. 다음 명령어를 사용하여 변경사항을 적용하도록 Bindplane 에이전트를 다시 시작합니다. sudo systemctl bindplane restart

Auditd에서 Syslog 내보내기

  1. 감사 로그를 내보내려는 머신에 액세스합니다.
  2. Auditd 구성 파일 (일반적으로 /etc/audit/auditd.conf에 있음)을 엽니다.

    sudo vi /etc/audit/auditd.conf
    
  3. 다음 줄을 찾아 감사 데몬을 구성하거나 추가합니다.

    active = yes
    output = syslog
    log_format = ENRICHED
    dispatcher = /sbin/audispd
    

선택사항: Syslog Facility 지정: auditd.conf에서 다음 줄을 추가하거나 수정합니다.

```none
syslog_facility = LOG_AUTHPRIV
```
  1. audispd 구성 파일 (일반적으로 /etc/audisp/plugins.d/syslog.conf에 있음)을 엽니다.

    sudo vi /etc/audisp/plugins.d/syslog.conf
    
  2. 다음 줄을 찾아 추가하여 audispd를 구성합니다.

    active = yes
    direction = out
    path = builtin_syslog
    type = builtin
    args = LOG_INFO
    format = string
    
  3. 변경사항을 적용하려면 Auditd 서비스를 다시 시작합니다.

    sudo systemctl restart auditd
    
  4. tail와 같은 도구를 사용하여 syslog를 모니터링하고 Auditd 로그가 전송되고 있는지 확인합니다.

    tail -f /var/log/syslog | grep auditd # Follow syslog and filter for auditd messages (path may vary depending on your system)
    
  5. rsyslog.conf를 수정하거나 맞춤 구성을 만듭니다.

    sudo vi /etc/rsyslog.d/50-audit-forwarding.conf
    
  6. 로그를 전달하는 규칙을 추가합니다.

    • if $programname == 'auditd' then @@<Bindplane_Agent>:<Bindplane_Port>
    • UDP의 경우 @, TCP의 경우 @@ 사용
    • <BindPlane_Agent>을 서버의 IP/호스트 이름으로 바꿉니다.
    • <BindPlane_Port>을 서버의 포트로 바꿉니다.
  7. rsyslog 서비스를 다시 시작하여 변경사항을 적용합니다.

    sudo systemctl restart rsyslog
    

UDM 매핑 테이블

로그 필드 UDM 매핑 논리
acct target.user.user_display_name 원시 로그의 acct 값이 UDM의 target.user.user_display_name 필드에 매핑됩니다. 이벤트와 연결된 계정을 나타냅니다.
addr principal.ip 원시 로그의 addr 값이 UDM의 principal.ip 필드에 매핑됩니다. 이벤트에 관련된 주체의 IP 주소를 나타냅니다.
additional.fields additional.fields 파싱된 키-값 쌍 또는 라벨의 추가 필드가 UDM의 additional.fields 배열에 추가됩니다.
agent.googleapis.com/log_file_path (매핑되지 않음) 이 라벨은 일부 원시 로그에 있지만 UDM의 IDM 객체에 매핑되지 않습니다.
algo (이 예시에서는 사용되지 않음) 이 필드는 파서와 일부 원시 로그에 있지만 제공된 예시에서는 사용되지 않으며 최종 UDM에 표시되지 않습니다.
application principal.application 원시 로그의 terminal 필드 또는 로그 유형에 따라 exe과 같은 다른 필드에서 파생됩니다. 관련 애플리케이션을 나타냅니다.
arch security_result.about.platform_version 원시 로그의 arch 필드의 아키텍처가 security_result.about.platform_version에 매핑됩니다.
auid about.user.userid, security_result.detection_fields.auid 감사 사용자 ID (auid)가 about.user.userid에 매핑되고 security_result에 감지 필드로 추가됩니다.
cmd target.process.command_line 원시 로그의 cmd 필드의 명령어가 target.process.command_line에 매핑됩니다.
collection_time (매핑되지 않음) 이 필드는 로그 수집 시간이며 UDM의 IDM 객체에 매핑되지 않습니다.
comm principal.application 명령어 이름 (comm)이 principal.application에 매핑됩니다.
compute.googleapis.com/resource_name principal.hostname 이 라벨의 리소스 이름은 principal.hostname에 매핑됩니다.
create_time (매핑되지 않음) 이 필드는 UDM의 IDM 객체에 매핑되지 않습니다.
cwd security_result.detection_fields.cwd 현재 작업 디렉터리 (cwd)가 security_result에 감지 필드로 추가됩니다.
data (처리됨) data 필드에는 기본 로그 메시지가 포함되어 있으며 파서에 의해 처리되어 다양한 필드가 추출됩니다. 단일 UDM 필드에 직접 매핑되지 않습니다.
exe principal.process.file.full_path, target.process.file.full_path 실행 파일 경로 (exe)는 컨텍스트에 따라 principal.process.file.full_path 또는 target.process.file.full_path에 매핑됩니다.
extensions.auth.type extensions.auth.type 인증 유형은 이벤트 유형에 따라 파서 로직에 의해 설정됩니다. MACHINE 또는 AUTHTYPE_UNSPECIFIED으로 설정되는 경우가 많습니다.
fp network.tls.client.certificate.sha256 디지털 지문 (fp)이 파싱되어 SHA256 해시를 추출하고 network.tls.client.certificate.sha256에 매핑됩니다.
insertId (매핑되지 않음) 이 필드는 UDM의 IDM 객체에 매핑되지 않습니다.
jsonPayload.message (처리됨) 이 필드에는 JSON 형식의 기본 로그 메시지가 포함되어 있으며 파서에 의해 처리됩니다.
key security_result.about.registry.registry_key 키 필드는 security_result.about.registry.registry_key에 매핑됩니다.
labels (처리됨) 원시 로그의 라벨이 처리되어 다양한 UDM 필드에 매핑되거나 additional.fields에 추가됩니다.
logName (매핑되지 않음) 이 필드는 UDM의 IDM 객체에 매핑되지 않습니다.
msg security_result.summary 메시지 (msg)는 security_result.summary 필드를 채우는 데 자주 사용됩니다.
network.application_protocol network.application_protocol 이벤트 유형에 따라 파서 로직에 의해 설정됩니다 (예: SSH, HTTP)
network.direction network.direction 이벤트 유형에 따라 파서 로직에 의해 설정됩니다 (예: INBOUND, OUTBOUND)을 사용합니다.
network.ip_protocol network.ip_protocol 파서 로직에 의해 설정되며, 일반적으로 SSH 이벤트의 경우 TCP입니다.
network.session_id network.session_id ses 필드에서 매핑되거나 다른 필드에서 파생됩니다.
network.tls.cipher network.tls.cipher 암호 정보는 원시 로그에서 추출되어 이 필드에 매핑됩니다.
network.tls.curve network.tls.curve 키 교환 곡선이 원시 로그에서 추출되어 이 필드에 매핑됩니다.
pid principal.process.pid, target.process.pid 프로세스 ID (pid)는 컨텍스트에 따라 principal.process.pid 또는 target.process.pid에 매핑됩니다.
ppid principal.process.parent_process.pid, target.process.parent_process.pid 상위 프로세스 ID (ppid)는 컨텍스트에 따라 principal.process.parent_process.pid 또는 target.process.parent_process.pid에 매핑됩니다.
principal.asset.hostname principal.asset.hostname principal.hostname에서 복사됨
principal.asset.ip principal.asset.ip principal.ip에서 복사됨
principal.platform principal.platform 운영체제 (예: LINUX)를 사용합니다.
principal.port principal.port 주 구성원과 연결된 포트 번호입니다.
principal.user.group_identifiers principal.user.group_identifiers 주 사용자와 연결된 그룹 ID입니다.
receiveTimestamp (매핑되지 않음) 이 필드는 로그 수신 타임스탬프이며 UDM의 IDM 객체에 매핑되지 않습니다.
res security_result.action_details 결과 (res)는 security_result.action_details에 매핑됩니다.
resource.labels (매핑되지 않음) 이러한 라벨은 일부 원시 로그에 있지만 UDM의 IDM 객체에 매핑되지 않습니다.
resource.type (매핑되지 않음) 이 필드는 일부 원시 로그에 있지만 UDM의 IDM 객체에 매핑되지 않습니다.
security_result.action security_result.action res 필드에 따라 파서 로직에 의해 설정됩니다 (예: ALLOW, BLOCK)을 사용합니다.
security_result.detection_fields security_result.detection_fields 컨텍스트를 위해 원시 로그의 다양한 필드가 키-값 쌍으로 이 배열에 추가됩니다.
security_result.rule_id security_result.rule_id 파서 로직에 의해 설정되며, syscall 이벤트의 경우 type_name인 경우가 많습니다.
security_result.severity security_result.severity 원시 로그의 심각도 수준에 따라 파서 로직에 의해 설정됩니다.
security_result.summary security_result.summary 이벤트의 요약으로, msg 필드 또는 기타 관련 필드에서 파생되는 경우가 많습니다.
ses network.session_id 세션 ID (ses)가 network.session_id에 매핑됩니다.
source (매핑되지 않음) 이 필드에는 로그 소스에 관한 메타데이터가 포함되며 UDM의 IDM 객체에 매핑되지 않습니다.
subj (처리됨) 주제 필드 (subj)는 사용자 및 보안 컨텍스트 정보를 추출하기 위해 처리됩니다.
syscall security_result.about.labels.Syscall 시스템 호출 번호가 security_result.about 내에 라벨로 추가됩니다.
target.administrative_domain target.administrative_domain 타겟 사용자의 도메인입니다.
target.group.group_display_name target.group.group_display_name 타겟 그룹의 이름입니다.
target.ip target.ip 타겟의 IP 주소입니다.
target.port target.port 타겟과 연결된 포트 번호입니다.
target.process.command_line target.process.command_line 타겟 프로세스의 명령줄입니다.
target.resource.type target.resource.type 파서 로직에 의해 설정된 타겟 리소스의 유형입니다 (예: CREDENTIAL, SETTING)을 참고하세요.
target.user.attribute.permissions target.user.attribute.permissions 타겟 사용자와 관련된 권한입니다.
target.user.group_identifiers target.user.group_identifiers 타겟 사용자와 연결된 그룹 ID입니다.
target.user.userid target.user.userid 타겟의 사용자 ID입니다.
textPayload (처리됨) 파서에 의해 처리되어 다양한 필드를 추출하는 로그의 텍스트 페이로드입니다.
timestamp metadata.event_timestamp 이벤트의 타임스탬프입니다.
tty security_result.about.labels.tty tty는 security_result.about 내에 라벨로 추가됩니다.
type metadata.product_event_type 이벤트 유형 (type)이 metadata.product_event_type에 매핑됩니다.
uid principal.user.userid, target.user.userid 사용자 ID (uid)는 컨텍스트에 따라 principal.user.userid 또는 target.user.userid에 매핑됩니다.

도움이 더 필요하신가요? 커뮤니티 회원 및 Google SecOps 전문가로부터 답변을 받으세요.