
端末ベースのAWSセキュリティスキャナーで、VPC、IAM、S3、CloudTrail、コンテナ(ECS/EKS)、AI攻撃検出にわたる102以上のセキュリティチェックを実施します。危険なIAM権限、露出したシークレット、設定ミスのあるS3バケット、コンテナの脆弱性、そして新興のLLMjacking脅威を検出します。
ターミナルベースのAWSセキュリティスキャナ。100以上のセキュリティチェックをVPC、IAM、S3、CloudTrail、コンテナ(ECS/EKS)、AI攻撃検出にわたって実行。危険なIAM権限、露出したシークレット、誤設定されたS3バケット、コンテナの脆弱性、そして新興のLLMjacking脅威を検出します。
製品概要: docs/CAPABILITIES_OVERVIEW.md
*:*).env、.git、認証情報)2025年2月の脅威インテリジェンスに基づく:8分間のAWS侵害
| カテゴリ | 件数 |
|---|---|
| コア(IAM、VPC、S3、CloudTrail、シークレット) | 38 |
| 拡張(Lambda、ELB、Route53、Inspectorなど) |
# macOS
brew install awscli
# Linux
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip && sudo ./aws/install
aws configure
# または名前付きプロファイルを使用
aws configure --profile myprofile
AWS認証情報には、スキャン対象のサービスに対する読み取り専用アクセスが必要です。AWS管理ポリシーReadOnlyAccessで動作します。詳細は必要な権限を参照してください。
注: aws-perimeterは読み取り操作のみを実行し、AWSリソースを変更することはありません。
curl -sSfL https://raw.githubusercontent.com/thirukguru/aws-perimeter/main/install.sh | sh
go install github.com/thirukguru/aws-perimeter@latest
aws-perimeter # フルセキュリティスキャンの実行
aws-perimeter --output json # JSON出力
aws-perimeter --profile prod # 特定のAWSプロファイル
aws-perimeter --region us-west-2 # 特定のリージョン
aws-perimeter --regions us-east-1,us-west-2 # マルチリージョンスキャン
aws-perimeter --regions us-east-1,us-west-2 --max-parallel 4 # マルチリージョン、同時実行制御付き
aws-perimeter --regions us-east-1,us-west-2 --max-parallel 4 --best-effort # 少なくとも1リージョン成功で終了コード0
aws-perimeter --rules # RULES.mdを標準出力に印刷(Markdown)
aws-perimeter --capabilities # 機能概要を標準出力に印刷(Markdown)
aws-perimeter --all-regions # 有効な全リージョンをスキャン
aws-perimeter --org-scan --org-role-name OrganizationAccountAccessRole # マルチアカウント組織スキャン
aws-perimeter --org-scan --max-parallel 5 # 組織+リージョンのファンアウト同時実行
aws-perimeter --output html --output-file report.html # HTMLレポートの生成
aws-perimeter --store --profile prod --region us-west-2 # スキャン実行+永続化
aws-perimeter --trends --trend-days 30 --account-id 123456789012 # 過去のトレンドテーブル表示
aws-perimeter history list --db-path ~/.aws-perimeter/history.db
aws-perimeter dashboard --port 8080
ファンアウトモード(--regions、--all-regions、--org-scan)で--output html --output-file ...を使用する場合、aws-perimeterはスキャンユニットごとにリージョン/アカウント+タイムスタンプのサフィックス(例:security-report-us-east-1-20260210-213045.html、security-report-123456789012-us-east-1-20260210-213045.html)を付けてレポートを1つ書き込みます。HTMLモードでは、ターミナルテーブル出力は抑制され、簡潔なサマリー行のみが印刷されます。
--output jsonを使用すると、aws-perimeterはバナーやスピナー出力なしで単一の有効なJSONドキュメントを出力するため、パイプラインで安全に使用できます。
aws-perimeter --profile prod --region us-west-2 --output json | jq .
# マルチリージョンJSONは集約されたトップレベルのJSONドキュメントを1つ出力します:
aws-perimeter --profile prod --regions us-east-1,us-west-2 --output json | jq .
# 標準出力リダイレクトでドキュメントをエクスポート
aws-perimeter --rules > rules.md
aws-perimeter --capabilities > capabilities.md
マルチリージョンJSONペイロードには以下が含まれます:
summary(total_regions、success、failed、skipped)results(リージョンごとに統合されたスキャンペイロード)failures(リージョンスキャン失敗時のリージョンとエラー詳細)マルチリージョンおよび組織スキャンでJSON以外の出力モードの場合、aws-perimeterは実行終了時に統合サマリーを印刷します:
account_id、account_name、region、status、duration、errorTOTAL、SUCCESS、FAILED、SKIPPED)--max-parallelと--best-effort--max-parallelは、ファンアウトモード(--regions、--all-regions、--org-scan)で同時に実行するリージョン/アカウントスキャンユニット数を制御します。--max-parallel 3または--max-parallel 4。--best-effortはマルチリージョンスキャンに適用され、一部のリージョンが失敗しても少なくとも1リージョンが成功した場合、コマンドは成功(0)で終了します。--best-effortがない場合、失敗したリージョンがあると非ゼロの終了コードが返されます。failuresに正確なエラーとともに表示されます。全機能(マルチリージョンおよび組織スキャンを含む)をカバーするには、以下の権限が必要です:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"sts:GetCallerIdentity",
"sts:AssumeRole",
"organizations:DescribeOrganization",
"organizations:ListAccounts",
"ec2:Describe*",
"ec2:GetEbsEncryptionByDefault",
"iam:List*",
"iam:Get*",
"iam:GenerateCredentialReport",
"s3:ListAllMyBuckets",
"s3:GetBucket*",
"s3:GetEncryptionConfiguration",
"cloudtrail:DescribeTrails",
"cloudtrail:GetTrailStatus",
"cloudtrail:LookupEvents",
"lambda:ListFunctions",
"lambda:GetFunctionConfiguration",
"lambda:GetFunction",
"ecr:DescribeRepositories",
"ecr:DescribeImages",
"ecr:BatchGetImage",
"ecr:GetDownloadUrlForLayer",
"ecs:ListClusters",
"ecs:DescribeClusters",
"ecs:ListServices",
"ecs:DescribeServices",
"ecs:DescribeTaskDefinition",
"eks:ListClusters",
"eks:DescribeCluster",
"eks:ListNodegroups",
"eks:DescribeNodegroup",
"bedrock:ListProvisionedModelThroughputs",
"bedrock:ListCustomModels",
"bedrock:GetModelInvocationLoggingConfiguration",
"guardduty:ListDetectors",
"guardduty:GetDetector",
"guardduty:ListFindings",
"guardduty:GetFindings",
"securityhub:DescribeHub",
"securityhub:GetFindings",
"config:Describe*",
"kms:ListKeys",
"kms:DescribeKey",
"kms:GetKeyRotationStatus",
"kms:Decrypt",
"rds:DescribeDB*",
"dynamodb:ListTables",
"dynamodb:DescribeTable",
"dynamodb:DescribeContinuousBackups",
"secretsmanager:ListSecrets",
"elasticloadbalancing:Describe*",
"backup:List*",
"apigateway:GET",
"cloudfront:List*",
"cloudfront:Get*",
"cloudwatch:GetMetricStatistics",
"sns:ListTopics",
"sqs:ListQueues"
],
"Resource": "*"
}
]
}
kms:Decryptは、暗号化されたオブジェクト/パッケージ(例:SSE-KMS S3オブジェクトの読み取り)をスキャンする場合にのみ必要です。本番環境では必要なKMSキーにスコープを絞ってください。
--org-scanを使用する場合、管理プリンシパルはメンバーアカウントのロール(デフォルト:OrganizationAccountAccessRole)を引き受けることが許可されている必要があります。例:
{
"Effect": "Allow",
"Action": "sts:AssumeRole",
"Resource": "arn:aws:iam::*:role/OrganizationAccountAccessRole"
}
メンバーアカウントのロール信頼ポリシーでも、スキャナープリンシパル(ユーザー/ロール)がそれを引き受けられるようにする必要があります(--external-idを使用する場合はsts:ExternalId条件を含めます)。
ヒント: 素早く始めるには、IAMユーザー/ロールにAWS管理ポリシー
arn:aws:iam::aws:policy/ReadOnlyAccessをアタッチしてください。
Apache License 2.0
| 35 |
| コンテナセキュリティ(ECS + EKS) | 22 |
| AI攻撃検出 | 7 |
| 合計 | 102 |
| チェック | 深刻度 | 説明 |
|---|
| 権限昇格 | 🔴 Critical | ユーザーが管理者に昇格可能 |
| 管理者アクセス(:) | 🔴 Critical | フルAWSアクセスが許可されている |
| 露出したシークレット | 🔴 Critical | Lambda/EC2内のAPIキー/トークン |
| パブリックS3バケット | 🔴 Critical | バケットが公開アクセス可能 |
| CloudTrailなし | 🔴 Critical | 監査ログ記録がない |
| 開放されたSSH/RDP | 🔴 Critical | ポート22/3389がインターネットに開放 |
| 特権コンテナ | 🔴 Critical | ルートアクセスを持つECSコンテナ |
| GPU IMDSv1 | 🔴 Critical | GPUインスタンスの認証情報が脆弱 |
| クロスアカウント信頼 | 🟠 High | 外部アカウントがロールを引き受け可能 |
| EKSパブリックエンドポイント | 🟠 High | Kubernetes APIが公開アクセス可能 |
| Bedrockログ記録なし | 🟠 High | AIモデルの使用が監査されていない |
| フラグ | 短縮形 | 説明 |
|---|
--profile | -p | 使用するAWSプロファイル |
--region | -r | AWSリージョン |
--regions | カンマ区切りのリージョンリスト | |
--all-regions | 有効な全リージョンをスキャン | |
--org-scan | アクティブなAWS Organization全アカウントをスキャン | |
--org-role-name | メンバーアカウントで引き受けるIAMロール名 | |
--external-id | クロスアカウントのロール引き受け用外部ID | |
--output | -o | 出力形式:table、json、またはhtml |
--rules | ルールカタログMarkdownを印刷して終了 | |
--capabilities | 機能Markdownを印刷して終了 | |
--output-file | -f | 出力ファイル(htmlでは必須) |
--store | スキャン結果をSQLiteに永続化 | |
--db-path | カスタムSQLite DBパス | |
--trends | 過去のトレンドを表示 | |
--trend-days | トレンド期間(日数、デフォルト30) | |
--compare | 最近の2つのスキャンを比較 | |
--export-json | トレンドJSONファイルをエクスポート | |
--export-csv | トレンドCSVファイルをエクスポート | |
--account-id | トレンド/履歴のアカウントフィルター | |
--max-parallel | 最大同時リージョン/アカウントスキャンユニット数 | |
--best-effort | マルチリージョンスキャンで、少なくとも1リージョンが成功すれば成功とみなす | |
--dry-run | 修復プレビューモード | |
--remediate | サポートされている修復を適用 | |
--dashboard-port | ダッシュボードポート(ルートフラグ;dashboardサブコマンドは--portを使用) | |
--version | -v | バージョン情報 |
| Phase | ステータス | ルール数 |
|---|
| Phase 1 | ✅ 完了 | 73 |
| Phase 2 | 🔲 進行中 | +20 |
| Phase 2.5 | 🆕 AI攻撃検出 | +13 |
| Phase 3 | 🔲 予定 | +15 |
| Phase 4 | 🔲 予定 | 機能 |