Sophos Central 로그 수집

다음에서 지원:

이 문서에서는 Bindplane을 사용하여 Sophos Central 로그를 수집하는 방법을 설명합니다. 파서는 JSON 로그를 통합 데이터 모델 (UDM)로 변환합니다. 중첩된 JSON 구조에서 필드를 추출하고, UDM 필드에 매핑하고, type 필드를 기반으로 이벤트 분류를 실행하여 다양한 Sophos Central 이벤트 유형의 구체적인 세부정보와 작업으로 데이터를 보강합니다.

시작하기 전에

  • Google Security Operations 인스턴스가 있는지 확인합니다.
  • Windows 2016 이상 또는 systemd가 설치된 Linux 호스트를 사용하고 있는지 확인합니다.
  • Python을 지속적으로 실행할 수 있는 추가 Windows 또는 Linux 머신이 있는지 확인합니다.
  • 프록시 뒤에서 실행하는 경우 방화벽 포트가 열려 있는지 확인합니다.
  • Sophos XG Firewall에 대한 권한 액세스 권한이 있는지 확인합니다.

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

  1. Google SecOps 콘솔에 로그인합니다.
  2. SIEM 설정 > 수집 에이전트로 이동합니다.
  3. 수집 인증 파일을 다운로드합니다. Bindplane이 설치될 시스템에 파일을 안전하게 저장합니다.

Google SecOps 고객 ID 가져오기

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

Bindplane 에이전트 설치

Windows 설치

  1. 명령 프롬프트 또는 PowerShell을 관리자로 엽니다.
  2. 다음 명령어를 실행합니다.

    msiexec /i "https://github.com/observIQ/bindplane-agent/releases/latest/download/observiq-otel-collector.msi" /quiet
    

Linux 설치

  1. 루트 또는 sudo 권한으로 터미널을 엽니다.
  2. 다음 명령어를 실행합니다.

    sudo sh -c "$(curl -fsSlL https://github.com/observiq/bindplane-agent/releases/latest/download/install_unix.sh)" install_unix.sh
    

추가 설치 리소스

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

  1. 구성 파일에 액세스합니다.

    1. config.yaml 파일을 찾습니다. 일반적으로 Linux에서는 /etc/bindplane-agent/ 디렉터리에 있고 Windows에서는 설치 디렉터리에 있습니다.
    2. 텍스트 편집기 (예: nano, vi, 메모장)를 사용하여 파일을 엽니다.
  2. 다음과 같이 config.yaml 파일을 수정합니다.

    receivers:
        udplog:
            # Replace the port and IP address as required
            listen_address: "0.0.0.0:514"
    
    exporters:
        chronicle/chronicle_w_labels:
            compression: gzip
            # Adjust the path to the credentials file you downloaded in Step 1
            creds: '/path/to/ingestion-authentication-file.json'
            # Replace with your actual customer ID from Step 2
            customer_id: <customer_id>
            endpoint: malachiteingestion-pa.googleapis.com
            # Add optional ingestion labels for better organization
            ingestion_labels:
                log_type: SYSLOG
                namespace: sophos_central
                raw_log_field: body
    
    service:
        pipelines:
            logs/source0__chronicle_w_labels-0:
                receivers:
                    - udplog
                exporters:
                    - chronicle/chronicle_w_labels
    
  3. 인프라에 필요한 대로 포트와 IP 주소를 바꿉니다.

  4. <customer_id>를 실제 고객 ID로 바꿉니다.

  5. Google SecOps 수집 인증 파일 가져오기 섹션에서 인증 파일이 저장된 경로로 /path/to/ingestion-authentication-file.json를 업데이트합니다.

Bindplane 에이전트를 다시 시작하여 변경사항 적용

  • Linux에서 Bindplane 에이전트를 다시 시작하려면 다음 명령어를 실행합니다.

    sudo systemctl restart bindplane-agent
    
  • Windows에서 Bindplane 에이전트를 다시 시작하려면 서비스 콘솔을 사용하거나 다음 명령어를 입력하면 됩니다.

    net stop BindPlaneAgent && net start BindPlaneAgent
    

