infrastructure-scanning
Security scanning for Docker images, Terraform, K8s manifests, and Python deps using Trivy, Checkov, and Semgrep on AWS infrastructure
Works with
---
name: infrastructure-scanning
description: Security scanning for Docker images, Terraform, K8s manifests, and Python deps using Trivy, Checkov, and Semgrep on AWS infrastructure
license: MIT
---
# Infrastructure Scanning
Comprehensive security scanning for containerized Python services on AWS. Combines Trivy (vulnerabilities), Checkov (IaC misconfigurations), and Semgrep (code patterns).
## Quick Commands
```bash
# Full infrastructure scan
trivy fs --scanners vuln,secret,misconfig --severity HIGH,CRITICAL .
# Docker image scan
trivy image --severity HIGH,CRITICAL coremind-fresh:latest
# Terraform scan
trivy config terraform/ --severity HIGH,CRITICAL
checkov -d terraform/ --framework terraform --check HIGH
# Kubernetes manifests
trivy config k8s/ --severity HIGH,CRITICAL
checkov -d k8s/ --framework kubernetes
# Python dependency audit
trivy fs --scanners vuln --severity HIGH,CRITICAL requirements.txt
pip-audit --strict --desc
```
## Trivy Configuration
```yaml
# .trivy.yaml
severity:
- HIGH
- CRITICAL
scanners:
- vuln
- secret
- misconfig
ignorefile: .trivyignore
cache-dir: /tmp/trivy-cache
```
## Checkov Configuration
```yaml
# .checkov.yaml
framework:
- terraform
- kubernetes
- dockerfile
soft-fail: false
skip-check:
- CKV_AWS_18 # S3 access logging (dev environments)
- CKV_AWS_145 # RDS encryption (handled separately)
```
## CI Integration
```yaml
# In GitHub Actions
- 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
1. Run scan: `just security` or `trivy fs .`
2. Review findings grouped by severity
3. Fix CRITICAL first, then HIGH
4. Re-scan to verify fixes
5. Add false positives to `.trivyignore` with justification comment
6. Commit fixes with `fix(security): remediate [CVE-ID]`More DevOps & Infrastructure skills
azure-ai
microsoft/azure-skills
Use for Azure AI: Search, Speech, OpenAI, Document Intelligence. Helps with search, vector/hybrid search, speech-to-text, text-to-speech, transcription, OCR. WHEN: AI Search, query search, vector search, hybrid search, semantic search, speech-to-text, text-to-speech, transcribe, OCR, convert text to speech.
appinsights-instrumentation
microsoft/azure-skills
Guidance for instrumenting webapps with Azure Application Insights. Provides telemetry patterns, SDK setup, and configuration references. WHEN: how to instrument app, App Insights SDK, telemetry patterns, what is App Insights, Application Insights guidance, instrumentation examples, APM best practices.
azure-storage
microsoft/azure-skills
Azure Storage Services including Blob Storage, File Shares, Queue Storage, Table Storage, and Data Lake. Answers questions about storage access tiers (hot, cool, cold, archive), when to use each tier, and tier comparison. Provides object storage, SMB file shares, async messaging, NoSQL key-value, and big data analytics. Includes lifecycle management. USE FOR: blob storage, file shares, queue storage, table storage, data lake, upload files, download blobs, storage accounts, access tiers, storage tiers, hot cool cold archive, storage tier comparison, when to use storage tiers, lifecycle management, Azure Storage concepts. DO NOT USE FOR: SQL databases, Cosmos DB (use azure-prepare), messaging with Event Hubs or Service Bus (use azure-messaging).

