Communitygithub.com

SentinelによるクラウドSIEM構築

マルチクラウドデータコネクタ(AWS、Azure、GCP)の構成、KQLによる検出・捜査クエリの作成、Logic Appsによる自動応答プレイブックの構築を通じて、クラウドネイティブSIEM/SOARとしてMicrosoft Sentinelを展開します。マルチクラウド環境向けの統合SOC構築、レガシーSIEMからの移行、ペタバイト規模の脅威捜査に活用します。

SentinelによるクラウドSIEM構築 とは?

このスキルは、Microsoft SentinelをクラウドネイティブSIEM/SOARとして展開するための包括的なワークフローを提供します。Azure Log Analyticsワークスペースのプロビジョニングから始まり、AWS CloudTrailやAzure ADなどのマルチクラウドデータコネクタを有効化します。次に、Kusto Query Language (KQL) を使用した分析ルールの作成方法を示し、不可能な移動検出、AWS IAM認証情報の悪用、大量のS3オブジェクト削除などのクラウド固有の脅威を特定します。さらに、Azure Logic Appsを使用したSOARプレイブックの構築を支援し、インシデント発生時の自動無効化などの応答アクションを実装します。また、ペタバイト規模のログ保持のためのSentinel Data Lakeの設定、脅威インテリジェンスフィードの統合、MITRE ATT&CKフレームワークへのマッピングもカバーします。このスキルは、Azure CLI、KQL、Logic Apps JSON定義などの実用的なコード例を提供し、Claude CodeやCursorなどのAIエージェントプラットフォームで使用することを想定しています。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/mukul975/Anthropic-Cybersecurity-Skills/tree/main/skills/building-cloud-siem-with-sentinel

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

SentinelによるクラウドSIEM構築 は何をしますか?

使用するタイミング

  • マルチクラウド環境向けの統合セキュリティオペレーションセンター(SOC)を確立する場合
  • レガシーSIEMプラットフォーム(Splunk、QRadar)からクラウドネイティブアーキテクチャに移行する場合
  • クラウド固有の脅威に対する自動インシデント対応ワークフローを構築する場合
  • ペタバイト規模のセキュリティテレメトリにわたる大規模な脅威捜査を実行する場合
  • 脅威インテリジェンスフィードをクラウドセキュリティログ分析と統合する場合

使用しないでください:AWSのみの環境でSecurity HubとGuardDutyで十分な場合、EDR機能が必要なエンドポイント検出(Defender for Endpointを使用)、またはコンプライアンス状況監視(building-cloud-security-posture-managementを参照)には使用しないでください。

前提条件

  • Microsoft Sentinelが有効化されたLog Analyticsワークスペースを持つAzureサブスクリプション
  • ターゲットログソース(AWS CloudTrail、Azure Activity、GCP)のデータコネクタ権限
  • 自動応答プレイブック用のLogic AppsまたはAzure Functions
  • 検出ルールと捜査クエリを作成するためのKQL(Kustoクエリ言語)スキル

ワークフロー

ステップ 1: Sentinelワークスペースとデータコネクタのプロビジョニング

セキュリティデータに最適化されたLog Analyticsワークスペースを作成し、マルチクラウド取り込み用のデータコネクタを有効にします。

# Log Analyticsワークスペースの作成
az monitor log-analytics workspace create \
  --resource-group security-rg \
  --workspace-name sentinel-workspace \
  --location eastus \
  --retention-time 365 \
  --sku PerGB2018

# ワークスペースでMicrosoft Sentinelを有効化
az sentinel onboarding-state create \
  --resource-group security-rg \
  --workspace-name sentinel-workspace

# AWS CloudTrailコネクタの有効化
az sentinel data-connector create \
  --resource-group security-rg \
  --workspace-name sentinel-workspace \
  --data-connector-id aws-cloudtrail \
  --kind AmazonWebServicesCloudTrail \
  --aws-cloud-trail-data-connector '{
    "awsRoleArn": "arn:aws:iam::123456789012:role/SentinelCloudTrailRole",
    "dataTypes": {"logs": {"state": "Enabled"}}
  }'

# Azure ADサインインログと監査ログの有効化
az sentinel data-connector create \
  --resource-group security-rg \
  --workspace-name sentinel-workspace \
  --data-connector-id azure-ad \
  --kind AzureActiveDirectory \
  --azure-active-directory '{
    "dataTypes": {
      "alerts": {"state": "Enabled"},
      "signinLogs": {"state": "Enabled"},
      "auditLogs": {"state": "Enabled"}
    }
  }'

ステップ 2: KQL検出ルールの作成

Kustoクエリ言語を使用してクラウド固有の脅威を検出する分析ルールを作成します。各ルールをMITRE ATT&CKテクニックにマッピングします。

// 不可能な移動の検出 - 地理的に離れた場所からのサインイン
let timeframe = 1h;
let distance_threshold = 500; // km
SigninLogs
| where TimeGenerated > ago(timeframe)
| where ResultType == 0 // 成功したサインインのみ
| project TimeGenerated, UserPrincipalName, IPAddress, Location,
          Latitude = toreal(LocationDetails.geoCoordinates.latitude),
          Longitude = toreal(LocationDetails.geoCoordinates.longitude)
| sort by UserPrincipalName asc, TimeGenerated asc
| extend PrevLatitude = prev(Latitude, 1), PrevLongitude = prev(Longitude, 1),
         PrevTime = prev(TimeGenerated, 1), PrevUser = prev(UserPrincipalName, 1)
| where UserPrincipalName == PrevUser
| extend TimeDiff = datetime_diff('minute', TimeGenerated, PrevTime)
| where TimeDiff < 60
| extend Distance = geo_distance_2points(Longitude, Latitude, PrevLongitude, PrevLatitude) / 1000
| where Distance > distance_threshold
| project TimeGenerated, UserPrincipalName, IPAddress, Location, Distance, TimeDiff
// CloudTrailからのAWS IAM認証情報の悪用を検出
AWSCloudTrail
| where TimeGenerated > ago(24h)
| where EventName in ("ConsoleLogin", "AssumeRole", "GetSessionToken")
| where ErrorCode == ""
| summarize LoginCount = count(), DistinctIPs = dcount(SourceIpAddress),
            IPList = make_set(SourceIpAddress, 10)
            by UserIdentityArn, bin(TimeGenerated, 1h)
| where DistinctIPs > 3
| project TimeGenerated, UserIdentityArn, LoginCount, DistinctIPs, IPList
// 大量のS3オブジェクト削除を検出(ランサムウェアの可能性)
AWSCloudTrail
| where TimeGenerated > ago(1h)
| where EventName == "DeleteObject" or EventName == "DeleteObjects"
| summarize DeleteCount = count(), BucketsAffected = dcount(RequestParameters_bucketName)
            by UserIdentityArn, bin(TimeGenerated, 10m)
| where DeleteCount > 100
| project TimeGenerated, UserIdentityArn, DeleteCount, BucketsAffected

ステップ 3: Logic AppsによるSOARプレイブックの構築

分析ルールがインシデントをトリガーしたときに実行される自動応答プレイブックを作成します。一般的なアクションには、ユーザーのブロック、リソースの分離、脅威インテリジェンスによるアラートの強化が含まれます。

{
  "definition": {
    "triggers": {
      "Microsoft_Sentinel_incident": {
        "type": "ApiConnectionWebhook",
        "inputs": {
          "body": {"incidentArmId": "subscriptions/@{triggerBody()?['workspaceInfo']?['SubscriptionId']}/resourceGroups/@{triggerBody()?['workspaceInfo']?['ResourceGroupName']}/providers/Microsoft.OperationalInsights/workspaces/@{triggerBody()?['workspaceInfo']?['WorkspaceName']}/providers/Microsoft.SecurityInsights/Incidents/@{triggerBody()?['object']?['properties']?['incidentNumber']}"},
          "host": {"connection": {"name": "@parameters('$connections')['microsoftsentinel']['connectionId']"}}
        }
      }
    },
    "actions": {
      "Get_incident_entities": {
        "type": "ApiConnection",
        "inputs": {"method": "post", "path": "/Incidents/entities"}
      },
      "For_each_account_entity": {
        "type": "Foreach",
        "foreach": "@body('Get_incident_entities')?['Accounts']",
        "actions": {
          "Disable_Azure_AD_user": {
            "type": "ApiConnection",
            "inputs": {
              "method": "PATCH",
              "path": "/v1.0/users/@{items('For_each_account_entity')?['AadUserId']}",
              "body": {"accountEnabled": false}
            }
          },
          "Add_comment_to_incident": {
            "type": "ApiConnection",
            "inputs": {
              "body": {"message": "ユーザー @{items('For_each_account_entity')?['Name']} が自動プレイブックにより無効化されました"}
            }
          }
        }
      }
    }
  }
}

