mirror of
https://github.com/mukul975/Anthropic-Cybersecurity-Skills.git
synced 2026-06-10 21:24:56 +03:00
3.0 KiB
3.0 KiB
Workflow Reference: IaC Security Scanning
IaC Scanning Pipeline
Terraform/IaC Code Change
│
▼
┌──────────────────┐
│ PR Created │
└──────┬───────────┘
│
├──────────────────────┐
▼ ▼
┌──────────────┐ ┌──────────────┐
│ Checkov │ │ tfsec │
│ (2500+ rules)│ │ (Terraform) │
└──────┬───────┘ └──────┬───────┘
│ │
└──────────┬─────────┘
▼
┌──────────────────┐
│ SARIF Upload │
│ to GitHub │
└──────┬───────────┘
│
▼
┌──────────────────┐
│ Quality Gate │
│ (Block on HIGH+) │
└──────┬───────────┘
│
┌─────────┴──────────┐
▼ ▼
PASS FAIL
terraform apply Block merge
permitted + Fix required
Checkov Command Reference
| Command | Purpose |
|---|---|
checkov -d ./terraform/ |
Scan directory |
checkov -f main.tf |
Scan single file |
checkov -f tfplan.json --framework terraform_plan |
Scan Terraform plan |
checkov --list |
List all available checks |
checkov -d . --check CKV_AWS_18 |
Run specific check |
checkov -d . --skip-check CKV_AWS_145 |
Skip specific check |
checkov -d . --bc-api-key KEY |
Upload to Bridgecrew |
checkov -d . --create-baseline |
Create baseline file |
checkov -d . --baseline BASELINE |
Scan against baseline |
checkov -d . --external-checks-dir ./custom/ |
Use custom checks |
checkov -d . --compact |
Compact output |
checkov -d . --output sarif |
SARIF format output |
Common Misconfigurations by Cloud Provider
AWS Top 10 IaC Misconfigurations
- S3 bucket public access enabled (CKV_AWS_18, CKV_AWS_20)
- Security group with open ingress 0.0.0.0/0 (CKV_AWS_23)
- RDS instance not encrypted (CKV_AWS_16)
- CloudTrail not enabled (CKV_AWS_35)
- EBS volume not encrypted (CKV_AWS_3)
- IAM policy with wildcard actions (CKV_AWS_1)
- ALB not using HTTPS (CKV_AWS_2)
- CloudWatch logs not encrypted (CKV_AWS_24)
- IMDSv2 not required (CKV_AWS_79)
- VPC flow logs not enabled (CKV_AWS_9)
Kubernetes Top Misconfigurations
- Container running as root (CKV_K8S_6)
- Privileged container (CKV_K8S_16)
- No resource limits (CKV_K8S_11, CKV_K8S_13)
- No readiness/liveness probes (CKV_K8S_9)
- hostNetwork enabled (CKV_K8S_19)