Arista 스위치 로그 수집

다음에서 지원:

이 파서는 JSON 및 syslog 형식을 모두 처리하여 Arista 스위치 로그에서 필드를 추출합니다. grok 패턴을 사용하여 다양한 로그 메시지 유형을 파싱하고, 추출된 필드를 UDM에 매핑하고, 추출된 세부정보를 기반으로 이벤트 유형, 심각도, 주체/타겟 정보와 같은 메타데이터로 이벤트를 보강합니다.

시작하기 전에

  • Google SecOps 인스턴스가 있는지 확인합니다.
  • Windows 2016 이상 또는 systemd가 설치된 Linux 호스트를 사용하고 있는지 확인합니다.
  • 프록시 뒤에서 실행하는 경우 방화벽 포트가 열려 있는지 확인합니다.
  • Arista EOS 4.23.x 이상이 설치되어 있고 액세스할 수 있습니다.
  • Arista EOS 스위치에 관리자 액세스 권한이 있는지 확인합니다.

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: ARISTA_SWITCH
                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
    

Arista 스위치에서 Syslog 구성

  1. Arista 스위치에 로그인합니다.
  2. 구성 모드로 이동합니다.

    Arista# config terminal
    
  3. 로그를 Bindplane 에이전트로 전송하려면 다음 구성으로 스위치를 제공하세요.

    Arista(config)# logging host <bindplane-server-ip> <port-number> protocol [tcp/udp]
    Arista(config)# logging trap information
    Arista(config)# copy running-config startup-config
    
    * Replace `<bindplane-server-ip>` with Bindplane agent IP address and `<port-number>` with the port configured to listen.
    
  4. 명령어 실행 로그에 대한 추가 구성을 입력합니다.

    Arista (config)# aaa accounting commands all console start-stop logging
    Arista (config)# aaa accounting commands all default start-stop logging
    Arista (config)# aaa accounting exec console start-stop logging
    Arista (config)# aaa accounting exec default start-stop logging
    Arista (config)# copy running-config startup-config
    
  5. 로그온 로그에 대한 추가 구성을 입력합니다.

    Arista (config)# aaa authentication policy on-success log
    Arista (config)# aaa authentication policy on-failure log
    Arista (config)# copy running-config startup-config
    

UDM 매핑 테이블

로그 필드 UDM 매핑 논리
appname target.application appname 필드에서 직접 매핑됩니다.
description metadata.description product_event_type를 기반으로 하는 grok 패턴을 사용하여 message 필드에서 추출된 description 필드에서 직접 매핑됩니다.
dst_ip target.ip, target.asset.ip grok 패턴을 사용하여 message 필드에서 추출된 dst_ip 필드에서 직접 매핑됩니다.
dst_mac target.mac grok 패턴을 사용하여 message 필드에서 추출된 dst_mac 필드에서 직접 매핑됩니다.
dst_port target.port grok 패턴을 사용하여 message 필드에서 추출된 dst_port 필드에서 직접 매핑됩니다.
facility additional.fields[facility].string_value facility 필드에서 직접 매핑됩니다.
hostname principal.hostname, principal.asset.hostname hostname 필드에서 직접 매핑됩니다.
inner_msg metadata.description grok 패턴을 사용하여 message 필드에서 추출된 inner_msg 필드에서 직접 매핑됩니다.
ip_protocol network.ip_protocol grok 패턴을 사용하여 message 필드에서 추출된 ip_protocol 필드에서 직접 매핑됩니다. 값이 'tcp'인 경우 'TCP'로 변환됩니다. 이벤트 유형이 'NO_IGMP_QUERIER'인 경우 'IGMP'로 설정됩니다.
pid principal.process.pid grok 패턴을 사용하여 message 필드에서 추출된 pid 필드에서 직접 매핑됩니다.
prin_ip principal.ip, principal.asset.ip grok 패턴을 사용하여 message 필드에서 추출된 prin_ip 필드에서 직접 매핑됩니다.
product_event_type metadata.product_event_type grok 패턴을 사용하여 message 필드에서 추출된 product_event_type 필드에서 직접 매핑됩니다.
proto network.application_protocol proto 필드가 'sshd'인 경우 UDM 필드가 'SSH'로 설정됩니다.
severity security_result.severity, security_result.severity_details security_result.severity는 이러한 매핑을 기반으로 severity 필드에서 파생됩니다. 'DEFAULT', 'DEBUG', 'INFO', 'NOTICE' -> 'INFORMATIONAL'; 'WARNING', 'ERROR', 'ERR', 'WARN' -> 'MEDIUM'; 'CRITICAL', 'ALERT', 'EMERGENCY' -> 'HIGH' severity의 원시 값은 security_result.severity_details에 매핑됩니다.
session_id network.session_id grok 패턴을 사용하여 message 필드에서 추출된 session_id 필드에서 직접 매핑됩니다.
source_ip principal.ip, principal.asset.ip grok 패턴을 사용하여 message 필드에서 추출된 source_ip 필드에서 직접 매핑됩니다.
source_port principal.port grok 패턴을 사용하여 message 필드에서 추출된 source_port 필드에서 직접 매핑됩니다.
src_ip principal.ip, principal.asset.ip grok 패턴을 사용하여 message 필드에서 추출된 src_ip 필드에서 직접 매핑됩니다.
table_name target.resource.name grok 패턴을 사용하여 message 필드에서 추출된 table_name 필드에서 직접 매핑됩니다. 이 필드가 채워지면 target.resource.resource_type이 'TABLE'로 설정됩니다.
target_host target.hostname, target.asset.hostname grok 패턴을 사용하여 message 필드에서 추출된 target_host 필드에서 직접 매핑됩니다.
target_ip target.ip, target.asset.ip grok 패턴을 사용하여 message 필드에서 추출된 target_ip 필드에서 직접 매핑됩니다.
target_package target.process.command_line grok 패턴을 사용하여 message 필드에서 추출된 target_package 필드에서 직접 매핑됩니다.
target_port target.port grok 패턴을 사용하여 message 필드에서 추출된 target_port 필드에서 직접 매핑됩니다.
timestamp metadata.event_timestamp 타임스탬프 객체로 파싱된 후 timestamp 필드에서 직접 매핑됩니다.
user principal.user.userid grok 패턴을 사용하여 message 필드에서 추출된 user 필드에서 직접 매핑됩니다.
user_name target.user.userid grok 패턴을 사용하여 message 필드에서 추출된 user_name 필드에서 직접 매핑됩니다.
vrf additional.fields[vrf].string_value grok 패턴을 사용하여 message 필드에서 추출된 vrf 필드에서 직접 매핑됩니다. 파서 코드에 설명된 복잡한 조건부 로직을 사용하여 has_principal, has_target, user, message, product_event_type, description 필드의 조합에서 파생됩니다. 기본값은 'GENERIC_EVENT'입니다. 'ARISTA_SWITCH'로 하드코딩됩니다. 'Arista Switch'로 하드코딩됩니다. 'Arista'로 하드코딩됩니다. description 필드에 'connection rejected'가 포함된 경우 'BLOCK'으로 설정됩니다.
dpid additional.fields[DPID].string_value dpid 필드에서 직접 매핑됩니다.
intf additional.fields[intf].string_value intf 필드에서 직접 매핑됩니다.

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