ステップ 4: 長期間の捜査のためのSentinel Data Lakeの設定

ペタバイト規模のログ保持と、KQLおよびSQLエンドポイントの両方を使用した高度な脅威捜査のためにSentinel Data Lakeを有効にします。

// 脅威捜査クエリ: AWSアカウント間の水平移動を検出
let suspicious_roles = AWSCloudTrail
| where TimeGenerated > ago(7d)
| where EventName == "AssumeRole"
| extend AssumedRoleArn = tostring(parse_json(RequestParameters).roleArn)
| where AssumedRoleArn contains "cross-account" or AssumedRoleArn contains "admin"
| summarize AssumeCount = count(), UniqueSourceAccounts = dcount(RecipientAccountId)
            by UserIdentityArn, AssumedRoleArn
| where AssumeCount > 10 and UniqueSourceAccounts > 2;
suspicious_roles
| join kind=inner (
    AWSCloudTrail
    | where TimeGenerated > ago(7d)
    | where EventName in ("RunInstances", "CreateFunction", "PutBucketPolicy")
) on UserIdentityArn
| project TimeGenerated, UserIdentityArn, AssumedRoleArn, EventName, SourceIpAddress

ステップ 5: 脅威インテリジェンスの統合

脅威インテリジェンスプロバイダーを接続し、既知の悪意のあるインフラストラクチャとの通信を検出するための指標ベースのマッチングルールを作成します。

# Microsoft脅威インテリジェンスコネクタの有効化
az sentinel data-connector create \
  --resource-group security-rg \
  --workspace-name sentinel-workspace \
  --data-connector-id microsoft-ti \
  --kind MicrosoftThreatIntelligence \
  --microsoft-threat-intelligence '{
    "dataTypes": {"microsoftEmergingThreatFeed": {"lookbackPeriod": "2025-01-01T00:00:00Z", "state": "Enabled"}}
  }'
// ネットワークインジケータをクラウドフローログと照合
let TI_IPs = ThreatIntelligenceIndicator
| where TimeGenerated > ago(30d)
| where isnotempty(NetworkIP)
| distinct NetworkIP;
AzureNetworkAnalytics_CL
| where TimeGenerated > ago(24h)
| where DestIP_s in (TI_IPs)
| project TimeGenerated, SrcIP_s, DestIP_s, DestPort_d, FlowType_s

主要な概念

用語定義
KQLKustoクエリ言語。Microsoft Sentinelの主要なクエリ言語であり、セキュリティデータの検索、分析、可視化に使用されます
分析ルールSentinelの検出ロジック。スケジュールに従ってログデータを評価し、条件が一致した場合にインシデントを作成します
SOARプレイブックインシデントによってトリガーされる自動化ワークフロー。アカウントのブロック、アラートの強化、チームへの通知などの応答アクションを実行します
データコネクタクラウドサービス、IDプロバイダー、サードパーティツールからSentinelにセキュリティログを取り込む統合モジュール
Sentinel Data Lakeペタバイト規模のストレージ層。KQLおよびSQLクエリインターフェースを備え、長期間のログ保持と高度な捜査を提供します
ワークブックSentinelのインタラクティブなダッシュボード。セキュリティデータ、トレンド、運用指標の可視化を表示します
ウォッチリストSentinelの参照データテーブル。VIPユーザーリストや承認済みIP範囲などのコンテキストでアラートを強化するために使用されます
Fusion検出機械学習を活用した相関エンジン。データソース全体でマルチステージ攻撃を自動的に検出します

