Cisco AMP for Endpoints 로그 수집

다음에서 지원:

이 문서에서는 Amazon S3를 사용하여 Cisco AMP for Endpoints 로그를 Google Security Operations에 수집하는 방법을 설명합니다. 파서는 원시 JSON 형식 로그를 Chronicle UDM을 준수하는 구조화된 형식으로 변환합니다. 중첩된 JSON 객체에서 필드를 추출하고, UDM 스키마에 매핑하고, 이벤트 카테고리를 식별하고, 심각도 수준을 할당하고, 궁극적으로 통합된 이벤트 출력을 생성하여 특정 조건이 충족되면 보안 알림을 표시합니다.

시작하기 전에

  • Google SecOps 인스턴스
  • Cisco AMP for Endpoints 콘솔에 대한 권한 있는 액세스
  • AWS (S3, IAM, Lambda, EventBridge)에 대한 권한 액세스

Cisco AMP for Endpoints 필수사항 (ID, API 키, 조직 ID, 토큰) 수집

  1. Cisco AMP for Endpoints 콘솔에 로그인합니다.
  2. 계정 > API 사용자 인증 정보로 이동합니다.
  3. 새 API 사용자 인증 정보를 클릭하여 새 API 키와 클라이언트 ID를 만듭니다.
  4. 다음 구성 세부정보를 제공합니다.
    • 애플리케이션 이름: 이름을 입력합니다 (예: Chronicle SecOps Integration).
    • 범위: 기본 이벤트 폴링의 경우 읽기 전용을 선택하고 이벤트 스트림을 만들 계획이라면 읽기 및 쓰기를 선택합니다.
  5. 만들기를 클릭합니다.
  6. 다음 세부정보를 복사하여 안전한 위치에 저장합니다.
    • 서드 파티 API 클라이언트 ID
    • API 키
    • API 기준 URL: 지역에 따라 다음을 사용합니다.
      • 미국: https://api.amp.cisco.com
      • EU: https://api.eu.amp.cisco.com
      • APJC: https://api.apjc.amp.cisco.com

Google SecOps용 AWS S3 버킷 및 IAM 구성

  1. 이 사용자 가이드(버킷 만들기)에 따라 Amazon S3 버킷을 만듭니다.
  2. 나중에 참조할 수 있도록 버킷 이름리전을 저장합니다 (예: cisco-amp-logs).
  3. 이 사용자 가이드(IAM 사용자 만들기)에 따라 사용자를 만듭니다.
  4. 생성된 사용자를 선택합니다.
  5. 보안 사용자 인증 정보 탭을 선택합니다.
  6. 액세스 키 섹션에서 액세스 키 만들기를 클릭합니다.
  7. 사용 사례서드 파티 서비스를 선택합니다.
  8. 다음을 클릭합니다.
  9. 선택사항: 설명 태그를 추가합니다.
  10. 액세스 키 만들기를 클릭합니다.
  11. CSV 파일 다운로드를 클릭하여 향후 참조할 수 있도록 액세스 키비밀 액세스 키를 저장합니다.
  12. 완료를 클릭합니다.
  13. 권한 탭을 선택합니다.
  14. 권한 정책 섹션에서 권한 추가를 클릭합니다.
  15. 권한 추가를 선택합니다.
  16. 정책 직접 연결을 선택합니다.
  17. AmazonS3FullAccess 정책을 검색합니다.
  18. 정책을 선택합니다.
  19. 다음을 클릭합니다.
  20. 권한 추가를 클릭합니다.

S3 업로드용 IAM 정책 및 역할 구성

  1. AWS 콘솔에서 IAM > 정책으로 이동합니다.
  2. 정책 만들기 > JSON 탭을 클릭합니다.
  3. 다음 정책을 입력합니다.

    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Sid": "AllowPutObjects",
          "Effect": "Allow",
          "Action": "s3:PutObject",
          "Resource": "arn:aws:s3:::cisco-amp-logs/*"
        },
        {
          "Sid": "AllowGetStateObject",
          "Effect": "Allow",
          "Action": "s3:GetObject",
          "Resource": "arn:aws:s3:::cisco-amp-logs/cisco-amp-events/state.json"
        }
      ]
    }
    
    • 다른 버킷 이름을 입력한 경우 cisco-amp-logs을 해당 이름으로 바꿉니다.
  4. 다음 > 정책 만들기를 클릭합니다.

  5. IAM > 역할 > 역할 생성 > AWS 서비스 > Lambda로 이동합니다.

  6. 새로 만든 정책을 연결합니다.

  7. 역할 이름을 cisco-amp-lambda-role로 지정하고 역할 만들기를 클릭합니다.

