/viperclaw:viper-terraform-drift-policyfrom viperclaw
Audits Terraform/CloudFormation plans against OPA/Rego policies for compliance with CIS benchmarks, encryption defaults, state locking, and IAM guardrails.
Ships in viperclaw. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
viper-terraform-drift-policy)viper_iac_audit, viper_secrets_scan, viper_verify_and_reportviperclaw iac . && viperclaw secrets .flowchart LR
TF["Terraform / CloudFormation Plan JSON"] --> OPA["OPA / Conftest Rego Policies"] --> Gate["CI Plan Gate (Deny Public/Unencrypted)"] --> State["Encrypted Remote State + Drift Detection"]
Manual cloud console edits and unvalidated terraform apply runs introduce silent security drift—opening 0.0.0.0/0 ingress ports, disabling storage encryption, or leaving Terraform state files containing plaintext secrets accessible in shared buckets.
# 1. Automated ViperClaw IaC & secrets audit
viperclaw iac .
viperclaw secrets .
# 2. Rapid static pattern discovery
rg -n "(0\.0\.0\.0/0|public-read|encrypted\s*=\s*false|backend\s+\"s3\")" -g "*.tf"
| Control ID | Audit Verification Target | Pass Criteria | Fail / Vulnerability Indicator |
|---|---|---|---|
POL-01 | Encrypted Remote State with Locking | Terraform state uses encrypted S3/GCS backend (encrypt = true) with DynamoDB/native lock and blocked public access. | Local terraform.tfstate committed to Git or stored in an unencrypted bucket. |
POL-02 | Plan-Time Policy-as-Code Gate | CI evaluates terraform show -json tfplan against OPA/Rego or Checkov rules before apply. | Changes applied directly from developer laptops without plan review. |
POL-03 | Zero Unrestricted Management Ports | Policy denies 0.0.0.0/0 or ::/0 ingress on SSH (22), RDP (3389), and DB ports (5432, 3306, 6379). | Security group exposes administrative or database ports publicly. |
POL-04 | Mandatory Storage Encryption | EBS, RDS, S3, and GCS resources enforce KMS/CMEK encryption at rest by default. | storage_encrypted = false or default unencrypted volumes permitted. |
POL-05 | No Wildcard IAM Statements | Policy blocks "Action": "*" and "Resource": "*" on production roles. | Broad administrative IAM policies attached to workload roles. |
POL-06 | Sensitive Output & Variable Marking | Secrets in Terraform variables/outputs set sensitive = true and come from a secrets manager. | Plaintext passwords echoed in CI plan logs. |
POL-07 | Scheduled Drift Detection | Automated read-only terraform plan runs detect out-of-band console modifications. | Console hotfixes diverge permanently from version-controlled IaC. |
POL-08 | Pinned Module & Provider Versions | Registry modules and providers pin exact versions and .terraform.lock.hcl is committed. | Unpinned Git branches (ref=main) used for Terraform modules. |
0.0.0.0/0 ingress is intentionally restricted to public HTTPS load balancers (443) behind WAF.| Severity Tier | Baseline CVSS v3.1 Vector | Qualifying Security Impact |
|---|---|---|
| CRITICAL (9.1) | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N | Publicly readable Terraform state file or public S3 bucket containing production credentials. |
| HIGH (7.5) | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N | Unrestricted 0.0.0.0/0 database/SSH security group or wildcard IAM admin policy. |
| MEDIUM (5.3) | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N | Missing encryption at rest or unpinned third-party Terraform modules. |
# ✅ HARDENED: OPA/Conftest Rego policy blocking 0.0.0.0/0 on SSH/DB ports
package terraform.security
deny[msg] {
resource := input.resource_changes[_]
resource.type == "aws_security_group_rule"
ingress := resource.change.after
ingress.type == "ingress"
ingress.cidr_blocks[_] == "0.0.0.0/0"
ingress.from_port <= 22
ingress.to_port >= 22
msg := sprintf("Security group rule %s exposes SSH (22) to 0.0.0.0/0", [resource.address])
}
viperclaw iac . in CI on every IaC pull request..terraform.lock.hcl is committed and state buckets remain private.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub zahidoverflow/viperclaw --plugin viperclaw72 skills in this plugin
/viper-agent-skill-supplychainAI Agent Skill, Plugin & MCP Config Supply-Chain Auditor (modeled on NVIDIA SkillSpector & OWASP Agentic Skills Top 10). Audits SKILL.md bundles and MCP JSON configs./viper-ai-llm-guardrailsAI, LLM & MCP Application Security & Guardrails Auditor (OWASP LLM Top 10). Reviews prompt boundaries, RAG data isolation, tool-call authorization, and output sanitization./viper-api-gateway-apigee-kongAPI Gateway, BFF & Rate-Tier Policy Auditor (Kong, AWS API Gateway, Apigee, Envoy Gateway). Reviews JWT authorizers, backend origin lockdown, and route-level quotas.Other plugins' skills for the same job