ツールとシステム

  • Microsoft Sentinel: Azure Log Analytics上に構築されたクラウドネイティブSIEM/SOARプラットフォーム。AIを活用した脅威検出機能を備えています
  • Azure Logic Apps: SentinelインシデントによってトリガーされるSOARプレイブックを構築するためのローコード自動化プラットフォーム
  • Microsoft脅威インテリジェンス: セキュリティログと照合するためのIP、ドメイン、URLインジケータを提供する統合脅威フィード
  • Azure Data Explorer: 大規模なデータ探索のためのSentinel KQLクエリの基盤となる高性能分析エンジン
  • MITRE ATT&CK Navigator: Sentinel検出ルールを攻撃者の戦術とテクニックにマッピングするためのフレームワーク

一般的なシナリオ

シナリオ: クラウド間の認証情報窃取キャンペーンの検出

コンテキスト: 攻撃者がフィッシングを通じてAzure ADアカウントを侵害し、そのアカウントを使用してフェデレーションID経由でAWSリソースにアクセスします。Sentinelは、Azureサインインの異常と異常なAWS APIアクティビティを関連付ける必要があります。

アプローチ:

  1. Azure ADの不可能な移動または異常なサインインリスクを検出する分析ルールを作成する
  2. 侵害されたAzure AD IDとAWS CloudTrail AssumeRoleWithSAMLイベントを関連付けるKQLクエリを作成する
  3. Azure ADリスクイベントとその後のAWS特権昇格アクティビティをリンクするFusion検出ルールを構築する
  4. Azure ADアカウントを自動的に無効化し、AWS STSセッションを取り消すSOARプレイブックを展開する
  5. 初期侵害からAWSへの水平移動までのタイムラインを示すワークブックを作成する
  6. データレイク全体で捜査クエリを実行し、他のアカウントに影響を与える同様のパターンを確認する

落とし穴: クラウドプロバイダー間でIDを関連付けないと、攻撃チェーン全体を見逃します。分析ルールの頻度を低く設定しすぎると(例:24時間)、攻撃者は数時間、検出されずにアクセスできるようになります。

出力形式

Microsoft Sentinel SOC 運用レポート
==========================================
ワークスペース: sentinel-workspace
データソース: 14 コネクタアクティブ
レポート期間: 2025-02-01 ~ 2025-02-23

データ取り込み:
  Azure ADサインインログ:     2.3 TB (23日間)
  AWS CloudTrail:            1.8 TB (23日間)
  Azure Activity:            0.9 TB (23日間)
  Defender for Cloudアラート: 45 GB (23日間)
  合計取り込み:               5.1 TB

検出サマリー:
  アクティブな分析ルール: 87
  作成されたインシデント: 234
    重大: 8 | 高: 34 | 中: 89 | 低: 103
  平均検出時間 (MTTD): 4.2分
  平均対応時間 (MTTR): 18分

主なインシデントタイプ:
  不可能な移動が検出されました:          42 インシデント
  AWS 未承認API呼び出しパターン:         28 インシデント
  S3における大量ファイル削除:            3 インシデント
  不審なAzure ADアプリ登録:             12 インシデント

自動化:
  実行されたプレイブック: 156
  自動無効化されたアカウント: 23
  自動強化されたインシデント: 198
  誤検出率: 12%

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

abusing-dpapi-for-credential-access

Extract and decrypt Windows DPAPI-protected secrets (Credential Manager, browser logins/cookies, Wi-Fi credentials, KeePass keys) online or offline using SharpDPAPI, SharpChrome, Mimikatz, or Impacket

abusing-shadow-credentials-for-privesc

Take over Active Directory accounts by writing attacker-controlled public keys to msDS-KeyCredentialLink (Shadow Credentials) with pyWhisker, Whisker, or Certipy, then authenticate via PKINIT to recover the target

achieving-cmmc-level-2-compliance

>-