Lambda 함수 만들기

  1. AWS 콘솔에서 Lambda > 함수 > 함수 만들기로 이동합니다.
  2. 처음부터 작성을 클릭합니다.
  3. 다음 구성 세부정보를 제공합니다.

    설정
    이름 cisco-amp-events-collector
    런타임 Python 3.13
    아키텍처 x86_64
    실행 역할 cisco-amp-lambda-role
  4. 함수가 생성되면 코드 탭을 열고 스텁을 삭제하고 다음 코드를 입력합니다 (cisco-amp-events-collector.py).

    import json
    import boto3
    import urllib3
    import base64
    from datetime import datetime, timedelta
    import os
    import logging
    
    # Configure logging
    logger = logging.getLogger()
    logger.setLevel(logging.INFO)
    
    # AWS S3 client and HTTP pool manager
    s3_client = boto3.client('s3')
    http = urllib3.PoolManager()
    
    def lambda_handler(event, context):
        """
        AWS Lambda handler to fetch Cisco AMP events and store them in S3
        """
    
        try:
            # Get environment variables
            s3_bucket = os.environ['S3_BUCKET']
            s3_prefix = os.environ['S3_PREFIX']
            state_key = os.environ['STATE_KEY']
            api_client_id = os.environ['AMP_CLIENT_ID']
            api_key = os.environ['AMP_API_KEY']
            api_base = os.environ['API_BASE']
    
            # Optional parameters
            page_size = int(os.environ.get('PAGE_SIZE', '500'))
            max_pages = int(os.environ.get('MAX_PAGES', '10'))
    
            logger.info(f"Starting Cisco AMP events collection for bucket: {s3_bucket}")
    
            # Get last run timestamp from state file
            last_timestamp = get_last_timestamp(s3_bucket, state_key)
            if not last_timestamp:
                last_timestamp = (datetime.utcnow() - timedelta(days=1)).isoformat() + 'Z'
    
            # Create Basic Auth header
            auth_header = base64.b64encode(f"{api_client_id}:{api_key}".encode()).decode()
            headers = {
                'Authorization': f'Basic {auth_header}',
                'Accept': 'application/json'
            }
    
            # Build initial API URL
            base_url = f"{api_base}/v1/events"
            next_url = f"{base_url}?limit={page_size}&start_date={last_timestamp}"
    
            all_events = []
            page_count = 0
    
            while next_url and page_count < max_pages:
                logger.info(f"Fetching page {page_count + 1} from: {next_url}")
    
                # Make API request using urllib3
                response = http.request('GET', next_url, headers=headers, timeout=60)
    
                if response.status != 200:
                    raise RuntimeError(f"API request failed: {response.status} {response.data[:256]!r}")
    
                data = json.loads(response.data.decode('utf-8'))
    
                # Extract events from response
                events = data.get('data', [])
                if events:
                    all_events.extend(events)
                    logger.info(f"Collected {len(events)} events from page {page_count + 1}")
    
                    # Check for next page
                    next_url = data.get('metadata', {}).get('links', {}).get('next')
                    page_count += 1
                else:
                    logger.info("No events found on current page")
                    break
    
            logger.info(f"Total events collected: {len(all_events)}")
    
            # Store events in S3 if any were collected
            if all_events:
                timestamp_str = datetime.utcnow().strftime('%Y%m%d_%H%M%S')
                s3_key = f"{s3_prefix}cisco_amp_events_{timestamp_str}.ndjson"
    
                # Convert events to NDJSON format (one JSON object per line)
                ndjson_content = 'n'.join(json.dumps(event) for event in all_events)
    
                # Upload to S3
                s3_client.put_object(
                    Bucket=s3_bucket,
                    Key=s3_key,
                    Body=ndjson_content.encode('utf-8'),
                    ContentType='application/x-ndjson'
                )
    
                logger.info(f"Uploaded {len(all_events)} events to s3://{s3_bucket}/{s3_key}")
    
            # Update state file with current timestamp
            current_timestamp = datetime.utcnow().isoformat() + 'Z'
            update_state(s3_bucket, state_key, current_timestamp)
    
            return {
                'statusCode': 200,
                'body': json.dumps({
                    'message': 'Success',
                    'events_collected': len(all_events),
                    'pages_processed': page_count
                })
            }
    
        except Exception as e:
            logger.error(f"Error in lambda_handler: {str(e)}")
            return {
                'statusCode': 500,
                'body': json.dumps({
                    'error': str(e)
                })
            }
    
    def get_last_timestamp(bucket, state_key):
        """
        Get the last run timestamp from S3 state file
        """
        try:
            response = s3_client.get_object(Bucket=bucket, Key=state_key)
            state_data = json.loads(response['Body'].read().decode('utf-8'))
            return state_data.get('last_timestamp')
        except s3_client.exceptions.NoSuchKey:
            logger.info("No state file found, starting from 24 hours ago")
            return None
        except Exception as e:
            logger.warning(f"Error reading state file: {str(e)}")
            return None
    
    def update_state(bucket, state_key, timestamp):
        """
        Update the state file with the current timestamp
        """
        try:
            state_data = {
                'last_timestamp': timestamp,
                'updated_at': datetime.utcnow().isoformat() + 'Z'
            }
    
            s3_client.put_object(
                Bucket=bucket,
                Key=state_key,
                Body=json.dumps(state_data).encode('utf-8'),
                ContentType='application/json'
            )
    
            logger.info(f"Updated state file with timestamp: {timestamp}")
    
        except Exception as e:
            logger.error(f"Error updating state file: {str(e)}")
    
  5. 구성 > 환경 변수로 이동합니다.

  6. 수정 > 새 환경 변수 추가를 클릭합니다.

  7. 제공된 다음 환경 변수를 입력하고 값으로 바꿉니다.

    예시 값
    S3_BUCKET cisco-amp-logs
    S3_PREFIX cisco-amp-events/
    STATE_KEY cisco-amp-events/state.json
    AMP_CLIENT_ID <your-client-id>
    AMP_API_KEY <your-api-key>
    API_BASE https://api.amp.cisco.com (또는 사용자 지역 URL)
    PAGE_SIZE 500
    MAX_PAGES 10
  8. 함수가 생성되면 해당 페이지에 머무르거나 Lambda > 함수 > cisco-amp-events-collector를 엽니다.

  9. 구성 탭을 선택합니다.

  10. 일반 구성 패널에서 수정을 클릭합니다.

  11. 제한 시간5분 (300초)으로 변경하고 저장을 클릭합니다.