Sophos Central API 액세스 구성

  1. Sophos Central Admin에 로그인합니다.
  2. 전체 설정 > API 토큰 관리를 선택합니다.
  3. 토큰 추가를 클릭하여 새 토큰을 만듭니다.
  4. 토큰 이름을 입력하고 저장을 클릭합니다. 제공된 토큰의 API 토큰 요약이 표시됩니다.
  5. API 토큰 요약 섹션에서 복사를 클릭하여 API 액세스 URL과 헤더를 복사합니다.

추가 머신에 Python 설치

  1. 웹브라우저를 열고 Python 웹사이트로 이동합니다.
  2. 운영체제 (Windows 또는 Mac)에 맞는 Python 다운로드를 클릭합니다.
  3. Python을 설치합니다.

    • Windows:
      1. 설치 프로그램을 실행합니다.
      2. 경로에 Python 추가라고 표시된 체크박스를 선택합니다.
      3. 지금 설치를 클릭합니다.
    • Mac의 경우:

      1. Python이 이미 설치되어 있을 수 있습니다. 설치되어 있지 않다면 터미널을 사용하여 최신 버전을 설치할 수 있습니다.
      2. 터미널을 열고 다음 명령어를 입력합니다.

        python --version
        

Sophos 통합 스크립트 다운로드

  1. Sophos Central SIEM Integration GitHub Repository의 GitHub 페이지로 이동합니다.
  2. 녹색 코드 버튼 > ZIP 다운로드를 클릭합니다.
  3. ZIP 파일의 압축을 풉니다.

스크립트 구성 설정

  1. 텍스트 편집기로 config.ini 파일을 찾아 엽니다.
  2. 구성 파일을 수정합니다.
    • API 토큰: 이전에 Sophos Central에서 복사한 API 키를 입력합니다.
    • 시스템로그 서버 세부정보: 시스템로그 서버의 세부정보를 입력합니다.
    • 호스트: Bindplane IP 주소를 입력합니다.
    • 포트: Bindplane 포트 번호를 입력합니다.
    • 프로토콜: UDP를 입력합니다 (설정에 따라 TCP 또는 TLS를 사용할 수도 있음).
  3. 파일을 저장합니다.

스크립트 실행

  1. 스크립트 폴더로 이동합니다.

    • Windows의 경우:

      1. Windows 키를 누르고 cmd를 입력합니다.
      2. 명령 프롬프트를 클릭합니다.
      3. 스크립트 폴더로 이동합니다.

        cd C:\Users\YourName\Downloads\Sophos-Central-SIEM-Integration
        
    • macOS의 경우:

      1. 애플리케이션 > 유틸리티로 이동합니다.
      2. Terminal(터미널)을 엽니다.
      3. 스크립트 폴더로 이동합니다.

        cd /Users/YourName/Downloads/Sophos-Central-SIEM-Integration
        
  2. 스크립트를 실행합니다.

    • 다음 명령어를 입력하여 스크립트를 시작합니다.

      python siem.py
      

Windows에서 스크립트가 지속적으로 실행되도록 자동화합니다 (작업 스케줄러 사용).

  1. 시작 메뉴에 작업 스케줄러를 입력하여 작업 스케줄러를 엽니다.
  2. 태스크 만들기를 클릭합니다.
  3. 일반 탭에서 다음을 수행합니다.
    • 작업 이름을 지정합니다(예: Sophos Central Log Export).
  4. 트리거 탭에서 다음을 수행합니다.
    • 새로 만들기를 클릭하고 필요에 따라 태스크를 매일 또는 시작 시 실행되도록 설정합니다.
  5. 작업 탭에서 다음을 수행합니다.
    • 새로 만들기를 클릭하고 프로그램 시작을 선택합니다.
    • python.exe 실행 파일 (일반적으로 C:\PythonXX\python.exe에 있음)을 찾아봅니다.
    • 인수 추가 필드에 스크립트 경로(예: C:\Users\YourName\Downloads\Sophos-Central-SIEM-Integration\siem.py)를 입력합니다.
  6. 확인을 클릭하여 작업을 저장합니다.

스크립트가 Mac에서 지속적으로 실행되도록 자동화합니다 (Cron 작업 사용).

  1. 터미널을 엽니다.
  2. crontab -e를 입력하고 Enter 키를 누릅니다.
  3. 파일 끝에 새 줄을 추가합니다.

    * * * * * /usr/bin/python /Users/YourName/Downloads/Sophos-Central-SIEM-Integration/siem.py
    
  4. 저장하고 편집기를 종료합니다.

