implementing-azure-defender-for-cloud について
Microsoft Defender for CloudでAzure環境を保護するチーム向けの導入ガイドです。ワークロード保護、コンプライアンス評価、推奨事項、アラート、JIT VMアクセス、対応の自動化を扱います。
主な機能
- 01ワークロード保護プランの有効化
- 02セキュリティ監視エージェントの自動導入
- 03推奨事項とSecure Scoreの確認
- 04規制コンプライアンス基準の設定
- 05アラートと対応自動化の構成
- 06JIT VMアクセスの構成
活用シーン
- 01複数サブスクリプションへのセキュリティプラン導入
- 02VM、コンテナ、SQLワークロードの保護
- 03CISなどの基準への準拠状況の追跡
- 04アラートを起点とするインシデント対応
インストール
コマンドをコピーしてターミナルで実行します。
npx skills add https:/ / github.com/ mukul975/ anthropic-cybersecurity-skills --skill implementing-azure-defender-for-cloudインストール後、Claude Code で/implementing-azure-defender-for-cloudを入力して読み込まれたか確認します。
同梱ファイル
SKILL.md と一緒にインストールされる参考資料やスクリプト。
LICENSEreferences/api-reference.mdscripts/agent.py詳細
Azure Defender for Cloud の実装
使用するタイミング
- Azure サブスクリプション全体で包括的なセキュリティ監視を有効にする場合
- VM、コンテナー、SQL、ストレージ、Key Vault のクラウドワークロード保護を実装する場合
- コンプライアンス要件により、規制フレームワークに対する継続的な評価が求められる場合
- 検出された脅威に応答するアダプティブなセキュリティ制御を構築する場合
- Azure ネイティブおよびハイブリッドのワークロードからのセキュリティ検出結果を一元化する場合
使用しないでください: Azure 以外のワークロードのみを対象とする保護の場合(AWS Security Hub または GCP SCC を使用)、アプリケーションレベルのセキュリティテストの場合(Azure DevOps DAST/SAST を使用)、ID 固有の保護の場合(Microsoft Defender for Identity を使用)。
前提条件
- 共同作成者またはセキュリティ管理者ロールを持つ Azure サブスクリプション
- コンプライアンス評価のために有効化された Azure Policy
- 診断データ収集用の Log Analytics ワークスペース
- ハイブリッドサーバー保護のための Azure Arc 接続マシン
- Defender プランの価格レベルが Standard に設定されていること(無料レベルでは CSPM のみ提供されます)
ワークフロー
ステップ 1: Defender for Cloud プランを有効にする
保護が必要な各ワークロードの種類に適切な Defender プランを有効にします。
# Enable Defender for Cloud CSPM (foundational posture management)
az security pricing create --name CloudPosture --tier standard
# Enable Defender for Servers
az security pricing create --name VirtualMachines --tier standard \
--subplan P2
# Enable Defender for Containers
az security pricing create --name Containers --tier standard
# Enable Defender for Storage
az security pricing create --name StorageAccounts --tier standard \
--subplan PerStorageAccount
# Enable Defender for SQL
az security pricing create --name SqlServers --tier standard
# Enable Defender for Key Vault
az security pricing create --name KeyVaults --tier standard
# Enable Defender for App Service
az security pricing create --name AppServices --tier standard
# Verify all enabled plans
az security pricing list \
--query "[].{Plan:name, Tier:pricingTier, SubPlan:subPlan}" -o table
ステップ 2: セキュリティエージェントの自動プロビジョニングを構成する
VM とコンテナーへの監視エージェントの自動デプロイを有効にします。
# Enable auto-provisioning of Log Analytics agent
az security auto-provisioning-setting update \
--name default --auto-provision on
# Configure Log Analytics workspace for data collection
az security workspace-setting create \
--name default \
--target-workspace "/subscriptions/SUB_ID/resourceGroups/RG/providers/Microsoft.OperationalInsights/workspaces/SecurityWorkspace"
# Enable Defender for Containers auto-provisioning components
az security setting update \
--name Sentinel \
--setting-kind DataExportSettings
# Verify auto-provisioning status
az security auto-provisioning-setting list -o table
ステップ 3: セキュリティに関する推奨事項を確認し、優先順位を付ける
セキュリティに関する推奨事項を取得し、セキュアスコアへの影響に基づいて修復の優先順位を決めます。
# Get the current secure score
az security secure-score list \
--query "[].{Name:displayName, Current:current, Max:max, Percentage:percentage}" -o table
# List all active security recommendations
az security assessment list \
--query "[?status.code=='Unhealthy'].{Name:displayName, Severity:metadata.severity, Category:metadata.category, ResourceCount:status.cause}" \
-o table
# Get recommendations sorted by severity
az security assessment list \
--query "[?status.code=='Unhealthy'] | sort_by(@, &metadata.severity)" \
-o table
# Get detailed recommendation with remediation steps
az security assessment show \
--name ASSESSMENT_ID \
--query "{Name:displayName, Description:metadata.description, Severity:metadata.severity, Remediation:metadata.remediationDescription}"
# List recommendations by control
az security secure-score-controls list \
--query "[].{Control:displayName, CurrentScore:current, MaxScore:max, NotHealthy:notHealthyResourceCount}" \
-o table
ステップ 4: 規制コンプライアンスダッシュボードを構成する
コンプライアンス標準を有効にし、サブスクリプション全体での準拠状況を監視します。
# List available regulatory compliance standards
az security regulatory-compliance-standards list \
--query "[].{Standard:name, State:state}" -o table
# Enable specific compliance standards
az security regulatory-compliance-standards update \
--name "CIS-Azure-2.0" --state "Enabled"
az security regulatory-compliance-standards update \
--name "PCI-DSS-4.0" --state "Enabled"
az security regulatory-compliance-standards update \
--name "NIST-SP-800-53-R5" --state "Enabled"
# Get compliance status for a specific standard
az security regulatory-compliance-controls list \
--standard-name "CIS-Azure-2.0" \
--query "[].{Control:id, Description:displayName, State:state, PassedResources:passedResources, FailedResources:failedResources}" \
-o table
# Get failing assessments for a control
az security regulatory-compliance-assessments list \
--standard-name "CIS-Azure-2.0" \
--control-name "2.1" \
--query "[?state=='Failed'].{Assessment:id, State:state}" -o table
ステップ 5: セキュリティアラートと自動化を設定する
アラート通知と自動対応ワークフローを構成します。
# Create security contact for alert notifications
az security contact create \
--name "SecurityTeam" \
--email "[email protected]" \
--phone "+1-555-0199" \
--alert-notifications on \
--alerts-to-admins on
# List active security alerts
az security alert list \
--query "[?status=='Active'].{Name:alertDisplayName, Severity:severity, Time:timeGeneratedUtc, Status:status}" \
-o table
# Create workflow automation for high-severity alerts (Logic App trigger)
az security automation create \
--name "high-severity-alert-response" \
--resource-group "security-rg" \
--scopes "[{\"description\":\"Full subscription\",\"scopePath\":\"/subscriptions/SUB_ID\"}]" \
--sources "[{
\"eventSource\":\"Alerts\",
\"ruleSets\":[{
\"rules\":[{
\"propertyJPath\":\"Severity\",
\"propertyType\":\"String\",
\"expectedValue\":\"High\",
\"operator\":\"Equals\"
}]
}]
}]" \
--actions "[{
\"logicAppResourceId\":\"/subscriptions/SUB_ID/resourceGroups/security-rg/providers/Microsoft.Logic/workflows/alert-response\",
\"actionType\":\"LogicApp\"
}]"
ステップ 6: アダプティブアプリケーションコントロールと JIT VM アクセスを実装する
ランタイムセキュリティのための高度なワークロード保護機能を構成します。
# Enable Just-In-Time VM access
az security jit-policy create \
--resource-group "production-rg" \
--name "jit-policy" \
--virtual-machines "[{
\"id\":\"/subscriptions/SUB_ID/resourceGroups/production-rg/providers/Microsoft.Compute/virtualMachines/web-server-01\",
\"ports\":[
{\"number\":22,\"protocol\":\"TCP\",\"allowedSourceAddressPrefix\":\"*\",\"maxRequestAccessDuration\":\"PT3H\"},
{\"number\":3389,\"protocol\":\"TCP\",\"allowedSourceAddressPrefix\":\"*\",\"maxRequestAccessDuration\":\"PT3H\"}
]
}]"
# Request JIT access when needed
az security jit-policy initiate \
--resource-group "production-rg" \
--name "jit-policy" \
--virtual-machines "[{
\"id\":\"VM_ID\",
\"ports\":[{\"number\":22,\"endTimeUtc\":\"2026-02-23T15:00:00Z\",\"allowedSourceAddressPrefix\":\"10.0.1.50\"}]
}]"
# Review adaptive application control recommendations
az security adaptive-application-controls list \
--query "[].{Group:displayName, Recommendation:recommendationAction, VMCount:vmRecommendations|length(@)}" \
-o table
主要な概念
| 用語 | 定義 |
|---|---|
| Microsoft Defender for Cloud | Azure、ハイブリッド、マルチクラウド環境全体に CSPM とクラウドワークロード保護 (CWP) を提供する Azure ネイティブのセキュリティプラットフォーム |
| Secure Score | 実装済みのセキュリティに関する推奨事項の割合に基づいて、組織のセキュリティ態勢を示す数値指標 |
| セキュリティに関する推奨事項 | セキュリティ態勢を改善するための実行可能なガイダンスで、重大度とセキュアスコアへの影響によって優先順位が付けられる |
| Defender プラン | 特定のリソースの種類に対して高度な脅威検出を有効にする、ワークロード固有の保護レベル(Servers、Containers、SQL、Storage など) |
| Just-In-Time VM アクセス | 管理ポート(SSH/RDP)を既定でブロックし、要求に応じて期間限定のアクセスを許可することで、攻撃対象領域を減らす機能 |
| アダプティブアプリケーションコントロール | VM 上で実行を許可すべきアプリケーションを推奨する、機械学習ベースの許可リスト機能 |
ツールとシステム
- Microsoft Defender for Cloud: CSPM、CWP、規制コンプライアンス機能を備えた中核のセキュリティプラットフォーム
- Azure Policy: Defender for Cloud がセキュリティ構成を評価し、適用するために使用するガバナンスサービス
- Log Analytics ワークスペース: Defender エージェントが収集したセキュリティテレメトリのバックエンドデータストア
- Azure Logic Apps: Defender のアラートをトリガーとしてインシデント対応を行うワークフロー自動化
- Azure Arc: Defender for Cloud の保護を、ハイブリッドおよびマルチクラウドのサーバーと Kubernetes クラスターに拡張する
一般的なシナリオ
シナリオ: 複数サブスクリプションを持つエンタープライズでの Defender for Cloud の展開
背景: Azure サブスクリプションを 20 個持つエンタープライズが、CIS Azure 2.0 に対するコンプライアンスのベースラインを確立しつつ、サーバー、コンテナー、SQL の保護を備えた Defender for Cloud を有効にする必要があります。
手順:
- Azure Policy のイニシアチブを使用して、すべてのサブスクリプションで CSPM プラン (CloudPosture) を有効にする
- 本番サブスクリプションで Defender for Servers P2、Containers、SQL を有効にする
- すべての VM に Log Analytics エージェントをデプロイするよう自動プロビジョニングを構成する
- CIS Azure 2.0 と PCI DSS 4.0 のコンプライアンス標準を有効にする
- セキュリティ連絡先を作成し、SOC チームへのアラート通知を構成する
- Logic Apps を使用して、重大度が High のアラートに対するワークフローの自動化を設定する
- 永続的な SSH/RDP の公開を排除するため、すべての本番サーバーで JIT VM アクセスを有効にする
- エグゼクティブのステークホルダー向けに、週次の Secure Score レポートを作成する
注意点: Defender for Servers P2 はサーバーごとの時間単位で課金されます。VM 数が多い環境では、コストが急速に膨らむ可能性があります。開発サブスクリプションには Defender for Servers P1 を使用し、P2 は本番のみに使用してください。エージェントの自動プロビジョニングは、SCCM などのツールで管理されている既存のエージェントデプロイと競合する可能性があります。
出力形式
Microsoft Defender for Cloud Deployment Report
=================================================
Organization: Acme Corp
Subscriptions: 20 (12 production, 8 non-production)
Deployment Date: 2026-02-23
DEFENDER PLANS ENABLED:
CloudPosture (CSPM): 20 / 20 subscriptions
Servers P2: 12 / 20 (production only)
Containers: 12 / 20 (production only)
SQL: 12 / 20 (production only)
Storage: 20 / 20 all subscriptions
Key Vault: 20 / 20 all subscriptions
SECURE SCORE:
Current: 62% (baseline)
Target: 80% within 90 days
COMPLIANCE STATUS (CIS Azure 2.0):
Compliant controls: 78 / 142 (55%)
Non-compliant controls: 52 / 142
Not applicable: 12 / 142
RECOMMENDATIONS:
Critical: 8 recommendations affecting 34 resources
High: 24 recommendations affecting 89 resources
Medium: 56 recommendations affecting 234 resources
Low: 34 recommendations affecting 112 resources
SECURITY ALERTS (Last 7 Days):
High severity: 3
Medium severity: 12
Low severity: 28