| name | infrastructure-scanning |
| description | Security scanning for Docker images, Terraform, K8s manifests, and Python deps using Trivy, Checkov, and Semgrep on AWS infrastructure |
| triggers | ["infrastructure scan","security scan","trivy","checkov","vulnerability scan","iac security"] |
Infrastructure Scanning
Comprehensive security scanning for containerized Python services on AWS. Combines Trivy (vulnerabilities), Checkov (IaC misconfigurations), and Semgrep (code patterns).
Quick Commands
trivy fs --scanners vuln,secret,misconfig --severity HIGH,CRITICAL .
trivy image --severity HIGH,CRITICAL jarvis-fresh:latest
trivy config terraform/ --severity HIGH,CRITICAL
checkov -d terraform/ --framework terraform --check HIGH
trivy config k8s/ --severity HIGH,CRITICAL
checkov -d k8s/ --framework kubernetes
trivy fs --scanners vuln --severity HIGH,CRITICAL requirements.txt
pip-audit --strict --desc
Trivy Configuration
severity:
- HIGH
- CRITICAL
scanners:
- vuln
- secret
- misconfig
ignorefile: .trivyignore
cache-dir: /tmp/trivy-cache
Checkov Configuration
framework:
- terraform
- kubernetes
- dockerfile
soft-fail: false
skip-check:
- CKV_AWS_18
- CKV_AWS_145
CI Integration
- name: Trivy vulnerability scan
uses: aquasecurity/trivy-action@master
with:
scan-type: fs
severity: HIGH,CRITICAL
exit-code: 1
- name: Checkov IaC scan
uses: bridgecrewio/checkov-action@master
with:
directory: terraform/
soft_fail: false
AWS-Specific Checks
Priority checks for AWS infrastructure:
- S3 bucket policies (public access, encryption)
- IAM policies (overly permissive, wildcard actions)
- Security groups (open ports, 0.0.0.0/0)
- RDS (encryption at rest, public accessibility)
- EKS (public endpoint, logging, secrets encryption)
- Lambda (VPC config, IAM role scope)
Remediation Workflow
- Run scan:
just security or trivy fs .
- Review findings grouped by severity
- Fix CRITICAL first, then HIGH
- Re-scan to verify fixes
- Add false positives to
.trivyignore with justification comment
- Commit fixes with
fix(security): remediate [CVE-ID]