performing-gcp-security-assessment-with-forseti
它能做什么
这个工具用于检查你的 Google Cloud 账户安全性。它会分析谁能访问什么、网络规则和存储权限等设置,确保一切安全,并符合安全标准。
适用场景
- ✓当你要定期对 Google Cloud 账户进行安全检查时。
- ✓当你在 Google Cloud 中创建新项目并制定初始安全规则时。
- ✓当你需要确保账户遵循 CIS GCP Foundations Benchmark 安全指南时。
技能链接
https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-gcp-security-assessment-with-forseti/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“检查我的 Google Cloud 账户安全性,并告诉我是否存在权限过于宽松的访问设置或危险的网络规则。”
每周 5 个新技能,1 分钟读完。
工作原理
该工具使用特定的 Google Cloud 命令和其他安全工具收集配置信息,然后分析这些数据,找出潜在的安全问题。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Performing GCP Security Assessment with Forseti
When to Use
- When conducting periodic security assessments of GCP organizations and projects
- When onboarding new GCP projects and establishing security baselines
- When compliance mandates CIS GCP Foundations Benchmark evaluation
- When auditing IAM bindings, firewall rules, and storage ACLs across multiple GCP projects
- When building continuous security monitoring for GCP infrastructure
Do not use as a replacement for GCP Security Command Center Premium for real-time threat detection, for application-level vulnerability scanning (use Web Security Scanner), or for GKE-specific security (use GKE Security Posture).
Prerequisites
- GCP Organization with Organization Admin or Security Admin IAM role
- gcloud CLI authenticated with sufficient permissions (
roles/securitycenter.admin,roles/iam.securityReviewer) - Security Command Center (SCC) enabled at the organization level
- ScoutSuite installed for multi-cloud comparison (
pip install scoutsuite) - Python 3.8+ for custom audit scripts using google-cloud-asset and google-cloud-securitycenter libraries
Workflow
Step 1: Enable Security Command Center and Asset Inventory
Enable SCC and set up Cloud Asset Inventory for comprehensive resource visibility.
# Enable Security Command Center API
gcloud services enable securitycenter.googleapis.com \
--project=PROJECT_ID
# Enable Cloud Asset API
gcloud services enable cloudasset.googleapis.com \
--project=PROJECT_ID
# List all assets in the organization
gcloud asset search-all-resources \
--scope=organizations/ORG_ID \
--asset-types="compute.googleapis.com/Instance,storage.googleapis.com/Bucket,iam.googleapis.com/ServiceAccount" \
--format="table(name, assetType, location, project)"
# Export asset inventory to BigQuery for analysis
gcloud asset export \
--organization=ORG_ID \
--output-bigquery-force \
--output-bigquery-dataset=projects/PROJECT_ID/datasets/asset_inventory \
--output-bigquery-table=resources \
--content-type=resource
Step 2: Audit IAM Policies and Bindings
Review IAM policies across the organization for overly permissive bindings, primitive roles, and service account misuse.
# List all IAM policy bindings at org level
gcloud organizations get-iam-policy ORG_ID \
--format=json > org-iam-policy.json
# Find all users with Owner or Editor roles across projects
gcloud asset search-all-iam-policies \
--scope=organizations/ORG_ID \
--query="policy:roles/owner OR policy:roles/editor" \
--format="table(resource, policy.bindings.role, policy.bindings.members)"
# Identify service accounts with admin roles
gcloud asset search-all-iam-policies \
--scope=organizations/ORG_ID \
--query="policy.bindings.members:serviceAccount AND policy:roles/owner" \
--format=json
# Check for allUsers or allAuthenticatedUsers bindings (public access)
gcloud asset search-all-iam-policies \
--scope=organizations/ORG_ID \
--query="policy:allUsers OR policy:allAuthenticatedUsers" \
--format="table(resource, policy.bindings.role, policy.bindings.members)"
# List service account keys older than 90 days
gcloud iam service-accounts keys list \
--iam-account=SA_EMAIL \
--managed-by=user \
--format="table(name,validAfterTime,validBeforeTime)"
Step 3: Assess Firewall Rules and Network Configuration
Audit VPC firewall rules for overly permissive ingress rules, missing logging, and network exposure.
# List all firewall rules allowing ingress from 0.0.0.0/0
gcloud compute firewall-rules list \
--filter="direction=INGRESS AND sourceRanges=0.0.0.0/0" \
--format="table(name, network, allowed, sourceRanges, targetTags)"
# Find firewall rules allowing all protocols/ports
gcloud compute firewall-rules list \
--filter="direction=INGRESS AND allowed[].IPProtocol=all" \
--format="table(name, network, sourceRanges, targetTags)"
# Check for SSH (22) and RDP (3389) open to internet
gcloud compute firewall-rules list \
--filter="direction=INGRESS AND sourceRanges=0.0.0.0/0 AND (allowed[].ports=22 OR allowed[].ports=3389)" \
--format="table(name, network, allowed, sourceRanges)"
# Audit VPC flow log configuration
gcloud compute networks subnets list \
--format="table(name, region, enableFlowLogs, logConfig.aggregationInterval)"
Step 4: Audit Cloud Storage Bucket Permissions
Check for publicly accessible storage buckets and missing encryption configurations.
…
常见问题
什么是 Forseti Security?
Forseti Security 是一款开源工具,帮助审计和监控 Google Cloud 环境中的安全状况。
什么是 Security Command Center(SCC)?
SCC 是 Google Cloud 的一项服务,帮助你管理所有 Google Cloud 资源的安全性与合规性。
什么是 CIS GCP Foundations Benchmark?
这是由互联网安全中心(CIS)制定的一套安全建议,用于指导你安全地配置 Google Cloud 环境。
详情
作者的原始描述
Performing comprehensive security assessments of Google Cloud Platform environments using Forseti Security, Security Command Center, and gcloud CLI to audit IAM policies, firewall rules, storage permissions, and compliance against CIS GCP Foundations Benchmark. '
热度
- GitHub 星标
- 35k
- 排名
- #8235
- 许可证
- Apache-2.0
- 更新时间
- 2026/8/31
评论
- …
同一仓库的更多技能
abusing-dpapi-for-credential-access
35k为你的 AI 智能体提供针对特定任务的现成指令,让它完成得更好、更快。
abusing-shadow-credentials-for-privesc
35k教你的 AI 智能体写出清晰、结构良好的文本。
achieving-cmmc-level-2-compliance
35k帮助你的智能体搭建符合 CMMC Level 2 合规要求的环境。它会落实安全要求,并管理必要的文档。
acquiring-disk-image-with-dd-and-dcfldd
35k帮助你的智能体创建硬盘的精确副本。这能确保调查过程中信息不丢失、不被篡改。