How do you skip a Checkov check with a documented reason?
IntermediateHands-onCheckov
Answer
Short answer
Add an inline skip comment in the resource — #checkov:skip=<CHECK_ID>:<reason> — so the exception lives next to the code and is reviewed in the PR. For broader exclusions use --skip-check or a config file, but inline skips with reasons are the most transparent.
Terraform example
resource "aws_s3_bucket" "website" {
#checkov:skip=CKV_AWS_18:Access logs not needed for public static marketing site (SEC-210)
#checkov:skip=CKV2_AWS_6:Bucket is intentionally public behind CloudFront (SEC-210)
bucket = "shop-marketing-site"
}
Kubernetes example (annotation)
metadata:
annotations:
checkov.io/skip1: CKV_K8S_16=Node exporter needs privileged access to host metrics
CLI / config file
checkov -d . --skip-check CKV_AWS_18,CKV_K8S_14
# .checkov.yaml
skip-check:
- CKV_AWS_18
framework: [terraform, kubernetes]
soft-fail-on: [LOW]
Governance
- A reason and ticket on every skip.
- Skips are reviewed (CODEOWNERS for security-sensitive paths).
- Checkov reports skipped checks separately — track them.
What to say in the interview
"Inline #checkov:skip with the check ID and a reason, or a skip annotation in Kubernetes manifests, so exceptions are visible and reviewed in the PR. Global --skip-check is reserved for checks we've decided don't apply at all."
More on Checkov
What is Checkov and how do you scan Terraform with it?BeginnerWhat is IaC security scanning and why is it needed?BeginnerWhat is Checkov?BeginnerHow do you scan Terraform code with Checkov?BeginnerWhy scan the Terraform plan with Checkov instead of only the .tf files?IntermediateHow do you scan Kubernetes manifests and Dockerfiles with Checkov?Beginner