Fastly WAF ログを収集する

以下でサポートされています。

概要

このパーサーは、Fastly WAF JSON ログからフィールドを抽出し、変換して名前を変更し、UDM にマッピングします。さまざまなデータ型を処理し、重大度レベルを変換し、利用可能な IP 情報とホスト名情報に基づいてイベントを分類します。また、解析の失敗の可能性を処理し、形式が正しくないログエントリを削除します。

始める前に

次の前提条件を満たしていることを確認します。

  • Google SecOps インスタンス。
  • WAF 設定を構成する権限を持つ Fastly アカウント。

フィードを設定する

Google SecOps プラットフォームでフィードを設定するには、次の 2 つのエントリ ポイントがあります。

  • [SIEM 設定] > [フィード]
  • [Content Hub] > [Content Packs]

[SIEM 設定] > [フィード] でフィードを設定する

フィードを構成する手順は次のとおりです。

  1. [SIEM Settings] > [Feeds] に移動します。
  2. [Add New Feed] をクリックします。
  3. 次のページで [単一のフィードを設定] をクリックします。
  4. [Feed name] フィールドに、フィードの名前を入力します(例: Fastly WAF ログ)。
  5. [Source type] として [Webhook] を選択します。
  6. [Log type] として [Fastly WAF] を選択します。
  7. [次へ] をクリックします。
  8. 省略可: 次の入力パラメータの値を指定します。
    • Split delimiter: ログ行を区切るために使用される区切り文字(\n など)。
  9. [次へ] をクリックします。
  10. [Finalize] 画面でフィードの設定を確認し、[Submit] をクリックします。
  11. [秘密鍵を生成する] をクリックして、このフィードを認証するためのシークレット キーを生成します。
  12. 秘密鍵をコピーして保存します。この秘密鍵を再び表示することはできません。必要に応じて、新しい秘密鍵を再生成できますが、この操作により以前の秘密鍵は無効になります。
  13. [詳細] タブで、[エンドポイント情報] フィールドから、フィードのエンドポイント URL をコピーします。このエンドポイント URL をクライアント アプリケーション内で指定する必要があります。
  14. [完了] をクリックします。

コンテンツ ハブからフィードを設定する

次のフィールドに値を指定します。

  • Split delimiter: ログ行を区切るために使用される区切り文字(\n など)。

詳細オプション

  • フィード名: フィードを識別する事前入力された値。
  • ソースタイプ: Google SecOps にログを収集するために使用される方法。
  • アセットの名前空間: フィードに関連付けられた名前空間。
  • Ingestion Labels: このフィードのすべてのイベントに適用されるラベル。

  • [秘密鍵を生成する] をクリックして、このフィードを認証するためのシークレット キーを生成します。

  • 秘密鍵をコピーして保存します。この秘密鍵を再び表示することはできません。必要に応じて、新しい秘密鍵を再生成できますが、この操作により以前の秘密鍵は無効になります。

  • [詳細] タブで、[エンドポイント情報] フィールドから、フィードのエンドポイント URL をコピーします。このエンドポイント URL をクライアント アプリケーション内で指定する必要があります。

Webhook フィード用の API キーを作成する

  1. Google Cloud コンソール > [認証情報] に移動します。

    [認証情報] に移動

  2. [認証情報を作成] をクリックして [API キー] を選択します。

  3. API キーのアクセスを Google Security Operations API に制限します。

エンドポイント URL を指定する

  1. クライアント アプリケーション内で、Webhook フィードで提供される HTTPS エンドポイント URL を指定します。
  2. 次の形式でカスタム ヘッダーの一部として API キーと秘密鍵を指定して、認証を有効にします。

    X-goog-api-key = API_KEY
    X-Webhook-Access-Key = SECRET
    

    推奨事項: API キーは URL 内で指定するのではなくヘッダーとして指定してください。

  3. Webhook クライアントがカスタム ヘッダーをサポートしていない場合は、次の形式のクエリ パラメータを使用して API キーと秘密鍵を指定できます。

    ENDPOINT_URL?key=API_KEY&secret=SECRET
    

    以下を置き換えます。

    • ENDPOINT_URL: フィード エンドポイントの URL。
    • API_KEY: Google Security Operations に対する認証に使用する API キー。
    • SECRET: フィードの認証用に生成した秘密鍵。

