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] > [Functions] > [Create function] に移動します。
  2. [Author from scratch] をクリックします。
  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] > [Functions] > [cisco-amp-events-collector] を開きます。

  9. [CONFIGURATION] タブを選択します。

  10. [全般設定] パネルで、[編集] をクリックします。

  11. [Timeout] を [5 minutes (300 seconds)] に変更し、[Save] をクリックします。

EventBridge スケジュールを作成する

  1. [Amazon EventBridge] > [Scheduler] > [スケジュールの作成] に移動します。
  2. 次の構成の詳細を入力します。
    • 定期的なスケジュール: レート1 hour)。
    • ターゲット: Lambda 関数 cisco-amp-events-collector
    • 名前: cisco-amp-events-collector-1h
  3. [スケジュールを作成] をクリックします。

省略可: Google SecOps 用の読み取り専用の IAM ユーザーと鍵を作成する

  1. AWS コンソール > IAM > ユーザー > ユーザーを追加 に移動します。
  2. [ユーザーを追加] をクリックします。
  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. [Log type] として [Cisco AMP] を選択します。
  6. [次へ] をクリックします。
  7. 次の入力パラメータの値を指定します。
    • S3 URI: s3://cisco-amp-logs/cisco-amp-events/
    • Source deletion options: 必要に応じて削除オプションを選択します。
    • ファイルの最大経過日数: 指定した日数以内に変更されたファイルを含めます。デフォルトは 180 日です。
    • アクセスキー ID: S3 バケットにアクセスできるユーザー アクセスキー。
    • シークレット アクセスキー: S3 バケットにアクセスできるユーザーのシークレット キー。
    • アセットの名前空間: アセットの名前空間
    • Ingestion labels: このフィードのイベントに適用されるラベル。
  8. [次へ] をクリックします。
  9. [Finalize] 画面で新しいフィードの設定を確認し、[送信] をクリックします。

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 から直接マッピングされます
hostname read_only_udm.principal.asset.hostname computer.hostname から直接マッピングされます
hostname read_only_udm.target.hostname computer.hostname から直接マッピングされます
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」
timestamp 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 浮動小数点数に変換した後、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 が「Threat Detected」、「Exploit Prevention」、「Executed malware」、「Potential Dropper Infection」、「Multiple Infected Files」、「Vulnerable Application Detected」のいずれかである場合、または security_result.severity が「HIGH」の場合は true に設定されます。
is_significant event_type が「Threat Detected」、「Exploit Prevention」、「Executed malware」、「Potential Dropper Infection」、「Multiple Infected Files」、「Vulnerable Application Detected」のいずれかである場合、または security_result.severity が「HIGH」の場合は true に設定されます。
read_only_udm.metadata.event_type event_typesecurity_result.severity の値に基づいて決定されます。
- event_type が「Executed malware」、「Threat Detected」、「Potential Dropper Infection」、「Cloud Recall Detection」、「Malicious Activity Detection」、「Exploit Prevention」、「Multiple Infected Files」、「Cloud IOC」、「System Process Protection」、「Vulnerable Application Detected」、「Threat Quarantined」、「Execution Blocked」、「Cloud Recall Quarantine Successful」、「Cloud Recall Restore from Quarantine Failed」、「Cloud Recall Quarantine Attempt Failed」、「Quarantine Failure」のいずれかの場合、イベントタイプは「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 が「Threat Detected」、「Exploit Prevention」、「Executed malware」、「Potential Dropper Infection」、「Multiple Infected Files」、「Vulnerable Application Detected」のいずれかの場合、または security_result.severity が「HIGH」の場合は、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 のプロフェッショナルから回答を得ることができます。