Azure WAF のログを収集する
このドキュメントでは、Azure Storage アカウントを使用して Azure ウェブ アプリケーション ファイアウォール(WAF)のログを Google Security Operations にエクスポートする方法について説明します。パーサーは JSON 形式のログを処理し、UDM に変換します。各レコードを反復処理し、特定のフィールドを UDM プロパティにマッピングすることで、records 配列を含むログを処理します。records 配列がない場合、パーサーはログを 1 つのイベントとして処理し、それに応じてフィールドを抽出してマッピングします。
始める前に
- Google SecOps インスタンスがあることを確認します。
- 有効な Azure テナントがあることを確認します。
- Azure への特権アクセス権があることを確認します。
Azure Storage アカウントを構成する
- Azure コンソールで、[ストレージ アカウント] を検索します。
- [作成] をクリックします。
- 次の入力パラメータの値を指定します。
- Subscription: サブスクリプションを選択します。
- Resource Group: リソース グループを選択します。
- リージョン: リージョンを選択します。
- パフォーマンス: パフォーマンスを選択します(標準を推奨)。
- 冗長性: 冗長性を選択します(GRS または LRS を推奨)。
- ストレージ アカウント名: 新しいストレージ アカウントの名前を入力します。
- [Review + create] をクリックします。
- アカウントの概要を確認し、[作成] をクリックします。
- [ストレージ アカウントの概要] ページで、[セキュリティとネットワーキング] の [アクセスキー] サブメニューを選択します。
- [key1] または [key2] の横にある [Show] をクリックします。
- [クリップボードにコピー] をクリックして、鍵をコピーします。
- キーを安全な場所に保存して、後で使用できるようにします。
- [ストレージ アカウントの概要] ページで、[設定] の [エンドポイント] サブメニューを選択します。
- [クリップボードにコピー] をクリックして、Blob サービスのエンドポイント URL(
https://<storageaccountname>.blob.core.windows.net
など)をコピーします。 - エンドポイント URL を安全な場所に保存して、後で使用できるようにします。
Azure WAF ログのログ エクスポートを構成する
- 特権アカウントを使用して Azure Portal にログインします。
- [ウェブ アプリケーション ファイアウォール(WAF)ルール] に移動し、モニタリングする WAF を選択します。
- [Monitoring] > [Diagnostic Settings] を選択します。
- [+ 診断設定を追加] をクリックします。
- 診断設定にわかりやすい名前を入力します。
- [allLogs] を選択します。
- 移行先として [ストレージ アカウントにアーカイブ] チェックボックスをオンにします。
- サブスクリプションとストレージ アカウントを指定します。
- [保存] をクリックします。
Azure WAF のログを取り込むように Google SecOps でフィードを構成する
- [SIEM 設定] > [フィード] に移動します。
- [新しく追加] をクリックします。
- [フィード名] フィールドに、フィードの名前を入力します(例: Azure WAF ログ)。
- [ソースタイプ] として [Microsoft Azure Blob Storage] を選択します。
- [ログタイプ] として [Azure WAF] を選択します。
- [次へ] をクリックします。
次の入力パラメータの値を指定します。
- Azure URI: Blob エンドポイントの URL。
ENDPOINT_URL/BLOB_NAME
- 次のように置き換えます。
ENDPOINT_URL
: blob エンドポイント URL(https://<storageaccountname>.blob.core.windows.net
)BLOB_NAME
: blob の名前(<logname>-logs
など)
- 次のように置き換えます。
- URI is a: ログストリームの構成([単一ファイル] | [ディレクトリ] | [サブディレクトリを含むディレクトリ])に応じて URI TYPE を選択します。
Source deletion options: 必要に応じて削除オプションを選択します。
共有キー: Azure Blob Storage へのアクセスキー。
Asset namespace: アセットの名前空間。
Ingestion labels: このフィードのイベントに適用されるラベル。
- Azure URI: Blob エンドポイントの URL。
[次へ] をクリックします。
[Finalize] 画面で新しいフィードの設定を確認し、[送信] をクリックします。
UDM マッピング テーブル
ログフィールド | UDM マッピング | ロジック |
---|---|---|
backendPoolName |
additional.fields[?key=='backendPoolName'].value.string_value |
この値は、未加工ログの backendPoolName フィールドから取得されます。 |
backendSettingName |
additional.fields[?key=='backendSettingName'].value.string_value |
この値は、未加工ログの backendSettingName フィールドから取得されます。 |
category |
metadata.product_event_type |
この値は、未加工ログの category フィールドから取得されます。 |
EventEnqueuedUtcTime |
additional.fields[?key=='EventEnqueuedUtcTime'].value.string_value |
records フィールドが存在する場合、値は未加工ログの EventEnqueuedUtcTime フィールドから取得されます。 |
EventProcessedUtcTime |
additional.fields[?key=='EventProcessedUtcTime'].value.string_value |
records フィールドが存在する場合、値は未加工ログの EventProcessedUtcTime フィールドから取得されます。 |
operationName |
additional.fields[?key=='operationName'].value.string_value |
この値は、未加工ログの operationName フィールドから取得されます。 |
properties.action |
additional.fields[?key=='action'].value.string_value |
records フィールドが存在する場合、値は未加工ログの properties.action フィールドから取得されます。 |
properties.action |
security_result.action_details |
records フィールドが存在しない場合、この値は未加工ログの properties.action フィールドから取得されます。 |
properties.clientIP 、properties.clientIp |
principal.asset.ip 、principal.ip |
この値は、未加工ログの properties.clientIP フィールドまたは properties.clientIp フィールドから取得されます。優先度は clientIP です。 |
properties.clientPort |
principal.port |
この値は、未加工ログの properties.clientPort フィールドから取得されます。 |
properties.clientResponseTime |
principal.resource.attribute.labels[?key=='Client Response Time'].value |
records フィールドが存在しない場合、この値は未加工ログの properties.clientResponseTime フィールドから取得されます。 |
properties.details.data |
additional.fields[?key=='Properties data'].value.string_value |
records フィールドが存在する場合、値は未加工ログの properties.details.data フィールドから取得されます。 |
properties.details.file |
principal.process.file.full_path |
records フィールドが存在しない場合、この値は未加工ログの properties.details.file フィールドから取得されます。 |
properties.details.matches[].matchVariableName 、properties.details.matches[].matchVariableValue |
additional.fields[?key.startsWith('%{idx} ')].value.string_value |
この値は、未加工ログの properties.details.matches 配列から取得されます。UDM の key は、インデックス(idx )と matchVariableName を使用して作成されます。value は matchVariableValue から取得されます。 |
properties.details.message |
metadata.description |
この値は、バックスラッシュと引用符を削除した後に、未加工ログの properties.details.message フィールドから取得されます。 |
properties.details.msg |
metadata.description |
records フィールドが存在する場合、値は未加工ログの properties.details.msg フィールドから取得されます。 |
properties.httpMethod |
network.http.method |
この値は、未加工ログの properties.httpMethod フィールドから取得されます。 |
properties.httpStatus |
network.http.response_code |
この値は、未加工ログの properties.httpStatus フィールドから取得されます。 |
properties.httpVersion |
network.application_protocol |
properties.httpVersion フィールドに HTTP が含まれている場合、値 HTTP が割り当てられます。 |
properties.host 、properties.hostname 、properties.originalHost |
principal.asset.hostname 、principal.hostname |
値は properties.originalHost 、properties.host 、properties.hostname のいずれかから取得され、優先順位は上記の順になります。 |
properties.policyId |
security_result.detection_fields[?key=='policyId'].value |
この値は、未加工ログの properties.policyId フィールドから取得されます。 |
properties.policyMode |
security_result.detection_fields[?key=='policyMode'].value |
records フィールドが存在する場合、値は未加工ログの properties.policyMode フィールドから取得されます。 |
properties.policy |
additional.fields[?key=='Properties policy'].value.string_value |
records フィールドが存在する場合、値は未加工ログの properties.policy フィールドから取得されます。 |
properties.receivedBytes |
network.received_bytes |
この値は、未加工ログの properties.receivedBytes フィールドから取得されます。 |
properties.requestUri |
target.url |
この値は、未加工ログの properties.requestUri フィールドから取得されます。 |
properties.ruleId |
security_result.rule_id |
この値は、未加工ログの properties.ruleId フィールドから取得されます。 |
properties.ruleName |
security_result.rule_name |
records フィールドが存在する場合、値は未加工ログの properties.ruleName フィールドから取得されます。 |
properties.ruleName 、ruleSetType |
security_result.rule_name |
この値は、properties.ruleName フィールドから取得されます。空の場合は、records フィールドが存在しない場合、未加工ログの ruleSetType フィールドから取得されます。 |
properties.ruleSetVersion |
security_result.detection_fields[?key=='ruleSetVersion'].value |
この値は、未加工ログの properties.ruleSetVersion フィールドから取得されます。 |
properties.sentBytes |
network.sent_bytes |
この値は、未加工ログの properties.sentBytes フィールドから取得されます。 |
properties.serverResponseLatency |
additional.fields[?key=='Server Response Latency'].value.string_value |
records フィールドが存在しない場合、この値は未加工ログの properties.serverResponseLatency フィールドから取得されます。 |
properties.serverRouted |
target.asset.ip 、target.ip 、target.port |
IP とポートは properties.serverRouted フィールドから抽出されます。 |
properties.sslCipher |
network.tls.cipher |
この値は、未加工ログの properties.sslCipher フィールドから取得されます。 |
properties.sslClientCertificateIssuerName |
network.tls.server.certificate.issuer |
この値は、未加工ログの properties.sslClientCertificateIssuerName フィールドから取得されます。 |
properties.sslProtocol |
network.tls.version |
この値は、未加工ログの properties.sslProtocol フィールドから取得されます。 |
properties.timeTaken |
additional.fields[?key=='Properties Timetaken'].value.string_value |
records フィールドが存在しない場合、この値は未加工ログの properties.timeTaken フィールドから取得されます。 |
properties.trackingReference |
additional.fields[?key=='trackingReference'].value.string_value |
records フィールドが存在する場合、値は未加工ログの properties.trackingReference フィールドから取得されます。 |
properties.transactionId |
network.session_id |
この値は、未加工ログの properties.transactionId フィールドから取得されます。 |
properties.userAgent |
network.http.user_agent |
この値は、未加工ログの properties.userAgent フィールドから取得されます。 |
properties.WAFEvaluationTime |
additional.fields[?key=='Properties WAFEvaluationTime'].value.string_value |
records フィールドが存在しない場合、この値は未加工ログの properties.WAFEvaluationTime フィールドから取得されます。 |
properties.WAFMode |
additional.fields[?key=='Properties WAFMode'].value.string_value |
records フィールドが存在しない場合、この値は未加工ログの properties.WAFMode フィールドから取得されます。 |
rec.category |
metadata.product_event_type |
records フィールドが存在する場合、値は未加工ログの rec.category フィールドから取得されます。 |
rec.operationName |
additional.fields[?key=='operationName'].value.string_value |
records フィールドが存在する場合、値は未加工ログの rec.operationName フィールドから取得されます。 |
rec.properties.clientIP 、rec.properties.clientIp |
principal.asset.ip 、principal.ip |
この値は、未加工ログの rec.properties.clientIP フィールドまたは rec.properties.clientIp フィールドから取得されます。records フィールドが存在する場合は、clientIP が優先されます。 |
rec.properties.clientPort |
principal.port |
records フィールドが存在する場合、値は未加工ログの rec.properties.clientPort フィールドから取得されます。 |
rec.properties.host |
principal.asset.hostname 、principal.hostname |
records フィールドが存在する場合、値は未加工ログの rec.properties.host フィールドから取得されます。 |
rec.properties.policy |
additional.fields[?key=='Properties policy'].value.string_value |
records フィールドが存在する場合、値は未加工ログの rec.properties.policy フィールドから取得されます。 |
rec.properties.requestUri |
target.url |
records フィールドが存在する場合、値は未加工ログの rec.properties.requestUri フィールドから取得されます。 |
rec.properties.ruleName |
security_result.rule_name |
records フィールドが存在する場合、値は未加工ログの rec.properties.ruleName フィールドから取得されます。 |
rec.properties.trackingReference |
additional.fields[?key=='trackingReference'].value.string_value |
records フィールドが存在する場合、値は未加工ログの rec.properties.trackingReference フィールドから取得されます。 |
rec.resourceId |
target.resource.id |
records フィールドが存在する場合、値は未加工ログの rec.resourceId フィールドから取得されます。 |
rec.time |
metadata.event_timestamp |
records フィールドが存在する場合、値は未加工ログの rec.time フィールドから取得されます。 |
resourceId |
target.resource.id |
records フィールドが存在しない場合、この値は未加工ログの resourceId フィールドから取得されます。 |
timeStamp |
metadata.event_timestamp |
records フィールドが存在しない場合、この値は未加工ログの timeStamp フィールドから取得されます。 |
なし | metadata.event_type |
プリンシパル(ホスト名またはクライアント IP)と宛先 IP の両方が存在する場合、値は NETWORK_CONNECTION に設定されます。プリンシパルは存在するが宛先 IP がない場合は、STATUS_UPDATE に設定されます。指定しない場合、デフォルトは GENERIC_EVENT または event_type フィールドの値になります。 |
なし | metadata.log_type |
この値は AZURE_WAF にハードコードされています。 |
なし | metadata.product_name |
この値は Azure WAF Logs にハードコードされています。 |
なし | metadata.vendor_name |
この値は Microsoft にハードコードされています。 |
なし | security_result.action |
properties.action が Matched の場合、値は ALLOW に設定され、properties.action が Block の場合、BLOCK に設定されます。 |
変更点
2024-04-07
機能強化:
rec.properties.clientIp
をprincipal.ip
にマッピングしました。- 状態データに
rec_properties_trackingReference
、rec_properties_host
、rec_properties_policyMode
、rec_properties_ruleName
、rec_properties_policy
、rec_properties_details_msg
、rec_properties_clientIP
、rec_time
を定義しました。
2023-07-14
機能強化:
- JSON ログを処理する
for
ループを追加しました。
2023-02-28
機能強化:
properties.ruleName
をsecurity_result.rule_name
にマッピングしました。properties.action
をsecurity_result.action
にマッピングしました。properties.clientPort
、properties.httpStatus
、properties.receivedBytes
、properties.sentBytes
、properties.clientResponseTime
、properties.timeTaken
の on_error チェックを追加しました。
2022-10-22
- 新しく作成されたパーサー
さらにサポートが必要な場合 コミュニティ メンバーや Google SecOps のプロフェッショナルから回答を得ることができます。