Use for any question or task about scanning infrastructure code for misconfigurations with one tool, including Kubernetes manifests, Terraform, CloudFormation, Helm, ARM and Dockerfiles that run as root, or migrating off tfsec: trivy config with severity gating, .trivyignore suppressions, custom Rego checks and SARIF for GitHub code scanning. Legacy tfsec is in its references.
89%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
# .tfsec/custom_checks.yml
checks:
- code: CUS001
description: Ensure all EC2 instances have a cost_center tag
impact: Untagged resources cannot be allocated to cost centers
resolution: Add a cost_center tag
requiredTypes:
- resource
requiredLabels:
- aws_instance
severity: HIGH
matchSpec:
name: tags
action: contains
value: cost_center
errorMessage: EC2 instance is missing cost_center tagjobs:
tfsec:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: aquasecurity/tfsec-action@v1.0.3
with:
additional_args: --minimum-severity HIGH
format: sarif
output_file_path: tfsec.sarif
- uses: github/codeql-action/upload-sarif@v3
if: always()
with:
sarif_file: tfsec.sarif