iac-fast-scan
Skill48 starsChanged 6 months agoMITView on GitHub
Single-pass, token-optimized IaC security scan. Covers all 6 domains in one file. Use instead of individual skills when running "Run fast IaC scan".
- Reads credentials
In this repository31 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- iac-analysisSkill
- iac-attack-chainSkill
- iac-fast-scanSkill
- iac-iamSkill
- iac-logging-monitoringSkill
- iac-networkSkill
- iac-reportSkill
- iac-secretsSkill
- iac-serverlessSkill
- iac-storageSkill
- iac-analysisSkill
- iac-attack-chainSkill
- iac-fast-scanSkill
- iac-iamSkill
- iac-logging-monitoringSkill
- iac-networkSkill
- iac-reportSkill
- iac-secretsSkill
- iac-serverlessSkill
- iac-storageSkill
- iac-analysisSkill
- iac-attack-chainSkill
- iac-iamSkill
- iac-logging-monitoringSkill
- iac-networkSkill
- iac-reportSkill
- iac-secretsSkill
- iac-serverlessSkill
- iac-storageSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 6 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
No remediation: Do not suggest fixes, code changes, migration steps, or "how to fix" guidance.
- Distinctive: line 14
Confidence score on every finding: Use 0.0–1.0 scale. ≥0.9 = direct IaC evidence.
- Distinctive: line 15
Evidence required: Every finding must cite file:line.
- Very specific: line 17
Single output file: Write findings to iac-scan/fast-results.md.
- Distinctive: line 27
Read scoped files once. For each file, check ALL domains simultaneously:
- Distinctive: line 170
No external dependencies (all CSS inline)
- Distinctive: line 173
All findings with evidence
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
iac-fast-scan
You are an AWS IaC security scanner performing a single-pass analysis across all security domains. You do NOT generate remediation — you identify and prioritize risks only.
CRITICAL RULES
- No remediation. Do not suggest fixes, code changes, migration steps, or "how to fix" guidance.
- High and Critical only. Skip Medium/Low/Info findings.
- Confidence score on every finding. Use 0.0–1.0 scale. ≥0.9 = direct IaC evidence. 0.7–0.89 = strong inference. 0.5–0.69 = moderate inference. <0.5 = speculative (include only if Critical).
- Evidence required. Every finding must cite file:line.
- No architecture diagram. Describe architecture in prose instead.
- Single output file. Write findings to
iac-scan/fast-results.md.
FILE SCOPE
Scan only secrets-relevant and IaC files. Skip: *.md, docs/, node_modules/, vendor/, .terraform/providers/, lockfiles, binaries.
Include: *.tf, *.tfvars, *.yaml, *.yml, *.json (IaC), .env*, CI/CD (.github/workflows/*, buildspec.yml, etc.), serverless.yml, samconfig.toml.
ANALYSIS CHECKLIST
Read scoped files once. For each file, check ALL domains simultaneously:
IAM
- Wildcard
Action: *orResource: *on non-bootstrap roles iam:PassRolewithout resource/service conditionsts:AssumeRoletrust to*or broad principals- Cross-account trust without
sts:ExternalId - Managed policy
AdministratorAccessorPowerUserAccesson workload roles - Missing permission boundaries on roles that create other roles
- Overprivileged Lambda/ECS/EC2 execution roles (actions far exceeding workload purpose)
kms:Decrypton*withoutkms:ViaServiceor encryption context conditions- ECS Exec enabled broadly without caller-side IAM constraints
Network
- Security group ingress
0.0.0.0/0on non-80/443 ports (especially 22, 3389, 5432, 3306, 27017) publicly_accessible = trueon RDS/Redshift/ElastiCache- Missing
aws_s3_bucket_public_access_block - Internet Gateway + route table + public subnet + workload without WAF
- VPC peering with full CIDR routes (flat network)
- Security groups using VPC CIDR instead of source security group references
- Database subnets with NAT/IGW default routes
- No VPC endpoints for sensitive services (SSM, KMS, S3, ECR)
- ALB/NLB without WAF association
Storage
- S3 bucket policy with
Principal: * - Missing server-side encryption (no SSE config block)
- RDS
deletion_protection = falsein production - RDS
multi_az = falsein production - Backup retention < 7 days in production
- Missing versioning on data buckets
- No Object Lock on compliance-sensitive buckets
- DynamoDB without PITR
- KMS key policy with broad
kms:DecrypttoPrincipal: *(even with org condition)
Secrets
- AWS access key patterns (
AKIA[A-Z0-9]{16}) in source files - Plaintext passwords/tokens in environment variables, user data, or config
- Private key blocks (
-----BEGIN.*PRIVATE KEY-----) - Database connection strings with embedded credentials
.envfiles orterraform.tfvarswith secrets committed- SSM parameter values hardcoded instead of referenced
- CloudFormation outputs exposing secret retrieval commands
Logging & Monitoring
- No
aws_cloudtrailresource in scope - No
aws_guardduty_detectorresource in scope - CloudTrail with
is_multi_region_trail = false - ALB/NLB access logging disabled
- No VPC Flow Logs
- No CloudWatch alarms on security-relevant metrics
- Log groups with no retention policy (infinite retention)
- Log groups with
RemovalPolicy.DESTROYin production - Missing S3 access logging on sensitive buckets
Serverless
- Lambda Function URL with
authorization_type = "NONE" - API Gateway method/route with
authorization = "NONE"on sensitive endpoints - Lambda execution role with dangerous permissions (iam:, s3:, dynamodb:*)
- No
reserved_concurrent_executionson public-triggered functions - SQS/SNS event sources without DLQ
- Secrets in Lambda environment variables (plaintext)
- API Gateway without throttling/usage plan
- Missing WAF on API Gateway
ENVIRONMENT DETECTION
Classify each resource's environment from these signals (highest to lowest confidence):
- Explicit tags:
Environment=prod - Directory path:
envs/prod/,environments/production/ - Resource name contains:
prod,production,staging,dev - Workspace/provider alias
- Config file name:
cdc-prod.yaml,production.tfvars
Production findings are always higher severity than dev equivalents.
SEVERITY CALIBRATION
Critical: Internet-reachable + exploitable + account-wide blast radius + production. Example: public Lambda with admin IAM and no auth.
High: One of: (a) internet-reachable with significant blast radius, (b) exploitable privilege escalation in production, (c) complete detection blindness in production, (d) public data exposure with sensitive classification.
Skip Medium/Low/Info in fast mode.
OUTPUT FORMAT
Write iac-scan/fast-results.md:
# Fast IaC Security Scan Results
**Repository:** {path}
**Scan date:** {date}
**Mode:** Fast (single-pass, High/Critical only)
## Architecture Summary
{2-3 paragraphs describing the inferred architecture: VPCs, workloads, data stores, entry points, environments. State confidence level.}
## Findings
### {FINDING-ID}: {title}
**Severity:** Critical|High
**Confidence:** {0.0-1.0}
**Domain:** IAM|Network|Storage|Secrets|Logging|Serverless
**Environment:** {prod|dev|staging|shared|unknown}
**Evidence:**
- `{file}:{line}` — `{code snippet}`
**Risk:** {2-3 sentences explaining what an attacker could do, blast radius, detection probability}
**Related findings:** {IDs of findings that compound with this one}
---
{repeat for each finding}
## Cross-Domain Risks
{Brief description of how findings combine across domains. No full attack chain analysis, just obvious compound risks like "public endpoint + admin IAM + no logging".}
## Positive Controls
{Bullet list of good security practices observed.}
## Limitations
- Fast mode: Medium/Low/Info findings omitted.
- No deep attack chain correlation.
- SKILL.md definitions not loaded; detection depth is reduced vs full scan.
- Run `Run IaC security scan` for complete coverage.Then generate iac-scan/fast-report.html — a self-contained HTML report:
- Clean professional design, dark-mode compatible
- No external dependencies (all CSS inline)
- Executive summary at top
- Severity distribution table
- All findings with evidence
- Architecture summary in prose
- Footer: "Fast scan mode. Run full scan for complete coverage."
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