Fastly で Webhook を構成する

  1. Fastly にログインします。
  2. 省略可: [Sites] メニューでサイトを選択します(サイトが複数ある場合)。
  3. [Manage] > [Site Integrations] を選択します。
  4. [Add site integration] をクリックします。
  5. [Generic Webhook] を選択します。
  6. Webhook URL: Google SecOps の ENDPOINT_URL の後に API_KEYSECRET を入力します。
  7. Alert Placement: [All activity] または [Specific activity] を選択します。
  8. 省略可: [Specific activity] を選択した場合は、[Activity menu] に移動して、Webhook で送信するアクティビティ タイプを選択します。
  9. [Create site integration] をクリックします。

UDM マッピング テーブル

ログフィールド UDM マッピング 論理
anomaly_score security_result.detection_fields[].key: "anomaly"
security_result.detection_fields[].value: anomaly_score
waf.score.anomaly が 0 または空で、anomaly_score が空でも 0 でもない場合、anomaly_score 値を使用して、security_result.detection_fields 配列に「anomaly」キーと anomaly_score フィールドの値が入力されます。
cache_status additional.fields[].key: "cache_status"
additional.fields[].value.string_value: cache_status
cache_status 値を使用して、additional.fields 配列に「cache_status」キーと cache_status フィールドの値が入力されます。
client_ip principal.ip: client_ip client_ip フィールドは principal.ip にマッピングされます。
connection.fastly_is_edge additional.fields[].key: "fastly_is_edge"
additional.fields[].value.bool_value: connection.fastly_is_edge
connection.fastly_is_edge 値を使用して、additional.fields 配列に「fastly_is_edge」キーと connection.fastly_is_edge フィールドの値が入力されます。
connection.fastly_is_shield additional.fields[].key: "fastly_is_shield"
additional.fields[].value.bool_value: connection.fastly_is_shield
connection.fastly_is_shield 値を使用して、additional.fields 配列に「fastly_is_shield」キーと connection.fastly_is_shield フィールドの値が入力されます。
connection.request_tls_version network.tls.version: connection.request_tls_version connection.request_tls_version フィールドは network.tls.version にマッピングされます。
fastly.server target.hostname: fastly.server fastly.server フィールドは target.hostname にマッピングされます。
fastly.service_id additional.fields[].key: "service_id"
additional.fields[].value.string_value: fastly.service_id
fastly.service_id 値を使用して、additional.fields 配列に「service_id」キーと fastly.service_id フィールドの値が入力されます。
geo.city principal.location.city: geo.city geo.city フィールドは principal.location.city にマッピングされます。
geo.country principal.location.country_or_region: geo.country geo.country フィールドは principal.location.country_or_region にマッピングされます。
geo.location principal.location.region_latitude: geo.location から抽出
principal.location.region_longitude: geo.location から抽出
緯度と経度は、正規表現を使用して geo.location フィールドから抽出され、それぞれ principal.location.region_latitudeprincipal.location.region_longitude にマッピングされます。
geo.region principal.location.state: geo.region geo.region フィールドは principal.location.state にマッピングされます。
host principal.hostname: host host フィールドは principal.hostname にマッピングされます。
request_headers.accept_charset additional.fields[].key: "accept_charset"
additional.fields[].value.string_value: request_headers.accept_charset
request_headers.accept_charset 値を使用して、additional.fields 配列に「accept_charset」キーと request_headers.accept_charset フィールドの値が入力されます。
request_headers.accept_language additional.fields[].key: "accept_language"
additional.fields[].value.string_value: request_headers.accept_language
request_headers.accept_language 値を使用して、additional.fields 配列に「accept_language」キーと request_headers.accept_language フィールドの値が入力されます。
request_headers.referer network.http.referral_url: request_headers.referer request_headers.referer フィールドは network.http.referral_url にマッピングされます。
request_headers.user_agent network.http.user_agent: request_headers.user_agent request_headers.user_agent フィールドは network.http.user_agent にマッピングされます。
request_id metadata.product_log_id: request_id request_id フィールドは metadata.product_log_id にマッピングされます。
request_method network.http.method: request_method request_method フィールドは network.http.method にマッピングされます。
response_headers.cache_control additional.fields[].key: "cache_control"
additional.fields[].value.string_value: response_headers.cache_control
response_headers.cache_control 値を使用して、additional.fields 配列に「cache_control」キーと response_headers.cache_control フィールドの値が入力されます。
response_headers.content_type additional.fields[].key: "content_type"
additional.fields[].value.string_value: response_headers.content_type
response_headers.content_type 値を使用して、additional.fields 配列に「content_type」キーと response_headers.content_type フィールドの値が入力されます。
response_state additional.fields[].key: "response_state"
additional.fields[].value.string_value: response_state
response_state 値を使用して、additional.fields 配列に「response_state」キーと response_state フィールドの値が入力されます。
response_status network.http.response_code: response_status status フィールドが空の場合、response_status フィールドは network.http.response_code にマッピングされます。
rule_id security_result.rule_id: rule_id waf.rule_id が空の場合、rule_id 値を使用して security_result.rule_id が入力されます。
severity waf.severity: severity severity フィールドの値は waf.severity にコピーされます。
size_bytes.request_header network.sent_bytes: size_bytes.request_header size_bytes.request_header フィールドは network.sent_bytes にマッピングされます。
size_bytes.response_header network.received_bytes: size_bytes.response_header size_bytes.response_header フィールドは network.received_bytes にマッピングされます。
status network.http.response_code: status status フィールドは network.http.response_code にマッピングされます。
timestamp metadata.event_timestamp: timestamp timestamp フィールドが解析され、metadata.event_timestamp にマッピングされます。
url target.url: url url フィールドは target.url にマッピングされます。
waf.blocked security_result.action: derived waf.blocked が false の場合、security_result.action は「ALLOW」に設定されます。waf.blocked が true の場合、security_result.action は「BLOCK」に設定されます。
waf.executed security_result.detection_fields[].key: "executed"
security_result.detection_fields[].value: waf.executed
waf.executed 値を使用して、security_result.detection_fields 配列に「executed」キーと waf.executed フィールドの値が入力されます。
waf.failures security_result.detection_fields[].key: "failures"
security_result.detection_fields[].value: waf.failures
waf.failures 値を使用して、security_result.detection_fields 配列に「failures」キーと waf.failures フィールドの値が入力されます。
waf.logged security_result.detection_fields[].key: "logged"
security_result.detection_fields[].value: waf.logged
waf.logged 値を使用して、security_result.detection_fields 配列に「logged」キーと waf.logged フィールドの値が入力されます。
waf.message metadata.description: waf.message waf.message が空でない場合、metadata.description にマッピングされます。
waf.rule_id security_result.rule_id: waf.rule_id waf.rule_id が空でない場合、security_result.rule_id にマッピングされます。
waf.score.anomaly security_result.detection_fields[].key: "anomaly"
security_result.detection_fields[].value: waf.score.anomaly
waf.score.anomaly が 0 でも空でもない場合、その値を使用して、security_result.detection_fields 配列に「anomaly」キーと waf.score.anomaly フィールドの値が入力されます。
waf.score.http_violation security_result.detection_fields[].key: "http_violation"
security_result.detection_fields[].value: waf.score.http_violation
waf.score.http_violation が 0 でも空でもない場合、その値を使用して security_result.detection_fields 配列が入力されます。
waf.score.lfi security_result.detection_fields[].key: "lfi"
security_result.detection_fields[].value: waf.score.lfi
waf.score.http_violation と同様のロジック。
waf.score.php_injection security_result.detection_fields[].key: "php_injection"
security_result.detection_fields[].value: waf.score.php_injection
waf.score.http_violation と同様のロジック。
waf.score.rce security_result.detection_fields[].key: "rce"
security_result.detection_fields[].value: waf.score.rce
waf.score.http_violation と同様のロジック。
waf.score.rfi security_result.detection_fields[].key: "rfi"
security_result.detection_fields[].value: waf.score.rfi
waf.score.http_violation と同様のロジック。
waf.score.session_fixation security_result.detection_fields[].key: "session_fixation"
security_result.detection_fields[].value: waf.score.session_fixation
waf.score.http_violation と同様のロジック。
waf.score.sql_injection security_result.detection_fields[].key: "sql_injection"
security_result.detection_fields[].value: waf.score.sql_injection
waf.score.http_violation と同様のロジック。
waf.score.xss security_result.detection_fields[].key: "xss"
security_result.detection_fields[].value: waf.score.xss
waf.score.http_violation と同様のロジック。
waf.severity security_result.severity: derived
security_result.severity_details: waf.severity
waf.severity が空でない場合、範囲(3 以下: 高、3~6: 中、6~8: 低、それ以外: UNKNOWN_SEVERITY)に基づいて security_result.severity の値が決定されます。元の waf.severity 値も security_result.severity_details にマッピングされます。
waf_message metadata.description: waf_message waf.message が空で、waf_message が空でない場合、metadata.description にマッピングされます。client_ip または hostfastly.server が空でない場合、metadata.event_type は「NETWORK_HTTP」に設定されます。それ以外の場合、client_ip または host が空でない場合は、metadata.event_type が「STATUS_UPDATE」に設定されます。それ以外の場合は、「GENERIC_EVENT」に設定されます。ハードコードされた値。ハードコードされた値。ハードコードされた値。

さらにサポートが必要な場合 コミュニティ メンバーや Google SecOps のプロフェッショナルから回答を得ることができます。