checkov-policy
БесплатноБез исполняемых скриптовНе проверенUse for any question or task about Checkov or scanning infrastructure code (Terraform, CloudFormation, Kubernetes, Helm, ARM, Serverless, CDK) with the…
от testland★ 18 звёзд на GitHubОб этом скилле
checkov-policy
Overview
Per checkov-home, supported frameworks: Terraform and Terraform plan, CloudFormation, Kubernetes, Helm, ARM Templates, Serverless framework, AWS CDK. Checkov is the broadest IaC security scanner - covers more frameworks than tfsec (Terraform-only) or KICS (similar coverage but Checkov has more built-in checks per release).
When to use
- Team uses any of the supported IaC frameworks.
- Need security scanning for misconfigurations (open ports, unencrypted storage, overly broad IAM, etc.).
- Want one tool covering Terraform + Kubernetes + Dockerfile + CI pipelines.
How to use
- Install Checkov and pin the version in
requirements-dev.txtfor CI determinism (Step 1). - Run
checkov -d .locally, narrowing frameworks with--frameworkwhen the repo mixes IaC types (Step 2). - Emit SARIF for GitHub Code Scanning and JUnit for CI test reporting (Step 3).
- Triage findings - fix real issues, annotate intentional
exceptions with justified
checkov:skip=comments (Step 4). - Add custom Python or YAML checks for team-specific policy the built-in rules miss (Step 5).
- Create a
.checkov.baselineso CI fails only on new findings, then wire the scan into CI with SARIF upload (Steps 7-8). - Pair with tfsec / KICS and unify the reports for overlapping-but-non-identical coverage (Step 9).
Step 1 - Install
pip install checkov
checkov --version
Per project (recommended for CI determinism):
echo 'checkov==3.2.500' >> requirements-dev.txt
pip install -r requirements-dev.txt
Step 2 - Run
# Scan a directory
checkov -d .
# Scan a specific Terraform file
checkov -f main.tf
# Scan multiple frameworks
checkov -d . --framework terraform,kubernetes,dockerfile
# Scan a Terraform plan (deeper analysis)
terraform plan -out=plan.tfplan
terraform show -json plan.tfplan > plan.json
checkov -f plan.json
Step 3 - Output formats
# Default (CLI)
checkov -d .
# JSON for parsing
checkov -d . -o json
# SARIF for code-scanning dashboards (GitHub Code Scanning)
checkov -d . -o sarif --output-file-path checkov.sarif
# JUnit XML for CI test reporting
checkov -d . -o junitxml > checkov.xml
# Multiple
checkov -d . -o cli -o sarif
Step 4 - Skip checks
# Skip specific checks
checkov -d . --skip-check CKV_AWS_18,CKV_AWS_20
# Skip a check class
checkov -d . --skip-check CKV_AWS_*
In code:
# main.tf
resource "aws_s3_bucket" "logs" {
bucket = "my-logs"
# checkov:skip=CKV_AWS_20:Public read access intentional for log distribution
}
The :skip= annotation requires a justification - reviewable in
PRs.
Step 5 - Custom Python checks
Author custom Python checks (and the no-code YAML-policy alternative) for team-specific rules the built-in set misses: references/custom-checks-and-ci.md.
Step 6 - Soft fail / hard fail
# Default: any failed check exits non-zero (CI fails)
checkov -d .
# Soft fail: log issues but exit 0 (informational)
checkov -d . --soft-fail
# Soft fail only on specific checks
checkov -d . --soft-fail-on CKV_AWS_*
Pattern: hard fail on critical / new findings; soft fail on legacy issues being ratcheted down.
Step 7 - Baseline comparison
# Generate baseline (current state of findings)
checkov -d . --create-baseline
# Use baseline (fail only on NEW findings vs baseline)
checkov -d . --baseline .checkov.baseline
Baselines let teams adopt Checkov against legacy code without fixing all existing issues at once - only new findings break the build.
Step 8 - CI integration
Wire the scan into CI with a baseline plus SARIF upload to GitHub Code Scanning (findings surface as PR comments + the Security tab): references/custom-checks-and-ci.md.
Step 9 - Combine with other scanners
Checkov + tfsec + KICS catch overlapping but non-identical issues. Combine results to a unified verdict.
checkov -d . -o json > checkov.json
tfsec . -f json > tfsec.json
kics scan -p . --report-formats json -o ./kics-results
# Combine the three reports into a unified verdict
Worked example
A team adopts Checkov on a legacy Terraform + Kubernetes monorepo.
pip install checkov==3.2.500, pinned inrequirements-dev.txt.- First run
checkov -d . --framework terraform,kubernetesreports a large backlog of existing failures - too many to fix at once. - They capture the current state:
checkov -d . --create-baselinewrites.checkov.baseline. - CI runs
checkov -d . --baseline .checkov.baseline -o sarif --output-file-path checkov.sarif; the build passes because no findings are new versus the baseline. - A PR adds an
aws_s3_bucketwithacl = "public-read". Checkov flagsCKV_AWS_20as a NEW finding and fails the build. - The author drops public-read (or adds a justified `checkov:skip=CKV
Установить checkov-policy в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл checkov-policy?
Use for any question or task about Checkov or scanning infrastructure code (Terraform, CloudFormation, Kubernetes, Helm, ARM, Serverless, CDK) with the broadest built-in rule set, including custom security checks written in Python: SARIF and JUnit output, and a baseline so CI fails only on new findings. Single-tool option: trivy-config.
Как установить скилл checkov-policy?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл checkov-policy запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic