/security-scan
Data Collection
Secrets Detection: Scan source code for hardcoded credentials
- Patterns: AWS access keys (
AKIA[0-9A-Z]{16}), tokens, passwords in config files - Check:
.envfiles committed to git, private keys in repo - Tool:
Grepwith regex patterns +git logfor history
- Patterns: AWS access keys (
Dependency Vulnerabilities: Check known CVEs
- Node.js:
npm audit --jsonoryarn audit --json - Python:
pip audit --format=json - Go:
govulncheck ./... - General:
trivy fs --format json .(if available)
- Node.js:
Dockerfile Analysis: Check container security
- Running as root (no USER directive)
- Using
:latesttag instead of pinned versions - Secrets passed via ARG/ENV or COPY
- Missing multi-stage build (large attack surface)
IaC Misconfigurations: Terraform / CloudFormation
- S3 buckets with public access
- Security Groups with
0.0.0.0/0ingress - Unencrypted storage (EBS, RDS, S3)
- Missing logging/audit trail
Kubernetes RBAC: If K8s manifests present
- ClusterRoleBindings with
cluster-admin - Wildcard permissions in Roles
- ServiceAccounts with excessive permissions
- ClusterRoleBindings with
Security Checklist
- Secrets: No hardcoded credentials in source code
- Dependencies: No known critical/high CVEs
- Docker: Images don't run as root, multi-stage build used
- IaC: S3 not public, SGs without 0.0.0.0/0, encryption enabled
- RBAC: No unnecessary cluster-admin bindings
- TLS: Endpoints use HTTPS, certificates valid
- Logging: Audit trail enabled
- Secrets Mgmt: Using vault/external-secrets, not plain env vars
Output
- Risk Level: Critical / High / Medium / Low
- Findings: Categorized list by severity
- For each: file, line, description, remediation command
- OWASP Top 10: Which risks apply to this project
- Remediation: Specific command or change for each finding
- Compliance: Status vs frameworks (SOC2, HIPAA, PCI-DSS basics)