iac-container-security-testing
Skill1 starsChanged 53 days agoMITView on GitHub
Use when testing Infrastructure-as-Code and container configuration — Terraform/CloudFormation/Helm/Kubernetes scanning (Checkov, tfsec, KICS, kube-linter), policy-as-code (OPA/Conftest/Kyverno), Dockerfile lint (hadolint), image scanning (Trivy), CIS benchmarks, and drift detection.
In this repository98 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- 42crunch-api-security-testingSkill
- a-b-testingSkill
- acceptance-testingSkill
- accessibility-testingSkill
- ai-agent-evaluationSkill
- ai-code-securitySkill
- ai-ml-testingSkill
- analytics-tracking-testingSkill
- api-testingSkill
- authn-authz-testingSkill
- autonomous-qa-orchestrationSkill
- bdd-gherkin-testingSkill
- blockchain-smart-contract-testingSkill
- bug-reportingSkill
- chaos-resilience-testingSkill
- chatbot-voice-agent-testingSkill
- cicd-testingSkill
- cli-testingSkill
- cloud-infrastructure-testingSkill
- code-coverage-analysisSkill
- compatibility-testingSkill
- compliance-testingSkill
- concurrency-race-condition-testingSkill
- configuration-feature-flag-testingSkill
- contract-testingSkill
- cross-browser-testingSkill
- database-testingSkill
- data-migration-testingSkill
- data-pipeline-etl-testingSkill
- date-time-timezone-testingSkill
- desktop-app-testingSkill
- disaster-recovery-backup-testingSkill
- e2e-testingSkill
- email-notification-testingSkill
- event-driven-messaging-testingSkill
- exploratory-testingSkill
- flaky-test-managementSkill
- functional-testingSkill
- fuzz-testingSkill
- game-testingSkill
- graphql-testingSkill
- installation-upgrade-testingSkill
- integration-testingSkill
- iot-embedded-testingSkill
- llm-security-auditSkill
- llm-testingSkill
- localization-testingSkill
- manual-testingSkill
- mcp-testingSkill
- memory-leak-resource-testingSkill
- microservices-testingSkill
- mobile-testingSkill
- mutation-testingSkill
- observability-testingSkill
- payment-ecommerce-testingSkill
- performance-testingSkill
- production-monitoring-synthetic-testingSkill
- property-based-testingSkill
- The first 60 shown.
The file
Files
IaC & Container Configuration Testing
Misconfiguration is a leading cause of cloud incidents. Shift it left: test infrastructure definitions like code, before they are applied.
Pipeline: lint → scan → policy → plan-test → runtime
terraform fmt -check && terraform validate && tflint
checkov -d . --framework terraform,kubernetes,dockerfile,helm
trivy config --severity HIGH,CRITICAL .
terraform plan -out tf.plan && terraform show -json tf.plan > plan.json
conftest test plan.json -p policy/ # OPA/Rego on the plan
helm template chart | kubeconform -strict - # schema validation
kube-linter lint k8s/ ; kubescape scan framework nsa k8s/
hadolint Dockerfile
trivy image --severity HIGH,CRITICAL --ignore-unfixed --exit-code 1 myapp:1.2.3Checklist by layer
| Layer | Verify |
| Cloud IAM | No wildcard actions/principals, root protected with MFA, roles over users, short-lived credentials |
| Network | No world-open admin/DB ports, data in private subnets, restricted egress, TLS everywhere |
| Storage & DB | Encryption at rest, public access blocked, versioning, backups (disaster-recovery-backup-testing), access logging |
| Secrets | Not in Terraform variables/state/env in plain text; secret manager in use; state backend encrypted and locked |
| Logging | Audit logs enabled, immutable, alerting on IAM/root changes |
| Kubernetes | Non-root, readOnlyRootFilesystem, allowPrivilegeEscalation: false, drop capabilities, no privileged/hostPath/hostNetwork, resource limits, default-deny NetworkPolicy, Pod Security restricted, least-privilege RBAC |
| Images | Minimal/distroless base, pinned digest, non-root USER, no secrets in layers, multi-stage build, SBOM + signature (supply-chain-dependency-testing) |
| Dockerfile | No latest, COPY over ADD, HEALTHCHECK, no sudo/ssh |
Policy-as-code example (Rego)
package terraform.s3
deny[msg] {
r := input.resource_changes[_]
r.type == "aws_s3_bucket_public_access_block"
r.change.after.block_public_acls == false
msg := sprintf("%s must block public ACLs", [r.address])
}Enforce the same rules at admission with Kyverno or Gatekeeper (require-non-root, disallow-latest-tag, require-resource-limits). Test the policies too: opa test policy/ -v, kyverno test ..
Test infrastructure behaviour, not just config
Terratest, terraform test or Pulumi tests: create ephemeral infra, assert outputs and reachability, destroy. Add drift detection (terraform plan -detailed-exitcode nightly) and idempotency (second apply = no changes).
Triage
Suppress only with an inline reason, owner and expiry (#checkov:skip=CKV_AWS_18:reason). Prioritise internet-exposed, data-bearing, privileged resources.
Related
cloud-infrastructure-testing, supply-chain-dependency-testing, security-hardening, compliance-testing, configuration-feature-flag-testing
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