acquiring-disk-image-with-dd-and-dcfldd

Create forensically sound bit-for-bit disk images with dd or dcfldd on a Linux forensic workstation, preserving evidence integrity through hash verification (MD5/SHA) during acquisition. Use when imaging a suspect drive, USB device, or memory card for investigation, preserving volatile disk evidence during incident response, or producing a verified copy for legal or law-enforcement proceedings before any destructive analysis.

analyzing-active-directory-acl-abuse

Detect dangerous ACL misconfigurations in Active Directory using ldap3

analyzing-android-malware-with-apktool

Perform static analysis of Android APK malware using apktool for resource decompilation, jadx for Java source recovery, and androguard for manifest inspection, dangerous permission-combination detection, and identification of obfuscated code, dynamic code loading, and reflection-based API calls. Use to statically triage a suspicious APK without executing it or to build mobile malware detection rules.

analyzing-api-gateway-access-logs

Parses API Gateway access logs (AWS API Gateway, Kong, Nginx) to detect

analyzing-apt-group-with-mitre-navigator

Query ATT&CK data with attackcti, mitreattack-python, and stix2, then build MITRE ATT&CK Navigator layers and multi-layer heatmap overlays mapping one or more APT groups

analyzing-azure-activity-logs-for-threats

Queries Azure Monitor activity logs and sign-in logs via azure-monitor-query

analyzing-bootkit-and-rootkit-samples

Analyzes bootkit and advanced rootkit malware infecting the Master

analyzing-browser-forensics-with-hindsight

Parse Chromium-based browser databases with Hindsight to extract and correlate browsing history, downloads, cookies, cached content, autofill data, saved passwords, and extensions from Chrome, Edge, Brave, Opera, and Vivaldi into a unified timeline (XLSX, JSON, or SQLite output). Use during incident response, insider-threat investigations, or criminal cases when you need to reconstruct a user

analyzing-campaign-attribution-evidence

Systematically evaluate cyber-campaign evidence to attribute an operation to a threat actor, using the Diamond Model and Analysis of Competing Hypotheses (ACH) to weigh infrastructure overlaps, TTP consistency, malware code similarity, and timing/language artifacts into confidence-weighted attribution assessments. Use when an incident investigation needs a defensible attribution confidence level.

analyzing-certificate-transparency-for-phishing

Monitor Certificate Transparency logs using crt.sh and Certstream to

analyzing-cloud-storage-access-patterns

Detect abnormal access in AWS S3, GCS, and Azure Blob Storage by analyzing CloudTrail Data Events, GCS audit logs, and Azure Storage Analytics for after-hours bulk downloads, new-IP access, and API-call spikes (e.g. GetObject) via statistical baselines and time-series anomaly detection. Use when investigating suspected cloud data exfiltration or building related detection rules.

analyzing-cobalt-strike-beacon-configuration

Extract and analyze Cobalt Strike beacon configuration from PE files

analyzing-cobaltstrike-malleable-c2-profiles

Parse and analyze Cobalt Strike Malleable C2 profiles with dissect.cobaltstrike (profiles and beacon-payload configs) and pyMalleableC2 (AST parsing) to extract HTTP/DNS transforms, URIs, headers, sleep/jitter, and injection behavior, then generate network detection signatures. Use when reverse-engineering a captured malleable profile or building detections against Cobalt Strike Beacon traffic.

analyzing-command-and-control-communication

Analyzes malware C2 communication over HTTP, HTTPS, DNS, and custom

analyzing-cyber-kill-chain

Analyzes intrusion activity against the Lockheed Martin Cyber Kill Chain

analyzing-disk-image-with-autopsy

Perform comprehensive forensic analysis of raw (dd), E01, or AFF disk images with Autopsy and The Sleuth Kit, recovering deleted files, examining metadata and embedded artifacts, keyword searching, and building investigation timelines with visual reports. Use for structured analysis of a forensic disk image or when stakeholders need visual reports from evidence.

analyzing-dns-logs-for-exfiltration

Analyzes DNS query logs to detect data exfiltration via DNS tunneling,

関連スキル