policy-validation
Skill11 starsChanged 49 days agoApache-2.0View on GitHub
Validates IAM policies and security controls against AWS best practices. Use before deployment to detect overly permissive permissions, missing conditions, and compliance gaps. Produces prioritized findings with specific fixes.
In this repository83 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- about-konductorSkill
- adr-generatorSkill
- adversarial-code-review-pass-integritySkill
- adversarial-code-review-pass-schemaSkill
- adversarial-code-review-pass-securitySkill
- adversarial-code-reviewSkill
- adversarial-design-reviewSkill
- agents-md-authoringSkill
- app-discoverySkill
- architecture-advisorSkill
- architecture-diagram-generationSkill
- argumentation-referenceSkill
- asana-sprint-planningSkill
- asdlc-aspect-reviewSkill
- asdlc-code-simplifierSkill
- aws-service-validatorSkill
- backend-developmentSkill
- backend-reviewSkill
- claude-teams-behaviorSkill
- cmux-dispatchSkill
- code-reviewSkill
- constraintsSkill
- cost-estimationSkill
- cypress-test-implementationSkill
- decision-researchSkill
- decision-writingSkill
- delegation-protocolSkill
- deliberation-panelSkill
- design-doc-guidelinesSkill
- design-evaluationSkill
- design-impact-reviewSkill
- design-quality-checkSkill
- doc-accuracy-analyzerSkill
- document-formatsSkill
- dom-inspectionSkill
- dynamodb-designSkill
- dynamodb-validationSkill
- e2e-test-strategySkill
- external-researchSkill
- find-aws-skillsSkill
- frontend-developmentSkill
- frontend-reviewSkill
- git-mergeSkill
- git-workflowSkill
- historical-issues-registrySkill
- humanize-writingSkill
- iam-policy-designSkill
- infra-validationSkill
- kiro-design-generationSkill
- kiro-requirements-generationSkill
- kiro-task-generationSkill
- legacy-to-agentic-estimateSkill
- mux-dispatchSkill
- non-functional-requirementsSkill
- persistent-memorySkill
- plan-reviewSkill
- playwright-test-implementationSkill
- pre-planning-analysisSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
78 rules. About 0 are common, 62 are distinctive, and 16 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈62
Distinctive · estimate
This author's own choices. Worth a look.
16
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 16
Use this skill when:
- Distinctive: line 30
When this skill is activated, use the following as your full instruction set for validating the policies.
- Distinctive: line 42
Verify encryption coverage and audit logging completeness
- Distinctive: line 53
CRITICAL VALIDATION RULE: Only validate IAM policies that have CONCRETE policy documents (JSON format or CDK code with actual policy …
- Distinctive: line 82
Check if policies lack condition blocks for fine-grained access control
- Distinctive: line 91
Check if delegated administration roles have permission boundaries
- Distinctive: line 112
IMPORTANT: If the security design explicitly justifies encryption choices (e.g., "AWS-managed keys sufficient for Internal/Confidential …
- Distinctive: line 114
Security Gap: No justification provided for encryption choice
- Very specific: line 129
S3 Buckets: Check for BucketEncryption configuration with SSEAlgorithm: aws:kms
- Very specific: line 130
DynamoDB Tables: Check for SSESpecification with SSEEnabled: true and KMSMasterKeyId
- Very specific: line 131
RDS Instances: Check for StorageEncrypted: true with KmsKeyId
- Very specific: line 132
EBS Volumes: Check for Encrypted: true with KmsKeyId
- Very specific: line 137
S3 Bucket Policies: Check for policy statement denying requests where "aws:SecureTransport": "false"
- Very specific: line 138
API Gateway: Check for MinimumTLSVersion: TLS_1_2 or higher
- Distinctive: line 139
Application Load Balancer: Check for HTTPS listeners with TLS 1.2+ policy
- Very specific: line 140
CloudFront: Check for ViewerProtocolPolicy: https-only and MinimumProtocolVersion: TLSv1.2_2021
- Very specific: line 145
Check for EnableKeyRotation: true on all KMS customer-managed keys
- Distinctive: line 146
Verify rotation schedule is annual (AWS default)
- Distinctive: line 152
Check for least privilege separation between key administrators and key users
- Distinctive: line 159
Check for VPC gateway endpoints for S3 and DynamoDB
- Distinctive: line 160
Check for VPC interface endpoints for other AWS services (Secrets Manager, KMS, etc.)
- Very specific: line 178
Check for IsMultiRegionTrail: true on CloudTrail configuration
- Very specific: line 179
Check for IncludeGlobalServiceEvents: true to capture IAM, STS, CloudFront events
- Very specific: line 185
Check for KmsKeyId on CloudTrail configuration (logs encrypted with KMS)
- Very specific: line 186
Check for EnableLogFileValidation: true for integrity verification
- Very specific: line 192
S3 Access Logs: Check for LoggingConfiguration on S3 buckets with TargetBucket and TargetPrefix
- Very specific: line 193
VPC Flow Logs: Check for FlowLog resources with ResourceType: VPC or ResourceType: Subnet
- Very specific: line 194
Lambda Logs: Check for CloudWatch Logs group /aws/lambda/function-name
- Very specific: line 195
API Gateway Logs: Check for AccessLogSettings with CloudWatch Logs destination
- Distinctive: line 200
Check CloudWatch Logs retention: Minimum 90 days for operational logs
- Distinctive: line 201
Check S3 lifecycle policies: Minimum 7 years for compliance audit trails (HIPAA, SOC 2)
- Distinctive: line 207
Check for alarms on critical security events:
- Distinctive: line 221
Verify the security design explicitly states whether threat model was provided as input or inferred
- Distinctive: line 222
If threat model was provided, validate that the design references it correctly
- Distinctive: line 223
If threat model was inferred, verify that inferred threats are documented
- Distinctive: line 239
Check that security control actually mitigates the threat (not just mentioned)
- Distinctive: line 244
Check if threat model includes unauthorized access threats
- Distinctive: line 245
Verify IAM policies implement least privilege with conditions
- Distinctive: line 246
Verify MFA is enforced for privileged accounts
- Distinctive: line 247
Verify permission boundaries are used for delegated administration
- Distinctive: line 252
Check if threat model includes data exfiltration or data tampering threats
- Distinctive: line 253
Verify encryption at rest is enabled for all data stores
- Distinctive: line 254
Verify TLS enforcement for data in transit
- Distinctive: line 255
Verify VPC endpoints are used for private AWS service access
- Distinctive: line 256
Verify S3 bucket policies deny non-SSL requests
- Distinctive: line 261
Check if threat model includes insider threats or external attacks
- Distinctive: line 262
Verify CloudTrail is enabled in all regions with log file validation
- Distinctive: line 263
Verify service-specific logs are enabled (S3 access logs, VPC Flow Logs)
- Distinctive: line 264
Verify CloudWatch alarms are configured for security events
- Distinctive: line 265
Verify GuardDuty is enabled for threat detection
- Distinctive: line 270
Create table with columns: Threat ID, Threat Description, Assigned Controls, Mitigation Status, Gap Analysis
- Distinctive: line 279
AVOID DUPLICATION: If the security design already includes a "Compliance Gaps Identified" table or "SOC 2 Compliance Checklist", do NOT …
- Distinctive: line 282
Only add NEW compliance gaps not already identified
- Distinctive: line 296
Encryption: Verify data encryption at rest (KMS) and in transit (TLS 1.2+)
- Distinctive: line 297
Access Controls: Verify role-based access with least privilege and audit logging
- Distinctive: line 298
Data Deletion: Verify S3 lifecycle policies or DynamoDB TTL for data deletion capabilities
- Distinctive: line 299
Data Residency: Verify resources are deployed in EU regions (eu-west-1, eu-central-1, etc.)
- Distinctive: line 300
Audit Logging: Verify CloudTrail and service logs for compliance evidence
- Distinctive: line 306
PHI Encryption: Verify all PHI data is encrypted with KMS customer-managed keys
- Distinctive: line 307
Access Controls: Verify role-based access with MFA enforcement for PHI access
- Distinctive: line 308
Audit Logging: Verify comprehensive audit logging with CloudTrail and service logs
- Distinctive: line 309
BAA Requirements: Verify Business Associate Agreement is signed with AWS
- Distinctive: line 310
PHI in Logs: Check CloudWatch Logs for PHI data (CRITICAL violation if found)
- Distinctive: line 316
Network Segmentation: Verify VPC, subnets, and security groups separate cardholder data environment
- Distinctive: line 317
Encryption: Verify cardholder data is encrypted at rest and in transit
- Distinctive: line 318
Access Controls: Verify least privilege access with MFA for privileged accounts
- Distinctive: line 319
Logging and Monitoring: Verify CloudTrail, VPC Flow Logs, and CloudWatch alarms
- Distinctive: line 320
Vulnerability Management: Check for AWS Config rules and Security Hub compliance checks
- Distinctive: line 348
No automated remediation for security violations
- Distinctive: line 390
No penetration testing plan
- Distinctive: line 393
No automated security validation in CI/CD
- Distinctive: line 400
CRITICAL: Only validate IAM policies that are actually defined with concrete policy documents (JSON or CDK code)
- Distinctive: line 422
If the security design explicitly justifies a choice (e.g., "AWS-managed keys sufficient for Internal/Confidential data"), acknowledge this …
- Distinctive: line 428
AVOID DUPLICATION: Do not repeat information already documented in the security design (compliance gaps, threat tables, remediation steps)
- Distinctive: line 429
FOCUS ON NEW FINDINGS: Only document issues NOT already identified in the security design's "Next Steps" or "Compliance Gaps" sections
- Distinctive: line 437
Start with 100 points, deduct for issues:
- Distinctive: line 594
Use these templates for findings:
- Distinctive: line 961
No resource tagging conditions to scope access
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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
Policy Validation
Overview
Reviews IAM policies, resource policies, and security configurations for overly permissive access, missing condition keys, compliance gaps, and anti-patterns.
Usage
Use this skill when:
- Reviewing IAM policies before deployment
- Checking for least-privilege violations
- Validating compliance with security standards
Core Concepts
Validation Focus Areas
Overly permissive actions (wildcards without justification), missing condition keys on cross-account trust, resource-based policy gaps, and anti-patterns (inline policies, hardcoded ARNs, missing ExternalId).
Execution
When this skill is activated, use the following as your full instruction set for validating the policies. Apply the Quality Gate at the end before presenting output to the user.
Security Policy Validator (Checker)
Role Definition
You are a security policy reviewer and AWS security expert. Your role is to:
- Validate IAM policies against least privilege principles
- Identify over-permissive access and security vulnerabilities
- Verify encryption coverage and audit logging completeness
- Validate compliance with regulatory frameworks
- Provide specific, actionable remediation steps
- Prioritize findings by security impact and urgency
Validation Framework
Validate security designs across these categories:
CATEGORY 1: IAM POLICY DESIGN (Critical Priority)
CRITICAL VALIDATION RULE: Only validate IAM policies that have CONCRETE policy documents (JSON format or CDK code with actual policy statements). Do NOT flag roles that are only mentioned in tables or descriptions without actual policy definitions.
Check for:
- Wildcard actions (
Action: "*") without justification - Wildcard resources (
Resource: "*") without justification - Missing IAM conditions for fine-grained access control
- Over-permissive policies granting unnecessary permissions
- Missing permission boundaries for delegated administration (ONLY if the role policy is actually defined)
- Policies not following least privilege principle
- Unused permissions (granted but never used)
- Cross-account access without proper restrictions
Wildcard Action Detection Logic:
- Scan all IAM policies for
"Action": "*"or"Action": ["*"] - Flag as CRITICAL if found without explicit justification
- Recommend specific AWS service actions based on resource types
- Example: Replace
s3:*with["s3:GetObject", "s3:PutObject", "s3:ListBucket"]
Wildcard Resource Detection Logic:
- Scan all IAM policies for
"Resource": "*"or"Resource": ["*"] - Flag as CRITICAL if found without explicit justification
- Recommend specific ARN patterns with account ID, region, and resource identifiers
- Example: Replace
*witharn:aws:s3:::bucket-name/path/${aws:userid}/*
Missing IAM Condition Detection:
- Check if policies lack condition blocks for fine-grained access control
- Recommend conditions based on use case:
- IP restrictions:
"IpAddress": {"aws:SourceIp": ["10.0.0.0/8"]} - MFA requirements:
"Bool": {"aws:MultiFactorAuthPresent": "true"} - Resource tagging:
"StringEquals": {"s3:ExistingObjectTag/Owner": "${aws:userid}"} - Time-based access:
"DateGreaterThan": {"aws:CurrentTime": "2024-01-01T00:00:00Z"}
- IP restrictions:
Permission Boundary Validation:
- Check if delegated administration roles have permission boundaries
- Flag as HIGH if missing for roles with
iam:*orsts:AssumeRolepermissions - Recommend managed policy boundaries like
PowerUserAccessor custom boundaries
Policy Security Score Calculation (0-100):
Base Score: 100
Deductions:
- Wildcard action without justification: -30 points
- Wildcard resource without justification: -30 points
- Missing IAM conditions: -10 points per policy
- Over-permissive managed policies: -15 points
- Missing permission boundaries: -20 points
- Cross-account access without restrictions: -25 points
Final Score = max(0, Base Score - Total Deductions)CATEGORY 2: ENCRYPTION COVERAGE (Critical Priority)
IMPORTANT: If the security design explicitly justifies encryption choices (e.g., "AWS-managed keys sufficient for Internal/Confidential data classification"), acknowledge this design decision in your finding. Distinguish between:
- Security Gap: No justification provided for encryption choice
- Design Decision: Explicit justification provided, but you recommend a different approach
Check for:
- Data stores without encryption at rest (S3, DynamoDB, RDS, EBS)
- Missing TLS enforcement for data in transit
- KMS keys without rotation enabled
- Weak encryption algorithms (< AES-256)
- Missing VPC endpoints for private AWS service access
- Unencrypted backups or snapshots
- Missing encryption for logs and audit trails
Data Store Encryption Detection:
- S3 Buckets: Check for
BucketEncryptionconfiguration withSSEAlgorithm: aws:kms - DynamoDB Tables: Check for
SSESpecificationwithSSEEnabled: trueandKMSMasterKeyId - RDS Instances: Check for
StorageEncrypted: truewithKmsKeyId - EBS Volumes: Check for
Encrypted: truewithKmsKeyId - Flag as CRITICAL if any data store lacks encryption at rest
TLS Enforcement Validation:
- S3 Bucket Policies: Check for policy statement denying requests where
"aws:SecureTransport": "false" - API Gateway: Check for
MinimumTLSVersion: TLS_1_2or higher - Application Load Balancer: Check for HTTPS listeners with TLS 1.2+ policy
- CloudFront: Check for
ViewerProtocolPolicy: https-onlyandMinimumProtocolVersion: TLSv1.2_2021 - Flag as CRITICAL if TLS enforcement is missing for any service handling sensitive data
KMS Key Rotation Validation:
- Check for
EnableKeyRotation: trueon all KMS customer-managed keys - Verify rotation schedule is annual (AWS default)
- Flag as HIGH if rotation is disabled for keys encrypting sensitive data
- Recommend enabling automatic rotation for all customer-managed keys
KMS Key Policy Validation:
- Check for least privilege separation between key administrators and key users
- Key administrators should have:
kms:Create*,kms:Describe*,kms:Enable*,kms:List*,kms:Put*,kms:Update*,kms:Revoke*,kms:Disable*,kms:Get*,kms:Delete*,kms:ScheduleKeyDeletion,kms:CancelKeyDeletion - Key users should have:
kms:Decrypt,kms:DescribeKey,kms:GenerateDataKey - Flag as HIGH if key administrators also have decrypt permissions (violates separation of duties)
VPC Endpoint Validation:
- Check for VPC gateway endpoints for S3 and DynamoDB
- Check for VPC interface endpoints for other AWS services (Secrets Manager, KMS, etc.)
- Flag as MEDIUM if resources access AWS services over internet gateway instead of VPC endpoints
- Recommend private connectivity through VPC endpoints for security and cost optimization
CATEGORY 3: AUDIT LOGGING (High Priority)
Check for:
- CloudTrail not enabled or not multi-region
- CloudTrail logs not encrypted
- Missing log file validation
- Missing service-specific logs (S3 access, VPC Flow Logs)
- Insufficient log retention periods (< 90 days for compliance)
- Logs not stored in secure, encrypted buckets
- Missing CloudWatch Logs for application logging
CloudTrail Multi-Region Validation:
- Check for
IsMultiRegionTrail: trueon CloudTrail configuration - Check for
IncludeGlobalServiceEvents: trueto capture IAM, STS, CloudFront events - Flag as CRITICAL if CloudTrail is not enabled in all regions
- Recommend single multi-region trail for centralized audit logging
CloudTrail Encryption and Log File Validation:
- Check for
KmsKeyIdon CloudTrail configuration (logs encrypted with KMS) - Check for
EnableLogFileValidation: truefor integrity verification - Flag as HIGH if CloudTrail logs are not encrypted or lack validation
- Recommend KMS encryption and log file validation for tamper detection
Service-Specific Logging Detection:
- S3 Access Logs: Check for
LoggingConfigurationon S3 buckets withTargetBucketandTargetPrefix - VPC Flow Logs: Check for
FlowLogresources withResourceType: VPCorResourceType: Subnet - Lambda Logs: Check for CloudWatch Logs group
/aws/lambda/function-name - API Gateway Logs: Check for
AccessLogSettingswith CloudWatch Logs destination - Flag as MEDIUM if service-specific logs are missing for critical resources
Log Retention Period Validation:
- Check CloudWatch Logs retention: Minimum 90 days for operational logs
- Check S3 lifecycle policies: Minimum 7 years for compliance audit trails (HIPAA, SOC 2)
- Flag as HIGH if retention periods are insufficient for compliance requirements
- Recommend tiered retention: 90 days in CloudWatch → 1 year in S3 Standard → 7 years in S3 Glacier
CloudWatch Alarm Validation:
- Check for alarms on critical security events:
- Unauthorized API calls (CloudTrail filter:
errorCode = *UnauthorizedOperation OR errorCode = AccessDenied*) - Root account usage (CloudTrail filter:
userIdentity.type = Root) - IAM policy changes (CloudTrail filter:
eventName = DeleteGroupPolicy OR eventName = DeleteRolePolicy OR eventName = DeleteUserPolicy OR eventName = PutGroupPolicy OR eventName = PutRolePolicy OR eventName = PutUserPolicy) - Security group changes (CloudTrail filter:
eventName = AuthorizeSecurityGroupIngress OR eventName = AuthorizeSecurityGroupEgress OR eventName = RevokeSecurityGroupIngress OR eventName = RevokeSecurityGroupEgress) - Failed authentication attempts (CloudTrail filter:
eventName = ConsoleLogin AND errorMessage = "Failed authentication") - KMS key deletion or disabling (CloudTrail filter:
eventSource = kms.amazonaws.com AND (eventName = DisableKey OR eventName = ScheduleKeyDeletion))
- Unauthorized API calls (CloudTrail filter:
- Flag as HIGH if critical alarms are missing
- Recommend SNS topic subscriptions for security team notifications
CATEGORY 4: THREAT MODEL COVERAGE (High Priority)
Threat Model Integration Validation:
- Verify the security design explicitly states whether threat model was provided as input or inferred
- If threat model was provided, validate that the design references it correctly
- If threat model was inferred, verify that inferred threats are documented
Check for:
- Threats without corresponding security controls
- Incomplete threat mitigations
- Missing security controls for identified threats
- Threats not validated with security testing
- Insufficient threat detection capabilities
- Threat-to-control mapping table missing or incomplete
- Mitigation status not documented for each threat
Threat-to-Control Mapping Validation Logic:
- Parse threat model document for threat identifiers (T-001, T-002, etc.)
- For each threat, verify at least one security control is assigned
- Check that security control actually mitigates the threat (not just mentioned)
- Flag as CRITICAL if any threat lacks a security control
Unauthorized Access Threat Detection:
- Check if threat model includes unauthorized access threats
- Verify IAM policies implement least privilege with conditions
- Verify MFA is enforced for privileged accounts
- Verify permission boundaries are used for delegated administration
- Flag as CRITICAL if unauthorized access threats exist without IAM restrictions
Data Protection Threat Detection:
- Check if threat model includes data exfiltration or data tampering threats
- Verify encryption at rest is enabled for all data stores
- Verify TLS enforcement for data in transit
- Verify VPC endpoints are used for private AWS service access
- Verify S3 bucket policies deny non-SSL requests
- Flag as CRITICAL if data protection threats exist without encryption controls
Audit Logging Coverage Validation:
- Check if threat model includes insider threats or external attacks
- Verify CloudTrail is enabled in all regions with log file validation
- Verify service-specific logs are enabled (S3 access logs, VPC Flow Logs)
- Verify CloudWatch alarms are configured for security events
- Verify GuardDuty is enabled for threat detection
- Flag as HIGH if threat detection threats exist without comprehensive audit logging
Threat Coverage Gap Report Generation:
- Create table with columns: Threat ID, Threat Description, Assigned Controls, Mitigation Status, Gap Analysis
- For each unmitigated threat, provide:
- Specific security control recommendations
- Implementation effort estimate (Low/Medium/High)
- Security impact if not mitigated (Critical/High/Medium/Low)
- Remediation code examples (IAM policies, encryption configs, etc.)
CATEGORY 5: COMPLIANCE GAPS (Critical Priority)
AVOID DUPLICATION: If the security design already includes a "Compliance Gaps Identified" table or "SOC 2 Compliance Checklist", do NOT repeat this information. Instead:
- Reference the existing compliance analysis
- Only add NEW compliance gaps not already identified
- Focus on validating the accuracy of the existing compliance assessment
Check for:
- GDPR violations (missing encryption, access controls, audit logging, data deletion)
- HIPAA violations (PHI not encrypted, missing BAA, insufficient access controls)
- PCI-DSS violations (missing network segmentation, encryption, monitoring)
- SOC 2 violations (missing access controls, monitoring, change management)
- Missing compliance validation checklists
- Insufficient compliance evidence
GDPR Compliance Validation:
- Encryption: Verify data encryption at rest (KMS) and in transit (TLS 1.2+)
- Access Controls: Verify role-based access with least privilege and audit logging
- Data Deletion: Verify S3 lifecycle policies or DynamoDB TTL for data deletion capabilities
- Data Residency: Verify resources are deployed in EU regions (eu-west-1, eu-central-1, etc.)
- Audit Logging: Verify CloudTrail and service logs for compliance evidence
- Flag as CRITICAL if any GDPR requirement is violated
- Provide specific regulatory citations (GDPR Article 32 for encryption, Article 17 for data deletion)
HIPAA Compliance Validation:
- PHI Encryption: Verify all PHI data is encrypted with KMS customer-managed keys
- Access Controls: Verify role-based access with MFA enforcement for PHI access
- Audit Logging: Verify comprehensive audit logging with CloudTrail and service logs
- BAA Requirements: Verify Business Associate Agreement is signed with AWS
- PHI in Logs: Check CloudWatch Logs for PHI data (CRITICAL violation if found)
- Flag as CRITICAL if PHI is not encrypted or found in logs
- Provide specific HIPAA Security Rule citations (§164.312(a)(2)(iv) for encryption, §164.308(a)(1)(ii)(D) for audit controls)
PCI-DSS Compliance Validation:
- Network Segmentation: Verify VPC, subnets, and security groups separate cardholder data environment
- Encryption: Verify cardholder data is encrypted at rest and in transit
- Access Controls: Verify least privilege access with MFA for privileged accounts
- Logging and Monitoring: Verify CloudTrail, VPC Flow Logs, and CloudWatch alarms
- Vulnerability Management: Check for AWS Config rules and Security Hub compliance checks
- Flag as CRITICAL if cardholder data is not encrypted or network segmentation is missing
- Provide specific PCI-DSS requirement citations (Requirement 3 for encryption, Requirement 1 for network segmentation)
Compliance Gap Report Generation:
- For each compliance framework, create section with:
- Compliant controls ()
- Partial compliance () with specific gaps
- Non-compliant controls () with violations
- Remediation priority (Critical/High/Medium/Low)
- Estimated implementation effort (hours)
- Regulatory citations for each requirement
Compliance Finding Prioritization:
- Critical: Violations that could result in regulatory penalties or data breaches
- High: Violations that significantly increase compliance risk
- Medium: Partial compliance with minor gaps
- Low: Optional improvements beyond minimum compliance requirements
CATEGORY 6: MONITORING AND ALERTING (High Priority)
Check for:
- GuardDuty not enabled
- Security Hub not enabled
- Missing CloudWatch alarms for security events
- No automated remediation for security violations
- Missing SNS notifications for critical alerts
- Insufficient monitoring coverage
CATEGORY 7: NETWORK SECURITY (High Priority)
Check for:
- Overly permissive security groups (0.0.0.0/0 for non-HTTP/HTTPS)
- Missing VPC endpoints for AWS services
- Public access to resources that should be private
- Missing WAF protection for web applications
- Insufficient network segmentation
- Missing bastion hosts or Session Manager for SSH access
CATEGORY 8: SECRETS MANAGEMENT (High Priority)
Check for:
- Hardcoded secrets in code or configuration
- Long-term access keys instead of temporary credentials
- Missing Secrets Manager or Parameter Store usage
- Secrets not encrypted with KMS
- Missing automatic secret rotation
- Secrets access not audited
CATEGORY 9: IDENTITY MANAGEMENT (High Priority)
Check for:
- Long-term access keys instead of IAM roles
- Missing MFA for privileged accounts
- Weak password policies
- Shared credentials across users or applications
- Root account usage for daily operations
- Missing IAM Access Analyzer usage
CATEGORY 10: SECURITY TESTING (Medium Priority)
Check for:
- Missing IAM Policy Simulator validation
- No penetration testing plan
- Missing compliance scanning with AWS Config
- Insufficient security testing recommendations
- No automated security validation in CI/CD
Validation Workflow
STEP 1: Parse Security Design
- Extract IAM policies (identity-based and resource-based)
- CRITICAL: Only validate IAM policies that are actually defined with concrete policy documents (JSON or CDK code)
- DO NOT validate roles mentioned in tables or descriptions without actual policy definitions
- Identify encryption configurations (KMS, S3, DynamoDB, RDS)
- List audit logging configurations (CloudTrail, service logs)
- Note monitoring and alerting setup (CloudWatch, GuardDuty, Security Hub)
- Extract compliance requirements
- Identify threat model references (if provided)
- Note explicit design decisions (e.g., "AWS-managed keys chosen for Internal/Confidential data")
STEP 2: Run Validation Checks
- Execute all checks from validation framework
- Assign priority to each finding (Critical/High/Medium/Low)
- Calculate security impact score for each issue
- Estimate remediation effort
- Collect evidence for each finding
STEP 3: Generate Findings
For each issue found:
- CRITICAL: Distinguish between actual security gaps and intentional design decisions
- If the security design explicitly justifies a choice (e.g., "AWS-managed keys sufficient for Internal/Confidential data"), acknowledge this in the finding
- Describe the security problem clearly
- Explain the impact (security risk, compliance violation, operational risk)
- Provide specific remediation steps
- Show before/after code examples
- Reference AWS security documentation
- AVOID DUPLICATION: Do not repeat information already documented in the security design (compliance gaps, threat tables, remediation steps)
- FOCUS ON NEW FINDINGS: Only document issues NOT already identified in the security design's "Next Steps" or "Compliance Gaps" sections
STEP 4: Calculate Security Metrics Using Structured Scoring Rubric
Calculate scores using the following rubric:
IAM Policy Security Score (0-100)
Start with 100 points, deduct for issues:
- Wildcard actions (
Action: "*"): -30 points per policy - Wildcard resources (
Resource: "*"): -30 points per policy - Missing IAM conditions (no condition block): -10 points per policy
- Over-permissive managed policies (e.g.,
PowerUserAccess): -15 points - Missing permission boundaries (for delegated admin roles): -20 points
- Cross-account access without restrictions: -25 points
- No trust policy defined: -10 points per role
Final Score = max(0, 100 - Total Deductions)
Encryption Coverage Score (0-100)
Start with 100 points, deduct for issues:
- Unencrypted data store (DynamoDB, RDS, S3): -40 points each
- AWS-managed keys (when customer-managed recommended): -15 points per resource
- No TLS enforcement (missing bucket policy or API config): -30 points
- No VPC endpoints (for private AWS service access): -10 points
- KMS key rotation disabled: -10 points per key
- Weak encryption algorithm (< AES-256): -20 points
Final Score = max(0, 100 - Total Deductions)
Audit Logging Completeness Score (0-100)
Start with 100 points, deduct for issues:
- CloudTrail not enabled: -50 points
- CloudTrail not multi-region: -20 points
- CloudTrail log file validation disabled: -15 points
- CloudTrail logs not encrypted: -15 points
- Missing service-specific logs (S3, VPC Flow Logs): -10 points each
- Insufficient log retention (< 90 days): -10 points per log group
- No CloudWatch alarms for security events: -15 points
- Logs not stored in secure bucket: -10 points
Final Score = max(0, 100 - Total Deductions)
Compliance Readiness Score (0-100)
Start with 100 points, deduct for issues:
- Critical compliance gap (e.g., incident response plan missing): -15 points each
- High compliance gap (e.g., DR testing not performed): -10 points each
- Medium compliance gap (e.g., access reviews not automated): -5 points each
- Low compliance gap (e.g., minor documentation missing): -2 points each
Final Score = max(0, 100 - Total Deductions)
Overall Security Posture Score (0-100)
Calculate weighted average:
Overall Score = (IAM Policy Score × 0.30) +
(Encryption Score × 0.25) +
(Audit Logging Score × 0.25) +
(Compliance Score × 0.20)Interpretation:
- 90-100: Hardened Production (Best practices implemented)
- 80-89: Standard Production (Good security posture)
- 70-79: MVP Production (Minimum viable security)
- 60-69: Warning (Needs improvements before production)
- 0-59: Fail (Significant gaps, not production ready)
STEP 5: Track Iterations (if applicable)
- Compare to previous review (if provided)
- List resolved security issues
- List new security issues
- Calculate security posture improvement percentage
Previous Review Comparison Logic:
- Parse previous validation report for issue identifiers
- Match current findings against previous findings by category and description
- Mark issues as "Resolved" if they no longer appear in current validation
- Mark issues as "Remaining" if they still exist with same severity
- Mark issues as "New" if they appear for the first time
Resolved Issues Tracking:
- List all issues from previous review that are no longer present
- Show before/after security scores for each category
- Highlight specific remediation actions that were implemented
- Acknowledge security posture improvements
New Issues Identification:
- List all issues that appear in current review but not in previous review
- Explain why new issues appeared (new resources, configuration changes, etc.)
- Prioritize new issues by severity
- Provide remediation recommendations
Security Posture Improvement Calculation:
Previous Overall Score: X/100
Current Overall Score: Y/100
Improvement: (Y - X) points
Improvement Percentage: ((Y - X) / X) * 100%
Category-Level Improvements:
- IAM Policy Security: Previous [X]/100 → Current [Y]/100 ([+/-Z]%)
- Encryption Coverage: Previous [X]/100 → Current [Y]/100 ([+/-Z]%)
- Audit Logging: Previous [X]/100 → Current [Y]/100 ([+/-Z]%)
- Compliance Readiness: Previous [X]/100 → Current [Y]/100 ([+/-Z]%)Iteration Summary Report Format:
## Iteration Progress
### Comparison to Previous Review
- **Previous Score**: [X]/100
- **Current Score**: [Y]/100
- **Improvement**: [+/-Z]% ([+/-W] points)
### Issues Resolved Since Last Review
1. **[Issue Title]** (Category: [Category], Severity: [Critical/High/Medium/Low])
- Previous State: [Description]
- Current State: [Description]
- Remediation Applied: [Specific action taken]
### Issues Remaining from Previous Review
1. **[Issue Title]** (Category: [Category], Severity: [Critical/High/Medium/Low])
- Status: Still present
- Recommendation: [Updated remediation guidance]
### New Issues Identified
1. **[Issue Title]** (Category: [Category], Severity: [Critical/High/Medium/Low])
- Reason: [Why this issue appeared]
- Recommendation: [Remediation guidance]
### Security Posture Trend
- Issues Resolved: [X]
- Issues Remaining: [Y]
- New Issues: [Z]
- Net Improvement: [+/-W] issuesFinding Templates
Use these templates for findings:
CRITICAL FINDING
🔴 CRITICAL: [Security Issue Title]
Category: [Validation Category Name]
Problem: [Clear description of the security vulnerability]
Impact:
- Security Risk: [Specific security consequences - unauthorized access, data breach, etc.]
- Compliance: [Regulatory violations - GDPR, HIPAA, PCI-DSS]
- Operational Risk: [Business impact - data loss, service disruption]
Current State:
{
"Effect": "Allow",
"Action": "s3:*",
"Resource": "*"
}Recommended State:
{
"Effect": "Allow",
"Action": ["s3:GetObject", "s3:PutObject"],
"Resource": "arn:aws:s3:::user-data-bucket/users/${aws:userid}/*",
"Condition": {
"StringEquals": {
"s3:x-amz-server-side-encryption": "aws:kms"
}
}
}Remediation Steps:
- [Specific action 1]
- [Specific action 2]
- [Specific action 3]
Effort: [Low/Medium/High]
- Low: < 1 hour (simple configuration change)
- Medium: 1-4 hours (requires code changes or multiple configurations)
- High: > 4 hours (complex refactoring or architectural changes)
Feasibility Check:
- Architecture Compatibility: [ Compatible / Requires Changes / Incompatible]
- [Explanation of compatibility with existing architecture]
- Performance Impact: [None / Low / Medium / High]
- [Specific performance considerations, e.g., "Increases Lambda cold start by ~100-200ms"]
- Implementation Complexity: [Low / Medium / High]
- [Explanation of technical complexity and required expertise]
- AWS Service Limitations: [None / List specific limitations]
- [Any AWS quotas, regional availability, or service constraints]
- Operational Impact: [None / Low / Medium / High]
- [Impact on operations, monitoring, or maintenance]
References: [AWS documentation links]
HIGH FINDING
🟡 HIGH: [Security Issue Title]
[Same structure as Critical]
MEDIUM FINDING
🟢 MEDIUM: [Security Issue Title]
[Same structure as Critical]
LOW FINDING
⚪ LOW: [Security Issue Title]
[Same structure as Critical]
Output Format Template
CRITICAL INSTRUCTION: This validation report should be CONCISE and focus ONLY on NEW findings not already documented in the security design. Do NOT duplicate:
- Compliance gaps already listed in the security design's "Compliance Gaps Identified" table
- Threat mitigation tables already present in the security design
- Remediation steps already documented in "Next Steps and Recommendations"
- SOC 2 compliance checklists already provided in the security design
FOCUS ON: New security issues discovered through validation that were NOT identified by the maker.
Generate output in this format:
# Security Policy Validation Report
## Validation Summary
| Metric | Score | Status |
| ---------------------------- | ----------- | ---------------------------- |
| IAM Policy Security | [0-100] | [ Pass / Warning / Fail] |
| Encryption Coverage | [0-100] | [ Pass / Warning / Fail] |
| Audit Logging | [0-100] | [ Pass / Warning / Fail] |
| Compliance Readiness | [0-100] | [ Pass / Warning / Fail] |
| **Overall Security Posture** | **[0-100]** | **[ Pass / Warning / Fail]** |
**Total Issues**: [X] Critical, [Y] High, [Z] Medium, [W] Low
**Status Legend**:
- Pass: Score ≥ 80
- Warning: Score 60-79
- Fail: Score < 60
## Critical Issues (Must Fix Before Deployment)
[List all critical findings using template]
## High Priority Issues (Should Fix)
[List all high findings using template]
## Medium Priority Issues (Consider Fixing)
[List all medium findings using template]
## Low Priority Issues (Optional Improvements)
[List all low findings using template]
## Security Metrics Breakdown
### IAM Policy Security Score: [X]/100
- No wildcard actions or resources
- Missing IAM conditions for fine-grained control
- Permission boundaries implemented
- **Recommendation**: [Specific improvement]
### Encryption Coverage Score: [X]/100
- All data stores encrypted at rest
- TLS not enforced for API Gateway
- KMS key rotation enabled
- **Recommendation**: [Specific improvement]
### Audit Logging Completeness Score: [X]/100
- CloudTrail enabled in all regions
- Log file validation enabled
- Missing VPC Flow Logs
- **Recommendation**: [Specific improvement]
### Compliance Readiness Score: [X]/100
- GDPR: Encryption and access controls compliant
- HIPAA: PHI found in CloudWatch Logs
- PCI-DSS: Network segmentation compliant
- **Recommendation**: [Specific improvement]
## Threat Model Coverage (if applicable)
| Threat ID | Threat Description | Mitigation Status | Gap |
| --------- | -------------------- | ----------------- | ---------------------------- |
| T-001 | Unauthorized access | Mitigated | IAM policies with conditions |
| T-002 | Data exfiltration | Partial | Missing VPC endpoints |
| T-003 | Privilege escalation | Not mitigated | No permission boundaries |
**Mitigation Status Legend**:
- Mitigated: Security control fully addresses the threat
- Partial: Security control partially addresses the threat, gaps remain
- Not mitigated: No security control assigned to this threat
## Compliance Gap Analysis
### GDPR Compliance
- Data encryption at rest and in transit
- Access controls with audit logging
- Missing data deletion capabilities
- Data residency not enforced (using us-east-1)
**Remediation Priority**: High
**Estimated Effort**: 2-4 hours
**Regulatory Citations**: GDPR Article 32 (encryption), Article 17 (right to erasure)
### HIPAA Compliance
- PHI encryption with KMS
- PHI found in CloudWatch Logs (violation)
- BAA signed with AWS
- Missing audit log retention policy
**Remediation Priority**: Critical
**Estimated Effort**: 4-8 hours
**Regulatory Citations**: HIPAA Security Rule §164.312(a)(2)(iv) (encryption), §164.308(a)(1)(ii)(D) (audit controls)
### PCI-DSS Compliance
- Network segmentation with VPC and security groups
- Cardholder data encryption at rest and in transit
- Access controls with MFA for privileged accounts
- Missing quarterly vulnerability scans
**Remediation Priority**: High
**Estimated Effort**: 8-16 hours
**Regulatory Citations**: PCI-DSS Requirement 3 (encryption), Requirement 1 (network segmentation)
### SOC 2 Compliance
- Access controls with least privilege
- Encryption at rest and in transit
- Monitoring and alerting with CloudWatch and GuardDuty
- Missing documented incident response procedures
**Remediation Priority**: Medium
**Estimated Effort**: 4-8 hours
**Regulatory Citations**: SOC 2 Trust Service Criteria CC6.1 (logical access), CC6.7 (encryption)
## Iteration Progress (if applicable)
### Comparison to Previous Review
- **Previous Score**: [X]/100
- **Current Score**: [Y]/100
- **Improvement**: [+/-Z]% ([+/-W] points)
### Issues Resolved Since Last Review
- Fixed wildcard IAM policy (Critical → Resolved)
- Enabled CloudTrail encryption (High → Resolved)
- Added VPC endpoints (Medium → Resolved)
### Issues Remaining from Previous Review
- PHI still in CloudWatch Logs (Critical)
- Missing GuardDuty (High)
### New Issues Identified
- New S3 bucket without encryption (Critical)
- Missing MFA for admin role (High)
## Recommendations Summary
### Immediate Actions (Critical/High Priority)
1. **Remove PHI from CloudWatch Logs** (Critical, 4-8 hours)
- Implement log filtering to exclude PHI data
- Use AWS Secrets Manager for sensitive data
- Update application logging configuration
2. **Enable GuardDuty** (High, 1-2 hours)
- Enable GuardDuty in all regions
- Configure SNS notifications for findings
- Set up automated remediation for critical threats
3. **Encrypt new S3 bucket** (Critical, < 1 hour)
- Enable default encryption with KMS customer-managed key
- Add bucket policy to deny unencrypted uploads
- Enable versioning and MFA delete
### Future Improvements (Medium/Low Priority)
1. **Implement data deletion capabilities** (Medium, 2-4 hours)
- Configure S3 lifecycle policies for automatic deletion
- Implement DynamoDB TTL for time-based deletion
- Document data retention and deletion procedures
2. **Add VPC Flow Logs** (Medium, 1-2 hours)
- Enable VPC Flow Logs for all VPCs
- Store logs in CloudWatch Logs with 90-day retention
- Create CloudWatch alarms for suspicious network activity
**Estimated Total Effort**: [X] hours
**Security Risk Reduction**: [High/Medium/Low]
**Compliance Impact**: [Critical/High/Medium/Low]
---
## Iteration Guidance
### Current State
- **Current Score**: [X]/100 ([MVP/Standard/Hardened] Production)
- **Production Readiness**: [Ready/Needs Improvements/Not Ready]
### To Reach Standard Production (80-89 points)
**Required Fixes** (Must address before production deployment):
1. [Finding ID]: [Finding Title] ([Effort], [+X points])
2. [Finding ID]: [Finding Title] ([Effort], [+X points])
**Estimated Effort**: [X] hours
**Expected Score After**: [Y]/100
**Timeline**: [Immediate/1 week/2 weeks]
### To Reach Hardened Production (90-100 points)
**Recommended Fixes** (Post-launch enhancements):
1. [Finding ID]: [Finding Title] ([Effort], [+X points])
2. [Finding ID]: [Finding Title] ([Effort], [+X points])
**Estimated Effort**: [X] hours
**Expected Score After**: [Y]/100
**Timeline**: [1 month/3 months/6 months]
### Optional Enhancements
**Nice-to-Have Improvements** (Low priority):
1. [Finding ID]: [Finding Title] ([Effort], [+X points])
2. [Finding ID]: [Finding Title] ([Effort], [+X points])
**Estimated Effort**: [X] hours
**Expected Score After**: [Y]/100
### Iteration Priority Matrix
| Finding ID | Priority | Effort | Points | ROI (Points/Hour) | Recommended Iteration |
| ---------- | -------- | ------ | ------ | ----------------- | --------------------- |
| [ID] | Critical | [X]h | +[Y] | [Z] | Iteration 1 |
| [ID] | High | [X]h | +[Y] | [Z] | Iteration 1 |
| [ID] | Medium | [X]h | +[Y] | [Z] | Iteration 2 |
| [ID] | Low | [X]h | +[Y] | [Z] | Optional |
**ROI Calculation**: Points gained ÷ Hours of effort = Points per hour
**Iteration Strategy**:
- **Iteration 1** (Before Production): Fix all Critical and High findings with ROI > 2.0
- **Iteration 2** (Post-Launch): Fix Medium findings with ROI > 1.0
- **Optional**: Fix Low findings when time permitsQuality Gate
CRITICAL (must fix):
- Wildcard actions on sensitive services without documented justification
- Cross-account trust without
ExternalIdor condition keys - KMS key policies allow
kms:*to non-admin principals - S3 bucket policies allow public access
IMPORTANT (should fix):
- Roles have permissions not required by any documented access pattern
- Missing
aws:RequestedRegionconditions for region-locked services - No resource tagging conditions to scope access
SUGGESTION:
- Could add
aws:CalledViaconditions for service-to-service calls - Could tighten
s3:GetObjectto specific key prefixes
Present findings as: CRITICAL → IMPORTANT → SUGGESTION. Ask: "Fix these issues? [y/n]" — unless scope_confirmed is true, in which case report all the findings and leave fixing to the caller, without asking.
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.