UDM 매핑 테이블

로그 필드 UDM 매핑 논리
customer_id target.resource.id customer_id 필드에서 직접 매핑됩니다.
data.core_remedy_items.items.0.descriptor target.process.file.full_path data.core_remedy_items.items.0.descriptor 필드에서 직접 매핑됩니다.
data.source_info.ip principal.ip
principal.asset.ip
data.source_info.ip 필드에서 직접 매핑됩니다.
description metadata.description metadata.event_typeGENERIC_EVENT인 경우 description 필드에서 직접 매핑됩니다.
dhost principal.hostname
principal.asset.hostname
dhost 필드에서 직접 매핑됩니다.
duid security_result.detection_fields.value duid 필드에서 직접 매핑됩니다.
end metadata.event_timestamp RFC 3339 형식으로 파싱되고 event_timestamp 필드에 매핑됩니다.
endpoint_id target.asset_id Device endpoint Id: {endpoint_id}로 매핑됩니다.
endpoint_type security_result.about.labels.value endpoint_type 필드에서 직접 매핑됩니다.
그룹 security_result.category_details group 필드에서 직접 매핑됩니다.
name security_result.description
security_result.summary
name 필드에서 직접 매핑됩니다.
metadata.event_type 파서 내의 type 필드와 추가 로직을 기반으로 결정됩니다. 가능한 값은 FILE_OPEN, SCAN_HOST, SETTING_MODIFICATION, STATUS_HEARTBEAT, SETTING_CREATION, NETWORK_CONNECTION, SCAN_PROCESS, SCAN_UNCATEGORIZED, USER_CREATION, USER_UNCATEGORIZED, STATUS_UPDATE입니다.
metadata.log_type SOPHOS_CENTRAL로 설정합니다.
metadata.product_event_type type 필드에서 직접 매핑됩니다.
metadata.product_name Sophos Central로 설정합니다.
metadata.vendor_name Sophos로 설정합니다.
network.direction 아웃바운드 네트워크 연결을 나타내는 특정 type 값의 경우 OUTBOUND로 설정됩니다.
network.ip_protocol TCP 네트워크 연결을 나타내는 특정 type 값의 경우 TCP로 설정됩니다.
security_result.action grok 패턴을 사용하여 name 필드에서 추출한 action 필드를 기반으로 결정됩니다. 가능한 값은 ALLOW, BLOCK, ALLOW_WITH_MODIFICATION, UNKNOWN_ACTION입니다.
security_result.detection_fields.key duid 필드가 있는 경우 duid으로 설정합니다.
security_result.rule_name 특정 type 값의 grok 패턴을 사용하여 name 필드에서 추출됩니다.
security_result.severity severity 필드에서 매핑됩니다(low -> LOW, medium -> MEDIUM, high/critical -> HIGH).
target.application 특정 type 값의 grok 패턴을 사용하여 name 필드에서 추출됩니다.
target.asset.hostname 특정 type 값의 dhost 필드에서 매핑됩니다.
target.file.full_path 특정 type 값에 대한 grok 패턴을 사용하여 name 필드에서 추출하거나 data.core_remedy_items.items.0.descriptor 또는 core_remedy_items.items.0.descriptor에서 직접 매핑됩니다.
target.file.size grok 패턴을 사용하여 name 필드에서 추출되고 특정 type 값에 대해 uinteger로 변환됩니다.
target.hostname 특정 type 값의 dhost 필드에서 매핑됩니다.
target.resource.name type 필드를 기반으로 특정 값으로 설정되거나 grok 패턴을 사용하여 name 필드에서 추출됩니다.
target.resource.type type 필드에 따라 특정 값으로 설정됩니다.
target.user.userid grok 패턴을 사용하여 사용자 이름을 추출한 후 suser 필드에서 매핑됩니다.
target.url 특정 type 값의 grok 패턴을 사용하여 name 필드에서 추출됩니다.
source_info.ip principal.ip
principal.asset.ip
source_info.ip 필드에서 직접 매핑됩니다.
suser principal.user.userid
target.user.userid
호스트 이름 접두사를 삭제하기 위해 grok 패턴을 사용하여 suser 필드에서 추출했습니다.
유형 metadata.product_event_type type 필드에서 직접 매핑됩니다.

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