EventBridge 일정 만들기

  1. Amazon EventBridge > 스케줄러 > 일정 만들기로 이동합니다.
  2. 다음 구성 세부정보를 제공합니다.
    • 반복 일정: 요금 (1 hour)
    • 타겟: Lambda 함수 cisco-amp-events-collector
    • 이름: cisco-amp-events-collector-1h.
  3. 일정 만들기를 클릭합니다.

선택사항: Google SecOps용 읽기 전용 IAM 사용자 및 키 만들기

  1. AWS 콘솔 > IAM > 사용자 > 사용자 추가로 이동합니다.
  2. Add users를 클릭합니다.
  3. 다음 구성 세부정보를 제공합니다.
    • 사용자: secops-reader를 입력합니다.
    • 액세스 유형: 액세스 키 – 프로그래매틱 액세스를 선택합니다.
  4. 사용자 만들기를 클릭합니다.
  5. 최소 읽기 정책 (맞춤) 연결: 사용자 > secops-reader > 권한 > 권한 추가 > 정책 직접 연결 > 정책 만들기
  6. JSON 편집기에서 다음 정책을 입력합니다.

    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Effect": "Allow",
          "Action": ["s3:GetObject"],
          "Resource": "arn:aws:s3:::cisco-amp-logs/*"
        },
        {
          "Effect": "Allow",
          "Action": ["s3:ListBucket"],
          "Resource": "arn:aws:s3:::cisco-amp-logs"
        }
      ]
    }
    
  7. 이름을 secops-reader-policy로 설정합니다.

  8. 정책 만들기 > 검색/선택 > 다음 > 권한 추가로 이동합니다.

  9. 보안 사용자 인증 정보> 액세스 키> 액세스 키 만들기로 이동합니다.

  10. CSV를 다운로드합니다 (이러한 값은 피드에 입력됨).

Cisco AMP for Endpoints 로그를 수집하도록 Google SecOps에서 피드 구성

  1. SIEM 설정> 피드로 이동합니다.
  2. + 새 피드 추가를 클릭합니다.
  3. 피드 이름 필드에 피드 이름을 입력합니다 (예: Cisco AMP for Endpoints logs).
  4. 소스 유형으로 Amazon S3 V2를 선택합니다.
  5. 로그 유형으로 Cisco AMP를 선택합니다.
  6. 다음을 클릭합니다.
  7. 다음 입력 파라미터의 값을 지정합니다.
    • S3 URI: s3://cisco-amp-logs/cisco-amp-events/
    • 소스 삭제 옵션: 환경설정에 따라 삭제 옵션을 선택합니다.
    • 최대 파일 기간: 지난 일수 동안 수정된 파일을 포함합니다. 기본값은 180일입니다.
    • 액세스 키 ID: S3 버킷에 대한 액세스 권한이 있는 사용자 액세스 키입니다.
    • 보안 비밀 액세스 키: S3 버킷에 액세스할 수 있는 사용자 보안 비밀 키입니다.
    • 애셋 네임스페이스: 애셋 네임스페이스입니다.
    • 수집 라벨: 이 피드의 이벤트에 적용된 라벨입니다.
  8. 다음을 클릭합니다.
  9. 확정 화면에서 새 피드 구성을 검토한 다음 제출을 클릭합니다.

