cloud-armor-crs-rule-upgrader
它能做什么
这个技能帮你把 Google Cloud Armor 中的网络安全规则更新到新版本。它适用于仍在使用旧版 OWASP 规则集,并希望安全升级的安全团队。
适用场景
- ✓当你需要把 Cloud Armor 安全策略从 OWASP CRS 3.0 或 3.3 迁移到 4.22 的时候。
- ✓当你想在升级前评估更改 Cloud Armor 规则的风险的时候。
- ✓当你的 Cloud Armor 规则使用了需要更新的旧版预配置 WAF 设置或排除项的时候。
技能链接
https://github.com/google/skills/blob/main/skills/cloud/cloud-armor-crs-rule-upgrader/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请把我的 Cloud Armor 策略从 OWASP 规则 3.3 升级到 4.22,并告诉我可能会出什么问题。”
每周 5 个新技能,1 分钟读完。
工作原理
它会审核你当前的策略,保留你选择加入和排除的签名列表,并为新版本重写规则。它还会评估每项更改的运营风险等级。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Cloud Armor OWASP Rule Upgrader (CRS 3.0/3.3 -> 4.22)
<!-- disableFinding(LINE_OVER_80) -->This skill guides Network Security Agents and Google Cloud practitioners through auditing, assessing, and upgrading Google Cloud Armor security policies from legacy OWASP Core Rule Set (CRS) 3.0 or 3.3 to OWASP CRS 4.22.
Usage Attribution
MUST READ: Before executing any gcloud, REST API, or MCP command, you
MUST read and follow the instructions in
Usage Attribution.
Prerequisites and Environment Setup
Before auditing or modifying Google Cloud Armor security policies, ensure the following prerequisites are met:
Google Cloud SDK: Install or update the Google Cloud CLI (
gcloud).Project Selection and Active Billing: Select your target Google Cloud project and verify that an active billing account is attached:
gcloud config set project PROJECT_ID gcloud billing projects describe PROJECT_ID --format="value(billingEnabled)"API Enablement: Enable the Compute Engine API (for Cloud Armor security policies) and Cloud Logging API (for preview mode telemetry):
gcloud services enable compute.googleapis.com logging.googleapis.comAuthentication:
- Interactive CLI:
gcloud auth login - Application Default Credentials (ADC):
gcloud auth application-default login - Service Accounts: Set
GOOGLE_APPLICATION_CREDENTIALS="/path/to/service-account-key.json".
- Interactive CLI:
Required IAM Roles:
roles/compute.securityAdmin: Required to create, update, delete, or import Cloud Armor security policies and rules (useroles/compute.securityViewerfor read-only policy audits).roles/logging.viewer: Required to inspect HTTP load balancer preview telemetry in Cloud Logging.
Scope and Regional Availability:
- Cloud Armor security policies can be Global (default for global
external Application Load Balancers) or Regional (for regional
external Application Load Balancers, for example,
--region=us-central1; set a default region viagcloud config set compute/region us-central1). See Google Cloud Locations for regional availability.
- Cloud Armor security policies can be Global (default for global
external Application Load Balancers) or Regional (for regional
external Application Load Balancers, for example,
Pricing and Resource Cleanup:
- Cloud Armor incurs charges per security policy, per rule, and per million requests depending on your tier (Standard vs. Enterprise); check Google Cloud Armor Pricing for current rates.
- Teardown / Cleanup: Always delete temporary
--previewrules (gcloud compute security-policies rules delete PREVIEW_PRIORITY --security-policy="POLICY_NAME") or standalone test policies (gcloud compute security-policies delete TEST_POLICY_NAME) after cutover to avoid leaving orphan rules that consume policy quota or incur recurring rule charges.
Quick Start and CLI Helper
For automated, deterministic parsing, signature remapping, and preview-mode priority allocation, invoke the bundled standalone Python CLI:
# In-Place Upgrade (Report Summary)
python3 scripts/upgrade_policy.py /path/to/policy.json --mode=in-place --format=report
# In-Place Upgrade (Output gcloud commands)
python3 scripts/upgrade_policy.py /path/to/policy.json --mode=in-place --format=gcloud
# Preview Mode Upgrade (Generates preview rules at priority - 5)
python3 scripts/upgrade_policy.py /path/to/policy.json --mode=preview --format=gcloud
# Direct stdin piping from gcloud describe
gcloud compute security-policies describe POLICY_NAME --format=json | \
python3 scripts/upgrade_policy.py - --mode=preview --format=json
See gcloud_recipes.md for full command workflows.
Core Upgrade Workflow for Network Security Agent
[!IMPORTANT] Mandatory Agent Response Behaviors: 1. Explain Both Upgrade Modes: Whenever discussing an upgrade (even if the user asks specifically about Preview Mode or In-Place), ALWAYS explain BOTH In-Place Upgrade (direct in-situ rule replacement, immediate enforcement, ze
常见问题
我自定义的排除项会被保留吗?
会。它会保留签名的加入和排除列表,并为新版本更新排除项。
我能在强制执行前检查规则吗?
可以。它会审查预览模式的遥测数据,让你在强制执行前看到效果。
可以从哪些版本升级?
可以从 OWASP CRS 3.0 和 3.3 升级到 OWASP CRS 4.22。
详情
作者的原始描述
Upgrades Google Cloud Armor security policies from OWASP CRS 3.0 and 3.3 to OWASP CRS 4.22. Preserves signature opt-in and opt-out lists, translates evaluatePreconfiguredExpr to native evaluatePreconfiguredWaf dictionary parameters, remaps signature IDs to v042200, drops retired signature IDs, and updates structured preconfiguredWafConfig fine-tuning exclusions. Evaluates operational risk (High Breaking Change, Medium Attention Required, Low Clean Upgrade) including Method Enforcement breaking changes (PUT/PATCH/DELETE blocking) and sensitivity coverage expansions. Supports both in-place rule
repo: google/skills
热度
- GitHub 星标
- 22k
- 排名
- #10233
- 许可证
- Apache-2.0
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
finding-google-skills
22k帮你的智能体为某项设置任务找到合适的 Google 指南,例如托管、数据库、存储、登录或 AI 模型服务。
gcloud
22k帮你的智能体编写并检查 Google Cloud gcloud 命令,在运行任何内容之前查阅准确的语法,避免猜测参数。
google-cloud-recipe-auth
22k引导你的智能体了解 Google Cloud 的身份与访问管理,包括人员和服务如何登录,以及它们各自获得哪些权限。
google-cloud-recipe-onboarding
22k带领新开发者完成在 Google Cloud 上的第一步,包括选择项目、关联计费,以及部署第一个资源。