AI 에이전트의 지연, 오류, 토큰 사용량, 안전성, 보안, 응답 품질을 감시하는 Terraform 알림 파일을 만듭니다. 원격 측정 데이터와 기존 정책을 먼저 확인하고 설정을 검증하며, 품질 알림에는 Vertex AI가 필요합니다.
- 에이전트 지연과 오류율 모니터링
- 토큰 사용량 급증 알림
- 안전성 신호와 권한 거부 추적
Google Cloud Armor WAF 규칙을 OWASP CRS 3.0 또는 3.3에서 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 upgrades and smooth preview mode deployments with priority spacing and a 200-rule quota guardrail. Use when a user or agent needs to audit, upgrade, or transition Cloud Armor WAF rules to CRS 4.22. Don't use for non-WAF Cloud Armor rules (IP rate-limiting, geo-blocking, reCAPTCHA) or AWS/Azure WAF migrations.
실행 점수 미검증
설치 방법 보기이 스킬은 Google Cloud Armor 웹 애플리케이션 방화벽(WAF)에서 OWASP CRS 3.0 또는 3.3을 사용하는 규칙을 살펴보고 CRS 4.22용으로 변환합니다. 규칙 집합 이름, 표현식, 서명 ID, preconfiguredWafConfig 제외 항목을 갱신하고 폐기된 서명을 제거합니다. 규칙별 영향을 높음, 중간, 낮음으로 분류하며 서명 적용 범위 확대와 HTTP 메서드 처리 같은 운영상 주의점도 안내합니다. 함께 제공되는 Python CLI로 정책 JSON을 처리해 보고서나 gcloud 명령을 만들 수 있습니다. 기존 규칙을 바로 교체하거나 미리보기 규칙을 추가해 로그를 확인한 뒤 적용할 수 있습니다.
이전 CRS 규칙이 남아 있는 정책을 점검하고 마이그레이션 전에 예상되는 영향을 파악할 때 유용합니다. 규칙을 적용하기 전에 미리보기 결과를 로그로 확인하려는 경우에도 사용할 수 있습니다. IP 제한이나 속도 제한처럼 WAF 이외의 Cloud Armor 규칙을 마이그레이션하는 용도는 아닙니다.
실제 정책을 조회하거나 변경하려면 Google Cloud CLI, 설정과 인증이 완료된 대상 프로젝트, Compute Engine API가 필요합니다. 읽기 전용 감사에는 roles/compute.securityViewer, 변경에는 roles/compute.securityAdmin이 필요합니다. 미리보기 로그 확인에는 Cloud Logging API와 roles/logging.viewer가 필요합니다. CRS 4.22의 Method Enforcement는 PUT, PATCH, DELETE를 차단하므로 적용 전에 영향을 확인해야 합니다.
이 소개문은 공개된 SKILL.md를 바탕으로 AI(OpenAI Codex)가 작성했습니다. 정확한 사양은 아래 원문을 확인하세요.
AI가 SKILL.md의 내용에서 주의가 필요한 작업과 도입 전제를 확인했습니다. 점수는 실제로 실행한 결과(실행 검증)만으로 매깁니다.
점수에는 넣지 않았습니다. 2026년 10월 28일 기준으로 AI(OpenAI Codex)가 판정했습니다. 참고용이므로 설치 전에 원문도 확인해 주세요.
설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.
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.
MUST READ: Before executing any gcloud, REST API, or MCP command, you
MUST read and follow the instructions in
Usage Attribution.
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.com
Authentication:
gcloud auth logingcloud auth application-default loginGOOGLE_APPLICATION_CREDENTIALS="/path/to/service-account-key.json".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.Scope and Regional Availability:
--region=us-central1;
set a default region via gcloud config set compute/region us-central1).
See Google Cloud Locations
for regional availability.Pricing and Resource Cleanup:
--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.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.
[!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, zero extra quota) and Preview Mode (preview rules deployed at lower numeric priority numbers with
preview = true, zero risk of blocking traffic, allows telemetry inspection in Cloud Logging before cutover). 2. Handling Policy Audit Inquiries: When asked to audit or inspect a policy (such as'ecommerce-waf'), if policy JSON is not provided orgcloud describecannot reach Google Cloud resources, immediately provide thegcloud compute security-policies describe POLICY_NAME --format=jsoncommand and guide the user through the audit checks: - Check for legacy OWASP 3.0 / 3.3 rulesets (sqli-stable,xss-stable,rce-stable,methodenforcement-stable, orevaluatePreconfiguredExpr). - Report in-scope WAF rules versus pass-through custom rules (such as IP allowlistsSRC_IPS_V1, rate limiting, or default rulespriority: 2147483647). - Highlight signature count expansions under CRS 4.22 (for example, RCE expanding from 11/15 to 44 signatures; SQLi expanding to 60 signatures).
When interacting with a customer to upgrade a Cloud Armor security policy, execute this 5-step workflow:
preconfiguredWafConfig exclusions to CRS 4.22.gcloud and verify telemetry
in Cloud Logging.Identify the target security policy name and Google Cloud project.
Fetch the current policy definition via gcloud:
gcloud compute security-policies describe POLICY_NAME --project=PROJECT_ID --format="json"
If policy JSON is not provided or executing in conversational mode, provide
the gcloud describe command and outline the audit criteria below.
Inspect the rules list:
evaluatePreconfiguredWaf or
evaluatePreconfiguredExpr using legacy 3.0 / 3.3 rulesets
(sqli-stable, xss-stable, rce-stable, methodenforcement-stable,
etc.).SRC_IPS_V1, rate limiting, header matches without WAF
calls, or default rules priority: 2147483647). Pass these through
unchanged.Evaluate each in-scope rule against standard operational risk categories:
| Risk Level | Impact Category | Criteria and Recommended Action |
|---|---|---|
| 🔴 High Risk | Breaking Change | Immediate risk of blocking |
| : : : legitimate production traffic : | ||
| : : : upon cutover. Example: : | ||
: : : methodenforcement-v422-stable : | ||
: : : only permits GET, HEAD, : | ||
: : : POST, OPTIONS, and **blocks : | ||
: : : PUT, PATCH, DELETE** : | ||
| : : : requests. Requires customer : | ||
| : : : confirmation and API : | ||
| : : : path/signature exemptions. : | ||
| 🟡 Medium Risk | Attention Required | Behavioral shifts that should |
| : : : be validated in Preview Mode : | ||
| : : : before enforcement:<br>• : | ||
| : : : Coverage Expansion: : | ||
| : : : Sensitivity level 4 activates : | ||
| : : : significantly more signatures : | ||
| : : : (for example, RCE expands from : | ||
| : : : 11/15 to 44 signatures; SQLi : | ||
| : : : expands to 60 signatures).<br>• : | ||
| : : : Deprecated Exemption Lost: : | ||
| : : : Legacy rule opted out of any of : | ||
| : : : the 15 retired CRS 3.0/3.3 IDs : | ||
: : : (981172, 981173, 980130, : | ||
: : : 949110; SQLi: 942110; : | ||
: : : RCE: 932100, 932105, : | ||
: : : 932106, 932110, 932115, : | ||
: : : 932150; Scanner Detection: : | ||
: : : 913101, 913102, 913110, : | ||
: : : 913120), which are omitted in : | ||
| : : : 4.22.<br>• **Custom Filter : | ||
| : : : Continuity**: Preserved custom : | ||
| : : : header/cookie/query/IP : | ||
| : : : conditions combined with WAF : | ||
| : : : calls. : | ||
| 🟢 Low Risk | Clean Upgrade | Direct 1:1 ruleset translation |
| : : : with preserved active opt-outs : | ||
| : : : and no expected behavioral : | ||
| : : : divergence (for example, : | ||
| : : : standard SQLi or XSS rules). : | ||
| ⚪ No Action | Pass-Through | Non-OWASP rules (pure IP |
| : : : allowlist/denylist, rate : | ||
| : : : limiting, default rule). : | ||
| : : : Carried over unchanged. : |
Engage the customer with findings before applying changes:
methodenforcement is present, warn: >
"Notice: Method Enforcement in CRS 4.22 permits only GET, HEAD, POST, and
OPTIONS. If your application handles REST API updates (PUT, PATCH, DELETE),
these methods will be blocked with HTTP 403. Would you like to add an
exemption for API paths or opt out of rule id911100?"preview = true at a lower numeric priority number (higher
evaluation priority, for example, PRIORITY - 5). Traffic is evaluated
first by preview rules and logged to Cloud Logging without blocking,
ensuring zero risk of downtime or false positives prior to cutover.
Requires sufficient quota under the 200-rule limit.preconfiguredWafConfig on existing rule priority numbers in-situ.
Immediate enforcement with zero additional rule overhead, but carries
cutover risk if new signatures or method enforcement block valid
traffic.current_total_rules + in_scope_waf_rules.PRIORITY immediately follows another rule
at PREV_PRIORITY with no free integer priority slot between them
(for example, 999 and 1000, or a WAF rule at priority 0), alert
the customer: > "Rule PRIORITY cannot be deployed in Preview Mode
because the preceding rule at priority PREV_PRIORITY leaves no open
priority number between PREV_PRIORITY and PRIORITY (and placing the
preview rule above PREV_PRIORITY would change evaluation order). To use
Preview Mode, please readjust your rule priorities to leave at least one
open priority slot before PRIORITY, or choose an In-Place Upgrade."Translate legacy ruleset names according to the mapping table in ruleset_mappings.md:
sqli-stable to sqli-v422-stable, rce-stable to
rce-v422-stablesqli-canary to sqli-v422-canarysqli-v33-stable to sqli-v422-stable, nodejs-v33-stable
to generic-v422-stableLegacy evaluatePreconfiguredExpr(ruleset, ['id1', 'id2']) is strictly an
opt-out (disabled) list.
Convert to native 4.22 syntax:
evaluatePreconfiguredWaf('sqli-v422-stable', {'opt_out_rule_ids': ['owasp-crs-v042200-id942120-sqli']})
Remap signature IDs: owasp-crs-v030001-idSIGNATURE_ID-GROUP to
owasp-crs-v042200-idSIGNATURE_ID-GROUP. (Exception: Standalone CVE
signatures such as cve-canary signatures owasp-crs-v030001-id*-cve and
google-mrs-* retain their original IDs and must not be remapped to
v042200 or dropped).
Drop all 15 deprecated CRS 3.0/3.3 signature numbers (981172, 981173,
980130, 949110; SQLi: 942110; RCE: 932100, 932105, 932106,
932110, 932115, 932150; Scanner Detection: 913101, 913102,
913110, 913120).
preconfiguredWafConfig)For rules with structured preconfiguredWafConfig.exclusions[]:
targetRuleSet to the CRS 4.22 equivalent.targetRuleIds to v042200 and drop deprecated IDs. Warning: If
an exclusion's targetRuleIds list becomes empty ([]) after dropping
retired IDs, remove the entire exclusion entry rather than leaving
targetRuleIds: [] (otherwise an empty targetRuleIds list exempts the
entire ruleset).requestHeadersToExclude,
requestCookiesToExclude, requestQueryParamsToExclude,
requestUrisToExclude, requestBodiesToExclude) and match operators
without modification.Execute gcloud compute security-policies rules update:
gcloud compute security-policies rules update PRIORITY \
--security-policy="POLICY_NAME" \
--project=PROJECT_ID \
--expression="UPGRADED_EXPRESSION"
Deploy preview rules at a numeric priority strictly between the immediately
preceding rule and ENFORCED_PRIORITY (PREV_PRIORITY < PREVIEW_PRIORITY < ENFORCED_PRIORITY) using rules create:
gcloud compute security-policies rules create PREVIEW_PRIORITY \
--security-policy="POLICY_NAME" \
--project=PROJECT_ID \
--expression="UPGRADED_EXPRESSION" \
--action="ACTION" \
--preview \
--description="PREVIEW: Upgraded CRS 4.22 Rule for Priority ENFORCED_PRIORITY"
Instruct the customer to inspect preview logs before cutover:
gcloud logging read '
resource.type="http_load_balancer" AND
jsonPayload.enforcedSecurityPolicy.name="POLICY_NAME" AND
jsonPayload.previewSecurityPolicy.matchedRulePriority:*
' --project=PROJECT_ID --limit=20
evaluatePreconfiguredExpr is NEVER Opt-In: The array in legacy
evaluatePreconfiguredExpr was strictly an exclusion (opt-out) list.
Treating it as opt-in would inadvertently disable all other signatures in
that ruleset!981172, 981173, 980130, 949110; SQLi: 942110;
RCE: 932100, 932105, 932106, 932110, 932115, 932150; Scanner
Detection: 913101, 913102, 913110, 913120) were removed in CRS 4.22.
Keeping them in opt_out_rule_ids or targetRuleIds causes Cloud Armor API
schema rejections.PUT,
PATCH, and DELETE. Never perform a silent in-place upgrade of method
enforcement without user confirmation.0 to 2147483647). A preview rule must
evaluate before the enforcing rule it previews, but after any preceding
rule (PREV_PRIORITY < PREVIEW_PRIORITY < ENFORCED_PRIORITY) so it never
crosses intervening allow or custom rules. During cutover to full
enforcement, update the original ENFORCED_PRIORITY rule in-place to CRS
4.22 and delete PREVIEW_PRIORITY rather than promoting PREVIEW_PRIORITY
in place.preconfiguredWafConfig blocks, prefer exporting the policy JSON,
transforming it, and applying it via gcloud compute security-policies import to ensure atomic updates.cve-canary): cve-canary is an
out-of-band rule for specific vulnerabilities (for example, Log4j
CVE-2021-44228 / CVE-2021-45046, React RCE CVE-2025-55182). Its signature
IDs (owasp-crs-v030001-id044228-cve, id144228-cve, id244228-cve,
id344228-cve) are valid and retain the v030001 prefix. Only upgrade the
syntax to evaluatePreconfiguredWaf('cve-canary', ...); never rewrite them
to v042200 or drop them as deprecated.preconfiguredWafConfig exclusions, and method
enforcement mitigations.gcloud
recipes for audit, preview mode, and Cloud Logging queries.아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.
로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.
아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.
AI 에이전트의 지연, 오류, 토큰 사용량, 안전성, 보안, 응답 품질을 감시하는 Terraform 알림 파일을 만듭니다. 원격 측정 데이터와 기존 정책을 먼저 확인하고 설정을 검증하며, 품질 알림에는 Vertex AI가 필요합니다.
Model Garden 모델을 Agent Platform 엔드포인트에 배포하도록 돕습니다. 지원 하드웨어와 시간당 예상 비용을 확인하고, 배포 진행 상황과 추론 테스트를 살핀 뒤 사용을 마치면 모델과 엔드포인트를 정리할 수 있습니다.
Agent Platform에서 온라인 모델 예측 요청을 받는 엔드포인트를 관리합니다. 목록과 설정을 확인하고 생성·수정·삭제하며, 권한 오류와 할당량 초과, 리소스 처리 중 오류도 조사합니다.
Google Cloud에서 AI 모델과 에이전트를 평가하고 테스트 데이터를 구성하며 채점 지표를 선택합니다. 모의 사용자 시나리오 생성, 실패 분석, 수정 전후 결과 비교로 프롬프트와 코드를 개선할 근거를 마련합니다.
Call Gemini and OpenMaaS models such as Llama, DeepSeek, and Qwen through Google Cloud Agent Platform. Prepare authentication and SDK code, run prompts, configure connection endpoints, and troubleshoot common request errors.
한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.
Google AI Studio의 Gemini API를 Google Cloud의 Gemini Enterprise Agent Platform으로 옮기는 절차를 안내합니다. 결제, 권한, 인증 설정과 SDK 및 지원되는 에이전트 도구의 연결 변경을 다룹니다.