# Open security groupsclanker ask "Show me security groups with port 22 open to the world"clanker ask "Find security groups with 0.0.0.0/0 access"# Public resourcesclanker ask "Show me public S3 buckets"clanker ask "List EC2 instances with public IPs"clanker ask "Find RDS instances that are publicly accessible"# IAM issuesclanker ask "Show me IAM users without MFA"clanker ask "Find IAM policies with wildcard permissions"clanker ask "Show me unused IAM access keys"# Encryptionclanker ask "Show me unencrypted EBS volumes"clanker ask "Find S3 buckets without encryption"clanker ask "List RDS instances without encryption at rest"
Example output:
# Security Group Audit Results## 🚨 Critical Issues (3 security groups)### ssh-access-sg (sg-0a1b2c3d4e5f6)- **Rule**: Inbound SSH (port 22)- **Source**: 0.0.0.0/0 (internet)- **Attached to**: 5 EC2 instances (prod-web-1, prod-web-2, dev-test-1, bastion, jenkins)- **Risk**: SSH access from anywhere- **Recommendation**: Restrict to office IPs or use Systems Manager Session Manager### mysql-public-sg (sg-9z8y7x6w5v4u3)- **Rule**: Inbound MySQL (port 3306)- **Source**: 0.0.0.0/0 (internet)- **Attached to**: RDS instance prod-db- **Risk**: Database exposed to internet- **Recommendation**: Remove public access, use VPC peering or VPN### wide-open-sg (sg-1a2b3c4d5e6f7)- **Rule**: All traffic- **Source**: 0.0.0.0/0 (internet)- **Attached to**: dev-instance-1- **Risk**: Complete exposure- **Recommendation**: Delete this security group, create specific rules## Remediation Commands```bash# Restrict SSH to office IPclanker ask --maker "update ssh-access-sg to only allow SSH from 203.0.113.0/24"# Remove MySQL public accessclanker ask --maker "remove the 0.0.0.0/0 rule from mysql-public-sg"# Delete dangerous security groupclanker ask --maker --destroyer "delete wide-open-sg and create a proper security group for dev-instance-1"
## IAM security audit### Check IAM users```bash# Users without MFAclanker ask "Show me IAM users without MFA enabled"# Inactive usersclanker ask "Find IAM users who haven't logged in for 90 days"# Users with console accessclanker ask "Show me IAM users with console access"# Access key ageclanker ask "Find IAM access keys older than 90 days"
# Overly permissive policiesclanker ask "Find IAM policies with Administrator access"clanker ask "Show me policies with wildcard (*) resource permissions"# Cross-account accessclanker ask "Find IAM roles that allow cross-account access"# Service rolesclanker ask "Show me all IAM roles used by Lambda functions"clanker ask "Find EC2 instance profiles with excessive permissions"
IAM audit output:
# IAM Security Audit## ⚠️ High Risk IAM Users (4)### admin-user- **Console access**: Yes- **MFA**: ❌ No- **Last login**: 2 days ago- **Policies**: AdministratorAccess- **Risk**: Admin without MFA- **Action**: Enable MFA immediately### old-dev-user- **Console access**: Yes- **MFA**: ✓ Yes- **Last login**: 145 days ago- **Access keys**: 1 key (created 289 days ago)- **Risk**: Inactive account with old credentials- **Action**: Disable or delete### api-service-user- **Console access**: No- **Access keys**: 2 keys - Key 1: Created 523 days ago (never rotated) - Key 2: Created 45 days ago- **Policies**: PowerUserAccess, IAMFullAccess- **Risk**: Overly broad permissions, old credentials- **Action**: Rotate keys, reduce permissions## Overly Permissive Policies (2)### dev-team-policy- **Effect**: Allow- **Actions**: `*` (all actions)- **Resources**: `*` (all resources)- **Attached to**: 8 users, 3 roles- **Risk**: Unrestricted access- **Action**: Create specific policies per service### lambda-execution-role- **Managed policy**: AWSLambdaFullAccess- **Inline policy**: ```json { "Effect": "Allow", "Action": "*", "Resource": "*" }
Risk: Lambda can perform any AWS action
Action: Apply least privilege (only required permissions)
### Fix IAM issues```bash# Enable MFA (requires manual setup in console)clanker ask "How do I enable MFA for admin-user?"# Rotate access keysclanker ask --maker "rotate access keys for api-service-user"# Delete inactive userclanker ask --maker --destroyer "delete IAM user old-dev-user"# Create restrictive policyclanker ask --maker "create an IAM policy that allows S3 read-only access to my-app-bucket"
# Public bucketsclanker ask "Show me S3 buckets with public access"clanker ask "Find S3 buckets with public read or write ACLs"# Encryptionclanker ask "Show me S3 buckets without default encryption"# Versioningclanker ask "Find S3 buckets without versioning enabled"# Loggingclanker ask "Show me S3 buckets without access logging"
S3 security report:
# S3 Security Audit## 🚨 Public Buckets (2)### legacy-assets- **Public access**: Block Public Access = OFF- **ACL**: Public Read- **Objects**: 1,234 files- **Risk**: Data exposure- **Action**: Enable Block Public Access, review ACLs### backup-archive- **Public access**: Block Public Access = OFF- **Bucket policy**: Allows GetObject from `*`- **Objects**: Database backups (67 files)- **Risk**: 🚨 CRITICAL - Database backups exposed- **Action**: Remove public policy immediately, enable encryption## Encryption Issues (5 buckets)### logs-2025, logs-2026, dev-uploads, temp-storage, staging-assets- **Encryption**: None- **Action**: Enable SSE-S3 or SSE-KMS## Missing Versioning (8 buckets)### prod-documents, user-uploads, configs, ...- **Versioning**: Disabled- **Risk**: No protection against accidental deletion- **Action**: Enable versioning
# Block public accessclanker ask --maker "enable Block Public Access for backup-archive bucket"# Enable encryptionclanker ask --maker "enable default encryption for all buckets without encryption"# Enable versioningclanker ask --maker "enable versioning for prod-documents bucket"# Remove public policyclanker ask --maker --destroyer "remove public access policy from backup-archive"
# Public accessibilityclanker ask "Find RDS instances that are publicly accessible"# Encryptionclanker ask "Show me RDS instances without encryption at rest"# Backupclanker ask "Find RDS instances with backup retention less than 7 days"# Multi-AZclanker ask "Show me production RDS instances without Multi-AZ"
# Check if Config is enabledclanker ask "Is AWS Config enabled in my account?"# Enable Configclanker ask --maker "enable AWS Config with all supported resources"
# Check CloudTrailclanker ask "Is CloudTrail enabled in all regions?"# Recent API callsclanker ask "Show me CloudTrail events for IAM changes in the last 24 hours"clanker ask "Find CloudTrail events with failed API calls"# Suspicious activityclanker ask "Show me CloudTrail events from unusual IP addresses"
# Public endpointsclanker k8s ask "Is my EKS cluster endpoint public?"# Cluster versionclanker k8s ask "What Kubernetes version am I running?"# Pod securityclanker k8s ask "Show me pods running as root"clanker k8s ask "Find pods without resource limits"# Network policiesclanker k8s ask "Do I have any network policies configured?"
# Enable image scanningclanker ask --maker "enable image scanning for all ECR repositories"# Check for vulnerabilitiesclanker ask "Show me ECR images with critical vulnerabilities"