mcpField
I
infra-security-review

infra-security-review

github.com/majesticlabs-devSecurity5062 installsUpdated 7w ago
Repository

About infra-security-review

infra-security-review provides checklists and search patterns for infrastructure-as-code security reviews, aimed at infrastructure security reviewers. It covers state storage, secrets, networks, compute, databases, and storage by severity, and includes a report template.

Key features

  1. 01Check state backend configuration risks
  2. 02Find hardcoded secrets and credentials
  3. 03Review network and compute security settings
  4. 04Check database and storage exposure risks
  5. 05Use severity guidance and a report template

Use cases

  1. 01Review state storage security in IaC
  2. 02Find exposed credentials in code
  3. 03Check infrastructure network access settings
  4. 04Document review findings and remediation

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/majesticlabs-dev/majestic-marketplace --skill infra-security-review

After installing, type/infra-security-reviewin Claude Code to confirm it loaded.

Details

From the project README

Infrastructure Security Review Patterns

Security checklists and grep patterns for reviewing IaC code. Use these patterns when verifying infrastructure security.

Security Checklists

State Backend Security
CheckSeverityPattern
S3 bucket without encryptionCriticalencrypt = false or missing
Missing state lockingHighNo DynamoDB table configured
Public bucket policyCriticalblock_public_* not all true
Missing versioningMediumversioning not enabled
Secret Exposure
CheckSeverityPattern
Hardcoded AWS keysCriticalAKIA[0-9A-Z]{16}
Hardcoded passwordsCriticalpassword\s*=\s*"[^"]+[^}]"
Database credentials in codeCriticalDATABASE_URL with password
API keys in variablesHighapi_key, secret_key defaults
Network Security
CheckSeverityPattern
SSH open to worldCritical0.0.0.0/0 on port 22
Database publicly accessibleCriticalMissing private_network_uuid
Wide CIDR rangesMedium/8, /16 on public resources
Missing firewallHighDroplet without firewall resource
Compute Security
CheckSeverityPattern
Root login enabledHighPermitRootLogin yes in cloud-init
Password auth enabledMediumPasswordAuthentication yes
Missing SSH hardeningLowNo ClientAliveInterval config
No monitoringLowmonitoring = false
Database Security
CheckSeverityPattern
Public database accessCriticalNo database firewall rules
No VPC attachmentHighMissing private_network_uuid
Weak versionMediumOld database engine versions
Single node for productionLownode_count = 1 in prod
Storage Security
CheckSeverityPattern
Public S3 bucketsCriticalacl = "public-read"
Missing encryptionHighNo SSE configuration
No access loggingMediumMissing access log bucket

Grep Patterns

# Hardcoded secrets
grep -rE 'AKIA[0-9A-Z]{16}' *.tf
grep -rE 'password\s*=\s*"[^$\{][^"]*"' *.tf
grep -rE 'secret.*=\s*"[^$\{][^"]*"' *.tf
grep -rE 'api_key\s*=\s*"' *.tf

# Network exposure
grep -rE '0\.0\.0\.0/0.*22' *.tf
grep -rE 'cidr_blocks.*0\.0\.0\.0/0' *.tf
grep -rE 'publicly_accessible\s*=\s*true' *.tf

# State security
grep -rE 'encrypt\s*=\s*false' *.tf
grep -rE 'block_public_acls\s*=\s*false' *.tf

# Cloud-init issues
grep -rE 'PermitRootLogin\s+yes' *.tf *.yaml
grep -rE 'PasswordAuthentication\s+yes' *.tf *.yaml

Report Template

# Infrastructure Security Review

**Repository:** [name]
**Date:** [date]
**Files Reviewed:** [count]

## Summary

| Severity | Count |
|----------|-------|
| Critical | X |
| High | X |
| Medium | X |
| Low | X |

## Findings

### [SEVERITY-001] Title

**File:** `path/to/file.tf:line`
**Resource:** `resource_type.name`

**Issue:**
Description of the security issue.

**Current:**
```hcl
[current code]

Remediation:

[fixed code]

Compliance Notes

  • State encryption enabled (SOC 2)
  • No hardcoded credentials (PCI-DSS)
  • Network segmentation in place (HIPAA)
  • Access logging enabled (all frameworks)

## Severity Guide

| Severity | Definition | Action |
|----------|------------|--------|
| Critical | Direct security exposure, data breach risk | Block deployment |
| High | Significant risk, exploitable weakness | Fix before production |
| Medium | Best practice violation, indirect risk | Fix within 30 days |
| Low | Minor hardening opportunity | Address when convenient |

Comments

Markdown supported