implementing-cloud-security-posture-management について
AWS、Azure、GCPのセキュリティ態勢を管理するチーム向けの実装ガイドです。構成評価、コンプライアンス監視、検出結果の集約、設定ドリフトの修復を扱います。
主な機能
- 01クラウド標準の態勢監視を有効化
- 02ProwlerとScoutSuiteで評価
- 03コンプライアンス検査を定期実行
- 04検出結果の集約と重複排除
- 05設定ドリフトの検出と修復
活用シーン
- 01複数クラウドの態勢を一元把握
- 02CIS、SOC 2、PCI DSSに沿った構成評価
- 03ベースライン逸脱の監視と通知
インストール
コマンドをコピーしてターミナルで実行します。
npx skills add https:/ / github.com/ mukul975/ anthropic-cybersecurity-skills --skill implementing-cloud-security-posture-managementインストール後、Claude Code で/implementing-cloud-security-posture-managementを入力して読み込まれたか確認します。
同梱ファイル
SKILL.md と一緒にインストールされる参考資料やスクリプト。
LICENSESKILL.es.mdreferences/api-reference.mdscripts/agent.py詳細
クラウドセキュリティポスチャ管理の実装
使用する場面
- AWS、Azure、GCP 環境全体で継続的なセキュリティ監視を確立するとき
- コンプライアンス要件により、CIS、SOC 2、PCI DSS に基づくポスチャ評価の自動化が求められるとき
- セキュリティチームが複数のアカウントやサブスクリプションにわたるクラウドの設定ミスを可視化する必要があるとき
- セキュリティベースラインからの逸脱を検出し、修正するセキュリティ運用ワークフローを構築するとき
- ワークロードをクラウドに移行し、セキュリティガードレールを適用する必要があるとき
使用しないでください。実行時のワークロード保護には使用せず(Falco や Aqua などの CWPP ツールを使用)、アプリケーションセキュリティテストには使用せず(DAST/SAST ツールを使用)、ネットワーク侵入検知には使用しないでください(GuardDuty や Network Watcher などのクラウドネイティブ IDS を使用)。
前提条件
- 対象となるすべての環境で、読み取り専用のセキュリティ監査権限を持つマルチクラウド認証情報
- Prowler v3+ のインストール(
pip install prowler) - ScoutSuite のインストール(
pip install scoutsuite) - 各環境で AWS Config、Azure Policy、GCP Organization Policy が有効になっていること
- 検出結果を集約するための集中ログ保存先(S3 バケット、Log Analytics Workspace、または Cloud Storage)
- 重大な検出結果のアラート用に通知チャネル(Slack、PagerDuty、メール)が設定されていること
ワークフロー
ステップ 1:クラウドネイティブの CSPM サービスをデプロイする
ベースラインのポスチャ評価を行うため、各クラウドプロバイダーに組み込まれた CSPM 機能を有効にします。
# AWS: Enable Security Hub with FSBP and CIS standards
aws securityhub enable-security-hub --enable-default-standards
aws securityhub batch-enable-standards --standards-subscription-requests \
'[{"StandardsArn":"arn:aws:securityhub:::standards/cis-aws-foundations-benchmark/v/1.4.0"}]'
# Azure: Enable Microsoft Defender for Cloud (CSPM tier)
az security pricing create --name CloudPosture --tier standard
az security auto-provisioning-setting update --name default --auto-provision on
# GCP: Enable Security Command Center Premium
gcloud services enable securitycenter.googleapis.com
gcloud scc settings update --organization=ORG_ID \
--enable-asset-discovery
ステップ 2:マルチクラウド評価に Prowler を実行する
Prowler を実行し、3 つすべてのクラウドプロバイダーを対象に包括的なセキュリティチェックを行います。
# AWS assessment with all CIS checks
prowler aws \
--profile production \
-M json-ocsf csv html \
-o ./prowler-results/aws/ \
--compliance cis_1.4_aws cis_1.5_aws
# Azure assessment
prowler azure \
--subscription-ids SUB_ID_1 SUB_ID_2 \
-M json-ocsf csv html \
-o ./prowler-results/azure/ \
--compliance cis_2.0_azure
# GCP assessment
prowler gcp \
--project-ids project-1 project-2 \
-M json-ocsf csv html \
-o ./prowler-results/gcp/ \
--compliance cis_2.0_gcp
# View summary across all providers
prowler aws --list-compliance
ステップ 3:クラウド間の比較に ScoutSuite を実行する
ScoutSuite を使用して、視覚的なレポートを備えた統合マルチクラウドセキュリティ評価を行います。
# Scan AWS
python3 -m ScoutSuite aws --profile production \
--report-dir ./scoutsuite/aws/
# Scan Azure
python3 -m ScoutSuite azure --cli \
--all-subscriptions \
--report-dir ./scoutsuite/azure/
# Scan GCP
python3 -m ScoutSuite gcp --user-account \
--all-projects \
--report-dir ./scoutsuite/gcp/
# Each produces an HTML report with risk-scored findings
ステップ 4:コンプライアンス監視の自動化パイプラインを構築する
CSPM チェックを毎日実行し、検出結果を適切なチャネルに振り分けるスケジュール済みパイプラインを作成します。
# Create a daily Prowler scan with EventBridge + CodeBuild (AWS)
cat > buildspec.yml << 'EOF'
version: 0.2
phases:
install:
commands:
- pip install prowler
build:
commands:
- prowler aws -M json-ocsf -o s3://security-findings-bucket/prowler/$(date +%Y%m%d)/
- prowler aws --compliance cis_1.5_aws -M csv -o s3://security-findings-bucket/prowler/compliance/
post_build:
commands:
- |
CRITICAL=$(cat output/*.json | grep -c '"CRITICAL"')
if [ "$CRITICAL" -gt 0 ]; then
aws sns publish --topic-arn arn:aws:sns:us-east-1:ACCOUNT:security-alerts \
--subject "Prowler: $CRITICAL critical findings" \
--message "Review at s3://security-findings-bucket/prowler/$(date +%Y%m%d)/"
fi
EOF
# Schedule with EventBridge
aws events put-rule \
--name daily-prowler-scan \
--schedule-expression "cron(0 6 * * ? *)" \
--state ENABLED
ステップ 5:検出結果の集約と重複排除を設定する
複数の CSPM ツールやクラウドプロバイダーからの検出結果を、統合されたビューに集約します。
# findings_aggregator.py - Normalize and deduplicate CSPM findings
import json
import hashlib
from datetime import datetime
def normalize_finding(finding, source):
"""Normalize findings from different CSPM tools to a common format."""
normalized = {
'id': hashlib.sha256(f"{finding.get('ResourceId','')}{finding.get('CheckId','')}".encode()).hexdigest()[:16],
'source': source,
'cloud': finding.get('Provider', 'unknown'),
'account': finding.get('AccountId', finding.get('SubscriptionId', '')),
'region': finding.get('Region', ''),
'resource_type': finding.get('ResourceType', ''),
'resource_id': finding.get('ResourceId', ''),
'severity': finding.get('Severity', 'INFO').upper(),
'status': finding.get('Status', 'FAIL'),
'title': finding.get('CheckTitle', finding.get('Title', '')),
'description': finding.get('StatusExtended', ''),
'compliance': finding.get('Compliance', {}),
'remediation': finding.get('Remediation', {}).get('Recommendation', {}).get('Text', ''),
'timestamp': datetime.utcnow().isoformat()
}
return normalized
def aggregate_findings(prowler_file, scoutsuite_file):
findings = {}
for file_path, source in [(prowler_file, 'prowler'), (scoutsuite_file, 'scoutsuite')]:
with open(file_path) as f:
for line in f:
raw = json.loads(line)
normalized = normalize_finding(raw, source)
if normalized['status'] == 'FAIL':
findings[normalized['id']] = normalized
return sorted(findings.values(), key=lambda x: {'CRITICAL':0,'HIGH':1,'MEDIUM':2,'LOW':3}.get(x['severity'],4))
ステップ 6:逸脱の検出と自動修正を実装する
セキュリティベースラインに違反する設定の逸脱に対し、自動応答を設定します。
# AWS Config auto-remediation for non-compliant S3 buckets
aws configservice put-remediation-configurations --remediation-configurations '[{
"ConfigRuleName": "s3-bucket-public-read-prohibited",
"TargetType": "SSM_DOCUMENT",
"TargetId": "AWS-DisableS3BucketPublicReadWrite",
"Parameters": {
"S3BucketName": {"ResourceValue": {"Value": "RESOURCE_ID"}}
},
"Automatic": true,
"MaximumAutomaticAttempts": 3,
"RetryAttemptSeconds": 60
}]'
# Azure Policy for auto-remediation
az policy assignment create \
--name "enforce-storage-encryption" \
--policy "/providers/Microsoft.Authorization/policyDefinitions/404c3081-a854-4457-ae30-26a93ef643f9" \
--scope "/subscriptions/SUB_ID" \
--enforcement-mode Default
# GCP Organization Policy constraint
gcloud resource-manager org-policies set-policy policy.yaml --organization=ORG_ID
# policy.yaml: constraint: constraints/storage.publicAccessPrevention, enforcement: true
主な概念
| 用語 | 定義 |
|---|---|
| CSPM | クラウドセキュリティポスチャ管理。設定ミスやコンプライアンス違反を検出するため、クラウドインフラストラクチャを継続的に監視する取り組みです |
| Configuration Drift | 承認済みのセキュリティベースラインから時間の経過とともに逸脱する、意図しないクラウドリソース設定の変更です |
| Security Baseline | すべてのクラウドリソースが満たす必要のある、最低限のセキュリティ設定要件を文書化したものです |
| Compliance Framework | クラウド設定を評価するための、体系化されたセキュリティ管理策と要件のセットです(CIS、SOC 2、PCI DSS、NIST) |
| Finding Severity | 悪用可能性と潜在的な影響に基づく、設定ミスのリスク分類です(Critical、High、Medium、Low、Informational) |
| Auto-Remediation | 手動での介入なしに、非準拠のリソースを必要な設定に戻す自動修正アクションです |
ツールとシステム
- Prowler:CIS、PCI DSS、HIPAA、NIST に準拠した 300 以上のチェックを備える、オープンソースのマルチクラウドセキュリティ評価ツール
- ScoutSuite:API で収集した設定データから、リスクスコア付きの HTML レポートを生成するマルチクラウドセキュリティ監査ツール
- AWS Security Hub:検出結果の集約とコンプライアンス基準の評価に対応する、AWS ネイティブの CSPM
- Microsoft Defender for Cloud:セキュアスコア、規制コンプライアンス、ワークロード保護を備える、Azure ネイティブの CSPM
- GCP Security Command Center:アセットインベントリ、脆弱性スキャン、コンプライアンス監視を備える、GCP ネイティブのセキュリティプラットフォーム
よくあるシナリオ
シナリオ:マルチクラウド企業の CSPM 導入
コンテキスト:ある企業は、AWS(主要環境)、Azure(ID 管理と Microsoft サービス)、GCP(データ分析)にまたがって本番ワークロードを運用しています。セキュリティチームは、統合されたセキュリティポスチャの可視化を必要としています。
アプローチ:
- 各プロバイダーでクラウドネイティブの CSPM を有効にします:Security Hub、Defender for Cloud、SCC
- CI/CD パイプラインを通じて、各環境で Prowler のスキャンを毎日のスケジュールジョブとして実行します
- 集約スクリプトを使用して、検出結果を正規化し、中央データレイクに集約します
- Grafana または Kibana で、クラウド、アカウント、深刻度別のセキュリティポスチャスコアを表示するダッシュボードを構築します
- 既知の安全な修正(パブリックアクセスのブロック、暗号化の有効化)に対する自動修復を設定します
- CRITICAL の検出結果は即時対応のために PagerDuty に、HIGH の検出結果は Jira チケットに振り分けます
- 傾向データを示す週次コンプライアンスレポートを作成し、経営幹部に共有します
落とし穴:過剰に広い権限で CSPM ツールを実行すると、価値の高い攻撃対象になります。読み取り専用権限を持つ専用サービスアカウントを使用し、認証情報を定期的にローテーションしてください。CSPM ツールによって同じ設定ミスの報告方法が異なる場合があるため、重複排除のロジックでは、ツールごとに異なるリソース ID の形式や検出結果のタイトルを考慮する必要があります。
出力形式
Cloud Security Posture Management Dashboard
==============================================
Organization: Acme Corp
Assessment Date: 2026-02-23
Environments: AWS (12 accounts), Azure (8 subscriptions), GCP (5 projects)
POSTURE SCORES:
AWS: 82/100 (+3 from last week)
Azure: 76/100 (-1 from last week)
GCP: 79/100 (+5 from last week)
Overall: 79/100
FINDINGS BY SEVERITY:
Critical: 18 (AWS: 7, Azure: 8, GCP: 3)
High: 67 (AWS: 28, Azure: 24, GCP: 15)
Medium: 234 (AWS: 98, Azure: 87, GCP: 49)
Low: 412 (AWS: 178, Azure: 134, GCP: 100)
TOP FAILING CATEGORIES:
1. IAM overly permissive policies (43 findings)
2. Encryption not enabled at rest (38 findings)
3. Public network exposure (29 findings)
4. Logging and monitoring gaps (24 findings)
5. Unused credentials and keys (19 findings)
AUTO-REMEDIATION (Last 7 Days):
Findings auto-remediated: 34
Manual remediation pending: 51
Exceptions approved: 8