UDM 매핑 테이블

로그 필드 UDM 매핑 논리
활성 read_only_udm.principal.asset.active computer.active에서 직접 매핑됨
connector_guid read_only_udm.principal.asset.uuid computer.connector_guid에서 직접 매핑됨
날짜 read_only_udm.metadata.event_timestamp.seconds 타임스탬프로 변환한 후 date에서 직접 매핑됨
감지 read_only_udm.security_result.threat_name detection에서 직접 매핑됨
detection_id read_only_udm.security_result.detection_fields.value detection_id에서 직접 매핑됨
disposition read_only_udm.security_result.description file.disposition에서 직접 매핑됨
error.error_code read_only_udm.security_result.detection_fields.value error.error_code에서 직접 매핑됨
error.description read_only_udm.security_result.detection_fields.value error.description에서 직접 매핑됨
event_type read_only_udm.metadata.product_event_type event_type에서 직접 매핑됨
event_type_id read_only_udm.metadata.product_log_id event_type_id에서 직접 매핑됨
external_ip read_only_udm.principal.asset.external_ip computer.external_ip에서 직접 매핑됨
file.file_name read_only_udm.target.file.names file.file_name에서 직접 매핑됨
file.file_path read_only_udm.target.file.full_path file.file_path에서 직접 매핑됨
file.identity.md5 read_only_udm.security_result.about.file.md5 file.identity.md5에서 직접 매핑됨
file.identity.md5 read_only_udm.target.file.md5 file.identity.md5에서 직접 매핑됨
file.identity.sha1 read_only_udm.security_result.about.file.sha1 file.identity.sha1에서 직접 매핑됨
file.identity.sha1 read_only_udm.target.file.sha1 file.identity.sha1에서 직접 매핑됨
file.identity.sha256 read_only_udm.security_result.about.file.sha256 file.identity.sha256에서 직접 매핑됨
file.identity.sha256 read_only_udm.target.file.sha256 file.identity.sha256에서 직접 매핑됨
file.parent.disposition read_only_udm.target.resource.attribute.labels.value file.parent.disposition에서 직접 매핑됨
file.parent.file_name read_only_udm.target.resource.attribute.labels.value file.parent.file_name에서 직접 매핑됨
file.parent.identity.md5 read_only_udm.target.resource.attribute.labels.value file.parent.identity.md5에서 직접 매핑됨
file.parent.identity.sha1 read_only_udm.target.resource.attribute.labels.value file.parent.identity.sha1에서 직접 매핑됨
file.parent.identity.sha256 read_only_udm.target.resource.attribute.labels.value file.parent.identity.sha256에서 직접 매핑됨
file.parent.process_id read_only_udm.security_result.about.process.parent_process.pid file.parent.process_id에서 직접 매핑됨
file.parent.process_id read_only_udm.target.process.parent_process.pid file.parent.process_id에서 직접 매핑됨
호스트 이름 read_only_udm.principal.asset.hostname computer.hostname에서 직접 매핑됨
호스트 이름 read_only_udm.target.hostname computer.hostname에서 직접 매핑됨
호스트 이름 read_only_udm.target.asset.hostname computer.hostname에서 직접 매핑됨
ip read_only_udm.principal.asset.ip computer.network_addresses.ip에서 직접 매핑됨
ip read_only_udm.principal.ip computer.network_addresses.ip에서 직접 매핑됨
ip read_only_udm.security_result.about.ip computer.network_addresses.ip에서 직접 매핑됨
mac read_only_udm.principal.mac computer.network_addresses.mac에서 직접 매핑됨
mac read_only_udm.security_result.about.mac computer.network_addresses.mac에서 직접 매핑됨
줄이는 것을 read_only_udm.security_result.severity 다음 논리에 따라 severity에서 매핑됩니다.
- 'Medium' -> 'MEDIUM'
- 'High' 또는 'Critical' -> 'HIGH'
- 'Low' -> 'LOW'
- 그 외 -> 'UNKNOWN_SEVERITY'
타임스탬프 read_only_udm.metadata.event_timestamp.seconds timestamp에서 직접 매핑됨
사용자 read_only_udm.security_result.about.user.user_display_name computer.user에서 직접 매핑됨
사용자 read_only_udm.target.user.user_display_name computer.user에서 직접 매핑됨
vulnerabilities.cve read_only_udm.extensions.vulns.vulnerabilities.cve_id vulnerabilities.cve에서 직접 매핑됨
vulnerabilities.name read_only_udm.extensions.vulns.vulnerabilities.name vulnerabilities.name에서 직접 매핑됨
vulnerabilities.score read_only_udm.extensions.vulns.vulnerabilities.cvss_base_score float로 변환된 후 vulnerabilities.score에서 직접 매핑됨
vulnerabilities.url read_only_udm.extensions.vulns.vulnerabilities.vendor_knowledge_base_article_id vulnerabilities.url에서 직접 매핑됨
vulnerabilities.version read_only_udm.extensions.vulns.vulnerabilities.cvss_version vulnerabilities.version에서 직접 매핑됨
is_alert event_type이 '위협 감지됨', '악용 방지', '실행된 멀웨어', '잠재적 드로퍼 감염', '감염된 파일이 여러 개', '취약한 애플리케이션 감지됨' 중 하나이거나 security_result.severity이 '높음'인 경우 true로 설정됩니다.
is_significant event_type이 '위협 감지됨', '악용 방지', '실행된 멀웨어', '잠재적 드로퍼 감염', '감염된 파일이 여러 개', '취약한 애플리케이션 감지됨' 중 하나이거나 security_result.severity이 '높음'인 경우 true로 설정됩니다.
read_only_udm.metadata.event_type event_typesecurity_result.severity 값을 기반으로 결정됩니다.
- event_type이 '실행된 멀웨어', '위협 감지됨', '잠재적 드로퍼 감염', '클라우드 리콜 감지', '악성 활동 감지', '익스플로잇 방지', '감염된 파일이 여러 개', '클라우드 IOC', '시스템 프로세스 보호', '취약한 애플리케이션 감지됨', '위협 격리됨', '실행 차단됨', '클라우드 리콜 격리 성공', '클라우드 리콜 격리에서 복원 실패', '클라우드 리콜 격리 시도 실패', '격리 실패' 중 하나인 경우 이벤트 유형이 'SCAN_FILE'로 설정됩니다.
- security_result.severity이 'HIGH'이면 이벤트 유형이 'SCAN_FILE'로 설정됩니다.
- has_principalhas_target가 모두 true이면 이벤트 유형이 'SCAN_UNCATEGORIZED'로 설정됩니다.
- 그 외의 경우 이벤트 유형은 'GENERIC_EVENT'로 설정됩니다.
read_only_udm.metadata.log_type 'CISCO_AMP'로 설정
read_only_udm.metadata.vendor_name 'CISCO_AMP'로 설정
read_only_udm.security_result.about.file.full_path file.file_path에서 직접 매핑됨
read_only_udm.security_result.about.hostname computer.hostname에서 직접 매핑됨
read_only_udm.security_result.about.user.user_display_name computer.user에서 직접 매핑됨
read_only_udm.security_result.detection_fields.key detection_id의 경우 '감지 ID', error.error_code의 경우 '오류 코드', error.description의 경우 '오류 설명', file.parent.disposition의 경우 '상위 처리', file.parent.file_name의 경우 '상위 파일 이름', file.parent.identity.md5의 경우 '상위 MD5', file.parent.identity.sha1의 경우 '상위 SHA1', file.parent.identity.sha256의 경우 '상위 SHA256'으로 설정됩니다.
read_only_udm.security_result.summary event_type이 '위협 감지됨', '악용 방지', '실행된 멀웨어', '잠재적 드로퍼 감염', '감염된 파일이 여러 개 있음', '취약한 애플리케이션 감지됨' 중 하나이거나 security_result.severity이 '높음'인 경우 event_type로 설정됩니다.
read_only_udm.target.asset.ip computer.network_addresses.ip에서 직접 매핑됨
read_only_udm.target.resource.attribute.labels.key file.parent.disposition의 경우 'Parent Disposition', file.parent.file_name의 경우 'Parent File Name', file.parent.identity.md5의 경우 'Parent MD5', file.parent.identity.sha1의 경우 'Parent SHA1', file.parent.identity.sha256의 경우 'Parent SHA256'으로 설정됩니다.
timestamp.seconds 타임스탬프로 변환한 후 date에서 직접 매핑됨

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