Apple macOS syslog 데이터 수집

다음에서 지원:

이 파서는 grok 패턴을 사용하여 Apple macOS syslog 메시지에서 필드를 추출하고 타임스탬프, 호스트 이름, 중개 호스트, 명령줄, 프로세스 ID, 설명 등 추출된 값으로 통합 데이터 모델 (UDM)을 채웁니다. 파서는 호스트 이름이 있으면 이벤트를 STATUS_UPDATE로 분류하고, 그렇지 않으면 이벤트에 GENERIC_EVENT 카테고리를 할당합니다. 마지막으로 파서는 공급업체 및 제품 정보로 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

macOS에서 Syslog 내보내기

  1. Homebrew를 사용하여 syslog-ng를 설치합니다.

    brew install syslog-ng
    
  2. syslog-ng를 구성합니다.

    • syslog-ng.conf 파일 (일반적으로 /usr/local/etc/syslog-ng/syslog-ng.conf에 있음)을 수정합니다.
    sudo vi /usr/local/etc/syslog-ng/syslog-ng.conf
    
    • 다음 구성 블록을 추가합니다.
      • Bindplane 구성에 따라 전송 방법을 tcp로 변경하거나 udp로 그대로 둘 수 있습니다.
      • <BindPlaneAgent_IP><BindPlaneAgent_Port>를 Bindplane 에이전트의 실제 IP 주소 및 포트로 바꿉니다.
    source s_local { system(); internal(); };
    destination d_secops { tcp("<BindPlaneAgent_IP>:<BindPlaneAgent_Port>"); };
    log { source(s_local); destination(d_secops); };
    
  3. syslog-ng 서비스를 다시 시작합니다.

    brew services restart syslog-ng
    
  4. syslog-ng의 상태를 확인합니다 (syslog-ng가 시작됨으로 표시되어야 함).

    brew services list
    

UDM 매핑 테이블

로그 필드 UDM 매핑 논리
데이터 read_only_udm.metadata.description description 필드의 값은 grok 패턴을 사용하여 원시 로그의 data 필드에서 추출됩니다.
데이터 read_only_udm.principal.hostname 호스트 이름은 grok 패턴을 사용하여 data 필드에서 추출됩니다.
데이터 read_only_udm.intermediary.hostname 중개자 호스트 이름은 grok 패턴을 사용하여 data 필드에서 추출됩니다.
데이터 read_only_udm.principal.process.command_line 프로세스 명령줄은 grok 패턴을 사용하여 data 필드에서 추출됩니다.
데이터 read_only_udm.principal.process.pid 프로세스 ID는 grok 패턴을 사용하여 data 필드에서 추출됩니다.
데이터 read_only_udm.metadata.event_timestamp 이벤트 타임스탬프는 grok 패턴을 사용하여 data 필드에서 추출되고 타임스탬프 객체로 변환됩니다. 파서에서 'MacOS'로 하드코딩됩니다. 파서에서 'Apple'로 하드코딩됩니다. 로그에서 호스트 이름이 추출되면 'STATUS_UPDATE'로 설정하고, 그렇지 않으면 'GENERIC_EVENT'로 설정합니다.
log_type read_only_udm.metadata.log_type 원시 로그의 log_type 필드에서 직접 매핑됩니다.

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