Chuyển đến nội dung
Skillpedia
Bảo mật22k · #10233

cloud-armor-crs-rule-upgrader

Skill này làm gì

Skill này giúp cập nhật các quy tắc bảo mật web trong Google Cloud Armor lên phiên bản mới hơn. Skill dành cho các đội bảo mật đang chạy bộ quy tắc OWASP cũ và muốn nâng cấp an toàn.

Khi nào nên dùng

  • ✓Khi bạn cần chuyển chính sách Cloud Armor từ OWASP CRS 3.0 hoặc 3.3 lên phiên bản 4.22.
  • ✓Khi bạn muốn rà soát rủi ro vận hành khi thay đổi quy tắc Cloud Armor trước khi nâng cấp.
  • ✓Khi quy tắc Cloud Armor của bạn dùng cấu hình WAF dựng sẵn cũ hoặc ngoại lệ cần cập nhật.

Liên kết skill

https://github.com/google/skills/blob/main/skills/cloud/cloud-armor-crs-rule-upgrader/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/google/skills/blob/main/skills/cloud/cloud-armor-crs-rule-upgrader/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Nâng cấp chính sách Cloud Armor của tôi từ quy tắc OWASP 3.3 lên 4.22, và cho tôi biết điều gì có thể hỏng.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Skill kiểm tra chính sách hiện tại, giữ nguyên danh sách opt-in và opt-out của bạn, rồi viết lại các quy tắc theo phiên bản mới. Skill cũng đánh giá mức rủi ro vận hành của từng thay đổi.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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:

  1. Google Cloud SDK: Install or update the Google Cloud CLI (gcloud).

  2. 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)"
    
  3. 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.com
    
  4. Authentication:

    • 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".
  5. Required IAM Roles:

    • roles/compute.securityAdmin: Required to create, update, delete, or import Cloud Armor security policies and rules (use roles/compute.securityViewer for read-only policy audits).
    • roles/logging.viewer: Required to inspect HTTP load balancer preview telemetry in Cloud Logging.
  6. 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 via gcloud config set compute/region us-central1). See Google Cloud Locations for regional availability.
  7. 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 --preview rules (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

Câu hỏi thường gặp

Các ngoại lệ tùy chỉnh của tôi có được giữ lại không?

Có. Skill giữ danh sách opt-in và opt-out cho chữ ký và cập nhật ngoại lệ cho phiên bản mới.

Tôi có thể kiểm tra quy tắc trước khi áp dụng không?

Có. Skill xem dữ liệu đo lường ở chế độ preview, để bạn thấy tác động trước khi áp dụng quy tắc.

Skill nâng cấp được từ những phiên bản nào?

Từ OWASP CRS 3.0 và 3.3 lên OWASP CRS 4.22.

Chi tiết

Mô tả gốc của tác giả

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

Độ phổ biến

Sao GitHub
22k
Vị trí xếp hạng
#10233
Giấy phép
Apache-2.0
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự