implementing-cloud-vulnerability-posture-management について
AWS と Azure を対象に、マルチクラウドのセキュリティ態勢管理を導入するためのスキルです。クラウド標準のセキュリティサービス、Prowler、ScoutSuite による評価と、スキャン結果の集約を扱います。
主な機能
- 01AWS Security Hub による制御項目の確認
- 02Azure Defender for Cloud の設定
- 03Prowler による AWS スキャン
- 04ScoutSuite による AWS・Azure 評価
- 05マルチクラウドのスキャン結果集約
活用シーン
- 01マルチクラウドの設定リスク監視の構築
- 02コンプライアンス要件に沿った制御設定
- 03AWS または Azure のセキュリティ評価
インストール
コマンドをコピーしてターミナルで実行します。
$
npx skills add https:/ / github.com/ mukul975/ anthropic-cybersecurity-skills --skill implementing-cloud-vulnerability-posture-managementインストール後、Claude Code で/implementing-cloud-vulnerability-posture-managementを入力して読み込まれたか確認します。
同梱ファイル
SKILL.md と一緒にインストールされる参考資料やスクリプト。
LICENSEassets/template.mdreferences/api-reference.mdstandards.mdworkflows.mdscripts/agent.pyprocess.py詳細
クラウド脆弱性ポスチャ管理の実装
概要
クラウドセキュリティポスチャ管理(CSPM)は、設定ミス、コンプライアンス違反、セキュリティリスクがないか、クラウドインフラストラクチャを継続的に監視します。従来の脆弱性スキャンとは異なり、CSPM はクラウドネイティブなリスクに焦点を当てます。たとえば、IAM の過剰な権限付与、公開状態のストレージバケット、暗号化されていないデータ、ネットワーク制御の欠如、サービスの設定ミスなどです。このスキルでは、AWS Security Hub、Azure Defender for Cloud、Prowler や ScoutSuite などのオープンソースツールを使用したマルチクラウド CSPM について説明します。
使用する場面
- 環境にクラウド脆弱性ポスチャ管理機能を導入または設定する場合
- コンプライアンス要件に準拠したセキュリティ制御を確立する場合
- この分野のセキュリティアーキテクチャを構築または改善する場合
- この実装を必要とするセキュリティ評価を実施する場合
前提条件
- SecurityAudit IAM ポリシーを設定した AWS CLI
- Security Reader ロールを持つ Azure CLI
boto3、azure-identity、azure-mgmt-securityを含む Python 3.9+- Prowler(https://github.com/prowler-cloud/prowler)
- ScoutSuite(https://github.com/nccgroup/ScoutSuite)
AWS Security Hub
Security Hub を有効にする
# Enable AWS Security Hub with default standards
aws securityhub enable-security-hub \
--enable-default-standards \
--region us-east-1
# Enable specific standards
aws securityhub batch-enable-standards \
--standards-subscription-requests \
'{"StandardsArn":"arn:aws:securityhub:us-east-1::standards/aws-foundational-security-best-practices/v/1.0.0"}' \
'{"StandardsArn":"arn:aws:securityhub:us-east-1::standards/cis-aws-foundations-benchmark/v/1.4.0"}'
# Get findings summary
aws securityhub get-findings \
--filters '{"SeverityLabel":[{"Value":"CRITICAL","Comparison":"EQUALS"}],"RecordState":[{"Value":"ACTIVE","Comparison":"EQUALS"}]}' \
--max-items 10
Security Hub の標準
| 標準 | 説明 |
|---|---|
| AWS Foundational Security Best Practices | AWS が推奨するベースライン制御 |
| CIS AWS Foundations Benchmark 1.4 | CIS のセキュリティ強化要件 |
| PCI DSS v3.2.1 | 決済カード業界の制御 |
| NIST SP 800-53 Rev 5 | 連邦政府のセキュリティ制御 |
Azure Defender for Cloud
Defender CSPM を有効にする
# Enable Defender for Cloud free tier
az security pricing create \
--name CloudPosture \
--tier standard
# Check secure score
az security secure-score list \
--query "[].{Name:displayName,Score:current,Max:max}" \
--output table
# Get security recommendations
az security assessment list \
--query "[?status.code=='Unhealthy'].{Name:displayName,Severity:metadata.severity,Resource:resourceDetails.id}" \
--output table
# Get alerts
az security alert list \
--query "[?status=='Active'].{Name:alertDisplayName,Severity:severity,Time:timeGeneratedUtc}" \
--output table
オープンソース:Prowler
インストールと実行
# Install Prowler
pip install prowler
# Run full AWS scan
prowler aws --output-formats json-ocsf,csv,html
# Run specific checks
prowler aws --checks s3_bucket_public_access iam_root_mfa_enabled ec2_sg_open_to_internet
# Run against specific AWS profile and region
prowler aws --profile production --region us-east-1 --output-formats json-ocsf
# Run CIS Benchmark compliance check
prowler aws --compliance cis_1.5_aws
# Run PCI DSS compliance
prowler aws --compliance pci_3.2.1_aws
# Scan Azure environment
prowler azure --subscription-ids "sub-id-here"
# Scan GCP environment
prowler gcp --project-ids "project-id-here"
Prowler のチェックカテゴリ
| カテゴリ | 例 |
|---|---|
| IAM | ルート MFA、パスワードポリシー、アクセスキーのローテーション |
| S3 | パブリックアクセス、暗号化、バージョニング |
| EC2 | セキュリティグループ、EBS 暗号化、メタデータサービス |
| RDS | パブリックアクセス、暗号化、バックアップの保持 |
| CloudTrail | 有効化、暗号化、ログ検証 |
| VPC | フローログ、デフォルト SG の制限 |
| Lambda | パブリックアクセス、ランタイムバージョン |
| EKS | パブリックエンドポイント、シークレットの暗号化 |
オープンソース:ScoutSuite
# Install ScoutSuite
pip install scoutsuite
# Run AWS assessment
scout aws --profile production
# Run Azure assessment
scout azure --cli
# Run GCP assessment
scout gcp --project-id my-project
# Results available as interactive HTML report
# Open scout-report/report.html in browser
マルチクラウドの集約
import json
import subprocess
from datetime import datetime, timezone
def run_prowler_scan(provider, output_dir, compliance=None):
"""Run Prowler scan for a cloud provider."""
cmd = ["prowler", provider, "--output-formats", "json-ocsf",
"--output-directory", output_dir]
if compliance:
cmd.extend(["--compliance", compliance])
result = subprocess.run(cmd, capture_output=True, text=True, timeout=3600)
return result.returncode == 0
def aggregate_findings(prowler_dirs):
"""Aggregate findings from multiple Prowler scans."""
all_findings = []
for scan_dir in prowler_dirs:
json_files = list(Path(scan_dir).glob("*.json"))
for jf in json_files:
with open(jf, "r") as f:
for line in f:
try:
finding = json.loads(line.strip())
all_findings.append(finding)
except json.JSONDecodeError:
continue
# Sort by severity
severity_order = {"critical": 0, "high": 1, "medium": 2, "low": 3, "informational": 4}
all_findings.sort(key=lambda f: severity_order.get(
f.get("severity", "informational").lower(), 5
))
return all_findings
def generate_posture_report(findings, output_path):
"""Generate cloud security posture report."""
report = {
"generated_at": datetime.now(timezone.utc).isoformat(),
"total_findings": len(findings),
"by_severity": {},
"by_provider": {},
"by_service": {},
}
for f in findings:
sev = f.get("severity", "unknown")
provider = f.get("cloud_provider", "unknown")
service = f.get("service_name", "unknown")
report["by_severity"][sev] = report["by_severity"].get(sev, 0) + 1
report["by_provider"][provider] = report["by_provider"].get(provider, 0) + 1
report["by_service"][service] = report["by_service"].get(service, 0) + 1
with open(output_path, "w") as f:
json.dump(report, f, indent=2)
return report
参考資料
コメント
Markdown 対応