[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7B9AC9N43V6GAYEY0TN0SYB":3,"skill-same:01M7B9AC9N43V6GAYEY0TN0SYB":105},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":15,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":69,"commitSha":70,"skillDirectory":71,"forksCount":13,"repositoryHtmlUrl":72,"repositoryHomepageUrl":6,"ownerHtmlUrl":73,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":74,"install":75,"resources":88},"01M7B9AC9N43V6GAYEY0TN0SYB","securing-aws-iam-permissions",null,"Hardens AWS IAM configurations to enforce least-privilege access, covering IAM policy scoping, permission boundaries, IAM Access Analyzer integration, and credential rotation strategies. Use when reducing the blast radius of compromised AWS identities, auditing overly permissive IAM policies, or setting up permission boundaries and Access Analyzer findings review across cloud accounts.","vikasvardhanv\u002Fjerry_skills","vikasvardhanv","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F99010657?v=4","01M7B2B0VN78W7529RQX5BR6DZ","01M7B2B0WDNTXJHRK3QNPNWRP6",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fsecuring-aws-iam-permissions\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fsecuring-aws-iam-permissions\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: securing-aws-iam-permissions\ndescription: 'Hardens AWS IAM configurations to enforce least-privilege access, covering\n  IAM policy scoping, permission boundaries, IAM Access Analyzer integration, and credential\n  rotation strategies. Use when reducing the blast radius of compromised AWS identities,\n  auditing overly permissive IAM policies, or setting up permission boundaries and\n  Access Analyzer findings review across cloud accounts.\n\n  '\ndomain: cybersecurity\nsubdomain: cloud-security\ntags:\n- aws-iam\n- least-privilege\n- permission-boundaries\n- access-analyzer\n- cloud-identity\nversion: 1.0.0\nauthor: mahipal\nlicense: Apache-2.0\nnist_csf:\n- PR.IR-01\n- ID.AM-08\n- GV.SC-06\n- DE.CM-01\nmitre_attack:\n- T1078.004\n- T1530\n- T1537\n- T1580\n- T1003\nmitre_f3:\n  version: '1.1'\n  tactics:\n  - initial-access\n  - positioning\n  techniques:\n  - id: F1006.001\n    name: 'Account Takeover: Exposed API Key'\n    tactic: initial-access\n    source: f3\n  - id: F1006.002\n    name: 'Account Takeover: Exposed Login Credential'\n    tactic: initial-access\n    source: f3\n  - id: T1550.001\n    name: 'Use Alternate Authentication Material: Application Access Token'\n    tactic: initial-access\n    source: attack\n  - id: T1110.003\n    name: 'Brute Force: Password Spraying'\n    tactic: initial-access\n    source: attack\n  - id: F1005.004\n    name: 'Account Manipulation: Change Account Details'\n    tactic: positioning\n    source: f3\n---\n\n# Securing AWS IAM Permissions\n\n## When to Use\n\n- When onboarding new AWS accounts or workloads that require scoped IAM policies\n- When IAM Access Analyzer reports overly permissive policies or unused permissions\n- When preparing for a compliance audit requiring least privilege evidence (SOC 2, PCI-DSS)\n- When migrating from long-lived access keys to short-lived role-based credentials\n- When remediating findings from AWS Security Hub related to IAM misconfigurations\n\n**Do not use** for Azure AD or Google Cloud IAM configurations, application-level authorization logic, or federated identity provider setup (see managing-cloud-identity-with-okta).\n\n## Prerequisites\n\n- AWS account with administrative access or IAM:FullAccess permissions\n- AWS CLI v2 installed and configured with named profiles\n- AWS CloudTrail enabled for at least 90 days of API activity history\n- Familiarity with JSON-based IAM policy syntax and ARN resource notation\n\n## Workflow\n\n### Step 1: Inventory Existing IAM Entities and Policies\n\nGenerate a comprehensive inventory of all IAM users, roles, groups, and attached policies using the AWS CLI and IAM credential reports. Identify accounts with console access, programmatic access keys, and their last-used timestamps.\n\n```bash\n# Generate IAM credential report\naws iam generate-credential-report\naws iam get-credential-report --query 'Content' --output text | base64 -d > iam-report.csv\n\n# List all IAM roles and their attached policies\naws iam list-roles --query 'Roles[*].[RoleName,Arn,CreateDate]' --output table\n\n# Find users with access keys older than 90 days\naws iam list-users --query 'Users[*].UserName' --output text | while read user; do\n  aws iam list-access-keys --user-name \"$user\" \\\n    --query \"AccessKeyMetadata[?CreateDate\u003C='$(date -d '-90 days' +%Y-%m-%d)'].[UserName,AccessKeyId,Status,CreateDate]\" \\\n    --output table\ndone\n```\n\n### Step 2: Enable and Analyze IAM Access Analyzer Findings\n\nActivate IAM Access Analyzer at the organization or account level to identify resources shared externally and generate least-privilege policy recommendations based on CloudTrail activity.\n\n```bash\n# Create an Access Analyzer for the account\naws accessanalyzer create-analyzer \\\n  --analyzer-name account-analyzer \\\n  --type ACCOUNT\n\n# List active findings for external access\naws accessanalyzer list-findings \\\n  --analyzer-arn arn:aws:access-analyzer:us-east-1:123456789012:analyzer\u002Faccount-analyzer \\\n  --filter '{\"status\": {\"eq\": [\"ACTIVE\"]}}'\n\n# Generate a policy based on CloudTrail activity for a specific role\naws accessanalyzer start-policy-generation \\\n  --policy-generation-details '{\n    \"principalArn\": \"arn:aws:iam::123456789012:role\u002FAppRole\",\n    \"cloudTrailDetails\": {\n      \"trailArn\": \"arn:aws:cloudtrail:us-east-1:123456789012:trail\u002Fmanagement-trail\",\n      \"startTime\": \"2025-01-01T00:00:00Z\",\n      \"endTime\": \"2025-03-01T00:00:00Z\"\n    }\n  }'\n```\n\n### Step 3: Scope Policies to Specific Resources and Conditions\n\nReplace wildcard resource ARNs with specific resource identifiers. Add IAM policy conditions for MFA enforcement, source IP restrictions, and time-based access windows.\n\n```json\n{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [\n    {\n      \"Sid\": \"AllowS3ReadSpecificBucket\",\n      \"Effect\": \"Allow\",\n      \"Action\": [\n        \"s3:GetObject\",\n        \"s3:ListBucket\"\n      ],\n      \"Resource\": [\n        \"arn:aws:s3:::production-data-bucket\",\n        \"arn:aws:s3:::production-data-bucket\u002F*\"\n      ],\n      \"Condition\": {\n        \"Bool\": {\"aws:MultiFactorAuthPresent\": \"true\"},\n        \"IpAddress\": {\"aws:SourceIp\": \"10.0.0.0\u002F8\"},\n        \"DateGreaterThan\": {\"aws:CurrentTime\": \"2025-01-01T00:00:00Z\"}\n      }\n    }\n  ]\n}\n```\n\n### Step 4: Implement Permission Boundaries\n\nAttach permission boundaries to IAM roles and users to define the maximum scope of permissions an entity can receive, preventing privilege escalation even if an administrator attaches an overly permissive policy.\n\n```bash\n# Create a permission boundary policy\naws iam create-policy \\\n  --policy-name DeveloperPermissionBoundary \\\n  --policy-document file:\u002F\u002Fdeveloper-boundary.json\n\n# Attach the boundary to an IAM role\naws iam put-role-permissions-boundary \\\n  --role-name DeveloperRole \\\n  --permissions-boundary \"arn:aws:iam::123456789012:policy\u002FDeveloperPermissionBoundary\"\n```\n\n```json\n{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [\n    {\n      \"Sid\": \"AllowCommonServices\",\n      \"Effect\": \"Allow\",\n      \"Action\": [\n        \"s3:*\",\n        \"dynamodb:*\",\n        \"lambda:*\",\n        \"logs:*\",\n        \"cloudwatch:*\"\n      ],\n      \"Resource\": \"*\"\n    },\n    {\n      \"Sid\": \"DenyIAMChanges\",\n      \"Effect\": \"Deny\",\n      \"Action\": [\n        \"iam:CreateUser\",\n        \"iam:DeleteUser\",\n        \"iam:CreateRole\",\n        \"iam:DeleteRole\",\n        \"iam:AttachRolePolicy\",\n        \"iam:PutRolePermissionsBoundary\"\n      ],\n      \"Resource\": \"*\"\n    }\n  ]\n}\n```\n\n### Step 5: Enforce MFA and Eliminate Long-Lived Credentials\n\nRequire MFA for all human users accessing the AWS console and CLI. Migrate workloads from IAM user access keys to IAM roles with temporary credentials via STS AssumeRole.\n\n```bash\n# Enforce MFA via SCP at the organization level\naws organizations create-policy \\\n  --name RequireMFA \\\n  --type SERVICE_CONTROL_POLICY \\\n  --content '{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n      {\n        \"Sid\": \"DenyAllExceptMFA\",\n        \"Effect\": \"Deny\",\n        \"NotAction\": [\n          \"iam:CreateVirtualMFADevice\",\n          \"iam:EnableMFADevice\",\n          \"iam:ListMFADevices\",\n          \"iam:ResyncMFADevice\",\n          \"sts:GetSessionToken\"\n        ],\n        \"Resource\": \"*\",\n        \"Condition\": {\n          \"BoolIfExists\": {\"aws:MultiFactorAuthPresent\": \"false\"}\n        }\n      }\n    ]\n  }'\n\n# Deactivate unused access keys\naws iam update-access-key --user-name old-user --access-key-id AKIAEXAMPLE --status Inactive\n```\n\n### Step 6: Automate Continuous IAM Monitoring\n\nDeploy AWS Config rules and Security Hub controls to continuously evaluate IAM posture. Set up EventBridge rules to alert on high-risk IAM changes such as new root access key creation or policy modifications.\n\n```bash\n# Enable AWS Config rule for IAM password policy\naws configservice put-config-rule \\\n  --config-rule '{\n    \"ConfigRuleName\": \"iam-password-policy\",\n    \"Source\": {\n      \"Owner\": \"AWS\",\n      \"SourceIdentifier\": \"IAM_PASSWORD_POLICY\"\n    },\n    \"InputParameters\": \"{\\\"RequireUppercaseCharacters\\\":\\\"true\\\",\\\"RequireLowercaseCharacters\\\":\\\"true\\\",\\\"RequireSymbols\\\":\\\"true\\\",\\\"RequireNumbers\\\":\\\"true\\\",\\\"MinimumPasswordLength\\\":\\\"14\\\",\\\"MaxPasswordAge\\\":\\\"90\\\"}\"\n  }'\n\n# EventBridge rule to detect root account usage\naws events put-rule \\\n  --name DetectRootUsage \\\n  --event-pattern '{\n    \"detail-type\": [\"AWS API Call via CloudTrail\"],\n    \"detail\": {\n      \"userIdentity\": {\"type\": [\"Root\"]}\n    }\n  }'\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| Least Privilege | Granting only the minimum permissions required for an identity to perform its function |\n| Permission Boundary | An advanced IAM feature that sets the maximum permissions an entity can have, regardless of attached policies |\n| IAM Access Analyzer | AWS service that uses automated reasoning to identify resources shared externally and generate least-privilege policies from CloudTrail activity |\n| Service Control Policy (SCP) | Organization-level policy that sets permission guardrails across all accounts in an AWS Organization |\n| Assume Role | STS operation that returns temporary security credentials for cross-account or service-to-service access |\n| Credential Report | AWS-generated CSV listing all IAM users, their access keys, MFA status, and last activity timestamps |\n| Policy Condition | Constraints in IAM policies that restrict when and how permissions apply, such as MFA requirements or IP ranges |\n| Identity Federation | Allowing external identity providers to grant temporary AWS access without creating IAM users |\n\n## Tools & Systems\n\n- **AWS IAM Access Analyzer**: Generates least-privilege policies from CloudTrail activity and identifies resources shared with external entities\n- **AWS Config**: Continuously evaluates IAM configuration compliance against managed and custom rules\n- **AWS Security Hub**: Aggregates IAM security findings from Access Analyzer, Config, and third-party tools into a unified dashboard\n- **IAM Policy Simulator**: Tests the effects of IAM policies before deployment by simulating API calls against policy evaluation logic\n- **Prowler**: Open-source AWS security assessment tool that runs over 300 checks including IAM best practices and CIS benchmark controls\n\n## Common Scenarios\n\n### Scenario: Developer Role Over-Provisioned with AdministratorAccess\n\n**Context**: A startup attached the AWS-managed AdministratorAccess policy to all developer roles for speed during early development. A security audit reveals 15 roles with full account access while developers only use S3, Lambda, and DynamoDB.\n\n**Approach**:\n1. Enable IAM Access Analyzer and generate policy recommendations based on 90 days of CloudTrail data for each role\n2. Create scoped policies allowing only the specific S3 buckets, Lambda functions, and DynamoDB tables each team accesses\n3. Attach a permission boundary denying IAM, Organizations, and billing actions\n4. Deploy the new policies in a parallel role with CloudTrail monitoring before replacing the original\n5. Remove AdministratorAccess and rotate all access keys\n\n**Pitfalls**: Replacing policies without a parallel testing period causes service disruptions. Forgetting to scope Lambda:InvokeFunction to specific function ARNs leaves lateral movement paths open.\n\n### Scenario: Rotating Compromised Access Keys Across Multiple Services\n\n**Context**: An access key is found in a public GitHub repository. The key belongs to an IAM user with S3 and EC2 permissions across three AWS accounts.\n\n**Approach**:\n1. Immediately deactivate the compromised key using `aws iam update-access-key --status Inactive`\n2. Review CloudTrail logs for all API calls made with the compromised key in the past 30 days\n3. Create a new access key for the user and update all dependent services and CI\u002FCD pipelines\n4. Delete the compromised key after confirming all services use the new credentials\n5. Migrate the workload to use IAM roles with STS temporary credentials to prevent future key exposure\n\n**Pitfalls**: Deleting the key before deactivating it prevents forensic analysis of which services relied on it. Failing to check all three accounts for unauthorized activity leaves potential backdoors undetected.\n\n## Output Format\n\n```\nIAM Security Assessment Report\n==============================\nAccount ID: 123456789012\nAssessment Date: 2025-02-23\nAnalyzer: IAM Access Analyzer + Prowler v4.3\n\nCRITICAL FINDINGS:\n[C-001] Root account has active access keys\n  - Resource: arn:aws:iam::123456789012:root\n  - Remediation: Delete root access keys, enable MFA on root\n  - CIS Benchmark: 1.4 (Ensure no root account access key exists)\n\n[C-002] IAM user 'deploy-bot' has AdministratorAccess with no MFA\n  - Resource: arn:aws:iam::123456789012:user\u002Fdeploy-bot\n  - Last Activity: 2025-02-20\n  - Remediation: Replace with IAM role, enforce MFA condition\n\nHIGH FINDINGS:\n[H-001] 3 IAM policies use wildcard Resource \"*\" with sensitive actions\n  - Policies: DevPolicy, CIPolicy, LegacyAdminPolicy\n  - Remediation: Scope resources to specific ARNs using Access Analyzer\n\n[H-002] 7 access keys older than 90 days detected\n  - Users: svc-backup, svc-monitoring, dev-alice, dev-bob, ...\n  - Remediation: Rotate keys, migrate to role-based access\n\nSUMMARY:\n  Total Findings: 14\n  Critical: 2 | High: 4 | Medium: 5 | Low: 3\n  Compliance Score: 62% (CIS AWS Foundations Benchmark v3.0)\n```\n","# Securing AWS IAM Permissions\n\n## When to Use\n\n- When onboarding new AWS accounts or workloads that require scoped IAM policies\n- When IAM Access Analyzer reports overly permissive policies or unused permissions\n- When preparing for a compliance audit requiring least privilege evidence (SOC 2, PCI-DSS)\n- When migrating from long-lived access keys to short-lived role-based credentials\n- When remediating findings from AWS Security Hub related to IAM misconfigurations\n\n**Do not use** for Azure AD or Google Cloud IAM configurations, application-level authorization logic, or federated identity provider setup (see managing-cloud-identity-with-okta).\n\n## Prerequisites\n\n- AWS account with administrative access or IAM:FullAccess permissions\n- AWS CLI v2 installed and configured with named profiles\n- AWS CloudTrail enabled for at least 90 days of API activity history\n- Familiarity with JSON-based IAM policy syntax and ARN resource notation\n\n## Workflow\n\n### Step 1: Inventory Existing IAM Entities and Policies\n\nGenerate a comprehensive inventory of all IAM users, roles, groups, and attached policies using the AWS CLI and IAM credential reports. Identify accounts with console access, programmatic access keys, and their last-used timestamps.\n\n```bash\n# Generate IAM credential report\naws iam generate-credential-report\naws iam get-credential-report --query 'Content' --output text | base64 -d > iam-report.csv\n\n# List all IAM roles and their attached policies\naws iam list-roles --query 'Roles[*].[RoleName,Arn,CreateDate]' --output table\n\n# Find users with access keys older than 90 days\naws iam list-users --query 'Users[*].UserName' --output text | while read user; do\n  aws iam list-access-keys --user-name \"$user\" \\\n    --query \"AccessKeyMetadata[?CreateDate\u003C='$(date -d '-90 days' +%Y-%m-%d)'].[UserName,AccessKeyId,Status,CreateDate]\" \\\n    --output table\ndone\n```\n\n### Step 2: Enable and Analyze IAM Access Analyzer Findings\n\nActivate IAM Access Analyzer at the organization or account level to identify resources shared externally and generate least-privilege policy recommendations based on CloudTrail activity.\n\n```bash\n# Create an Access Analyzer for the account\naws accessanalyzer create-analyzer \\\n  --analyzer-name account-analyzer \\\n  --type ACCOUNT\n\n# List active findings for external access\naws accessanalyzer list-findings \\\n  --analyzer-arn arn:aws:access-analyzer:us-east-1:123456789012:analyzer\u002Faccount-analyzer \\\n  --filter '{\"status\": {\"eq\": [\"ACTIVE\"]}}'\n\n# Generate a policy based on CloudTrail activity for a specific role\naws accessanalyzer start-policy-generation \\\n  --policy-generation-details '{\n    \"principalArn\": \"arn:aws:iam::123456789012:role\u002FAppRole\",\n    \"cloudTrailDetails\": {\n      \"trailArn\": \"arn:aws:cloudtrail:us-east-1:123456789012:trail\u002Fmanagement-trail\",\n      \"startTime\": \"2025-01-01T00:00:00Z\",\n      \"endTime\": \"2025-03-01T00:00:00Z\"\n    }\n  }'\n```\n\n### Step 3: Scope Policies to Specific Resources and Conditions\n\nReplace wildcard resource ARNs with specific resource identifiers. Add IAM policy conditions for MFA enforcement, source IP restrictions, and time-based access windows.\n\n```json\n{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [\n    {\n      \"Sid\": \"AllowS3ReadSpecificBucket\",\n      \"Effect\": \"Allow\",\n      \"Action\": [\n        \"s3:GetObject\",\n        \"s3:ListBucket\"\n      ],\n      \"Resource\": [\n        \"arn:aws:s3:::production-data-bucket\",\n        \"arn:aws:s3:::production-data-bucket\u002F*\"\n      ],\n      \"Condition\": {\n        \"Bool\": {\"aws:MultiFactorAuthPresent\": \"true\"},\n        \"IpAddress\": {\"aws:SourceIp\": \"10.0.0.0\u002F8\"},\n        \"DateGreaterThan\": {\"aws:CurrentTime\": \"2025-01-01T00:00:00Z\"}\n      }\n    }\n  ]\n}\n```\n\n### Step 4: Implement Permission Boundaries\n\nAttach permission boundaries to IAM roles and users to define the maximum scope of permissions an entity can receive, preventing privilege escalation even if an administrator attaches an overly permissive policy.\n\n```bash\n# Create a permission boundary policy\naws iam create-policy \\\n  --policy-name DeveloperPermissionBoundary \\\n  --policy-document file:\u002F\u002Fdeveloper-boundary.json\n\n# Attach the boundary to an IAM role\naws iam put-role-permissions-boundary \\\n  --role-name DeveloperRole \\\n  --permissions-boundary \"arn:aws:iam::123456789012:policy\u002FDeveloperPermissionBoundary\"\n```\n\n```json\n{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [\n    {\n      \"Sid\": \"AllowCommonServices\",\n      \"Effect\": \"Allow\",\n      \"Action\": [\n        \"s3:*\",\n        \"dynamodb:*\",\n        \"lambda:*\",\n        \"logs:*\",\n        \"cloudwatch:*\"\n      ],\n      \"Resource\": \"*\"\n    },\n    {\n      \"Sid\": \"DenyIAMChanges\",\n      \"Effect\": \"Deny\",\n      \"Action\": [\n        \"iam:CreateUser\",\n        \"iam:DeleteUser\",\n        \"iam:CreateRole\",\n        \"iam:DeleteRole\",\n        \"iam:AttachRolePolicy\",\n        \"iam:PutRolePermissionsBoundary\"\n      ],\n      \"Resource\": \"*\"\n    }\n  ]\n}\n```\n\n### Step 5: Enforce MFA and Eliminate Long-Lived Credentials\n\nRequire MFA for all human users accessing the AWS console and CLI. Migrate workloads from IAM user access keys to IAM roles with temporary credentials via STS AssumeRole.\n\n```bash\n# Enforce MFA via SCP at the organization level\naws organizations create-policy \\\n  --name RequireMFA \\\n  --type SERVICE_CONTROL_POLICY \\\n  --content '{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n      {\n        \"Sid\": \"DenyAllExceptMFA\",\n        \"Effect\": \"Deny\",\n        \"NotAction\": [\n          \"iam:CreateVirtualMFADevice\",\n          \"iam:EnableMFADevice\",\n          \"iam:ListMFADevices\",\n          \"iam:ResyncMFADevice\",\n          \"sts:GetSessionToken\"\n        ],\n        \"Resource\": \"*\",\n        \"Condition\": {\n          \"BoolIfExists\": {\"aws:MultiFactorAuthPresent\": \"false\"}\n        }\n      }\n    ]\n  }'\n\n# Deactivate unused access keys\naws iam update-access-key --user-name old-user --access-key-id AKIAEXAMPLE --status Inactive\n```\n\n### Step 6: Automate Continuous IAM Monitoring\n\nDeploy AWS Config rules and Security Hub controls to continuously evaluate IAM posture. Set up EventBridge rules to alert on high-risk IAM changes such as new root access key creation or policy modifications.\n\n```bash\n# Enable AWS Config rule for IAM password policy\naws configservice put-config-rule \\\n  --config-rule '{\n    \"ConfigRuleName\": \"iam-password-policy\",\n    \"Source\": {\n      \"Owner\": \"AWS\",\n      \"SourceIdentifier\": \"IAM_PASSWORD_POLICY\"\n    },\n    \"InputParameters\": \"{\\\"RequireUppercaseCharacters\\\":\\\"true\\\",\\\"RequireLowercaseCharacters\\\":\\\"true\\\",\\\"RequireSymbols\\\":\\\"true\\\",\\\"RequireNumbers\\\":\\\"true\\\",\\\"MinimumPasswordLength\\\":\\\"14\\\",\\\"MaxPasswordAge\\\":\\\"90\\\"}\"\n  }'\n\n# EventBridge rule to detect root account usage\naws events put-rule \\\n  --name DetectRootUsage \\\n  --event-pattern '{\n    \"detail-type\": [\"AWS API Call via CloudTrail\"],\n    \"detail\": {\n      \"userIdentity\": {\"type\": [\"Root\"]}\n    }\n  }'\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| Least Privilege | Granting only the minimum permissions required for an identity to perform its function |\n| Permission Boundary | An advanced IAM feature that sets the maximum permissions an entity can have, regardless of attached policies |\n| IAM Access Analyzer | AWS service that uses automated reasoning to identify resources shared externally and generate least-privilege policies from CloudTrail activity |\n| Service Control Policy (SCP) | Organization-level policy that sets permission guardrails across all accounts in an AWS Organization |\n| Assume Role | STS operation that returns temporary security credentials for cross-account or service-to-service access |\n| Credential Report | AWS-generated CSV listing all IAM users, their access keys, MFA status, and last activity timestamps |\n| Policy Condition | Constraints in IAM policies that restrict when and how permissions apply, such as MFA requirements or IP ranges |\n| Identity Federation | Allowing external identity providers to grant temporary AWS access without creating IAM users |\n\n## Tools & Systems\n\n- **AWS IAM Access Analyzer**: Generates least-privilege policies from CloudTrail activity and identifies resources shared with external entities\n- **AWS Config**: Continuously evaluates IAM configuration compliance against managed and custom rules\n- **AWS Security Hub**: Aggregates IAM security findings from Access Analyzer, Config, and third-party tools into a unified dashboard\n- **IAM Policy Simulator**: Tests the effects of IAM policies before deployment by simulating API calls against policy evaluation logic\n- **Prowler**: Open-source AWS security assessment tool that runs over 300 checks including IAM best practices and CIS benchmark controls\n\n## Common Scenarios\n\n### Scenario: Developer Role Over-Provisioned with AdministratorAccess\n\n**Context**: A startup attached the AWS-managed AdministratorAccess policy to all developer roles for speed during early development. A security audit reveals 15 roles with full account access while developers only use S3, Lambda, and DynamoDB.\n\n**Approach**:\n1. Enable IAM Access Analyzer and generate policy recommendations based on 90 days of CloudTrail data for each role\n2. Create scoped policies allowing only the specific S3 buckets, Lambda functions, and DynamoDB tables each team accesses\n3. Attach a permission boundary denying IAM, Organizations, and billing actions\n4. Deploy the new policies in a parallel role with CloudTrail monitoring before replacing the original\n5. Remove AdministratorAccess and rotate all access keys\n\n**Pitfalls**: Replacing policies without a parallel testing period causes service disruptions. Forgetting to scope Lambda:InvokeFunction to specific function ARNs leaves lateral movement paths open.\n\n### Scenario: Rotating Compromised Access Keys Across Multiple Services\n\n**Context**: An access key is found in a public GitHub repository. The key belongs to an IAM user with S3 and EC2 permissions across three AWS accounts.\n\n**Approach**:\n1. Immediately deactivate the compromised key using `aws iam update-access-key --status Inactive`\n2. Review CloudTrail logs for all API calls made with the compromised key in the past 30 days\n3. Create a new access key for the user and update all dependent services and CI\u002FCD pipelines\n4. Delete the compromised key after confirming all services use the new credentials\n5. Migrate the workload to use IAM roles with STS temporary credentials to prevent future key exposure\n\n**Pitfalls**: Deleting the key before deactivating it prevents forensic analysis of which services relied on it. Failing to check all three accounts for unauthorized activity leaves potential backdoors undetected.\n\n## Output Format\n\n```\nIAM Security Assessment Report\n==============================\nAccount ID: 123456789012\nAssessment Date: 2025-02-23\nAnalyzer: IAM Access Analyzer + Prowler v4.3\n\nCRITICAL FINDINGS:\n[C-001] Root account has active access keys\n  - Resource: arn:aws:iam::123456789012:root\n  - Remediation: Delete root access keys, enable MFA on root\n  - CIS Benchmark: 1.4 (Ensure no root account access key exists)\n\n[C-002] IAM user 'deploy-bot' has AdministratorAccess with no MFA\n  - Resource: arn:aws:iam::123456789012:user\u002Fdeploy-bot\n  - Last Activity: 2025-02-20\n  - Remediation: Replace with IAM role, enforce MFA condition\n\nHIGH FINDINGS:\n[H-001] 3 IAM policies use wildcard Resource \"*\" with sensitive actions\n  - Policies: DevPolicy, CIPolicy, LegacyAdminPolicy\n  - Remediation: Scope resources to specific ARNs using Access Analyzer\n\n[H-002] 7 access keys older than 90 days detected\n  - Users: svc-backup, svc-monitoring, dev-alice, dev-bob, ...\n  - Remediation: Rotate keys, migrate to role-based access\n\nSUMMARY:\n  Total Findings: 14\n  Critical: 2 | High: 4 | Medium: 5 | Low: 3\n  Compliance Score: 62% (CIS AWS Foundations Benchmark v3.0)\n```\n",{"name":5,"tags":24,"author":30,"domain":31,"license":14,"version":32,"mitre_f3":33,"nist_csf":56,"subdomain":61,"description":62,"mitre_attack":63},[25,26,27,28,29],"aws-iam","least-privilege","permission-boundaries","access-analyzer","cloud-identity","mahipal","cybersecurity","1.0.0",{"tactics":34,"version":37,"techniques":38},[35,36],"initial-access","positioning","1.1",[39,43,46,50,53],{"id":40,"name":41,"source":42,"tactic":35},"F1006.001","Account Takeover: Exposed API Key","f3",{"id":44,"name":45,"source":42,"tactic":35},"F1006.002","Account Takeover: Exposed Login Credential",{"id":47,"name":48,"source":49,"tactic":35},"T1550.001","Use Alternate Authentication Material: Application Access Token","attack",{"id":51,"name":52,"source":49,"tactic":35},"T1110.003","Brute Force: Password Spraying",{"id":54,"name":55,"source":42,"tactic":36},"F1005.004","Account Manipulation: Change Account Details",[57,58,59,60],"PR.IR-01","ID.AM-08","GV.SC-06","DE.CM-01","cloud-security","Hardens AWS IAM configurations to enforce least-privilege access, covering IAM policy scoping, permission boundaries, IAM Access Analyzer integration, and credential rotation strategies. Use when reducing the blast radius of compromised AWS identities, auditing overly permissive IAM policies, or setting up permission boundaries and Access Analyzer findings review across cloud accounts.\n",[64,65,66,67,68],"T1078.004","T1530","T1537","T1580","T1003","main","1eb986d0b0ecc180291597e08eb5a58288843536","skills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fsecuring-aws-iam-permissions","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv","2026-08-25 13:16:33",{"source":8,"skillName":5,"commands":76,"prompt":86,"zipAvailable":87},[77,80,83],{"tool":78,"command":79},"npx","npx skills add vikasvardhanv\u002Fjerry_skills --skill securing-aws-iam-permissions",{"tool":81,"command":82},"bunx","bunx skills add vikasvardhanv\u002Fjerry_skills --skill securing-aws-iam-permissions",{"tool":84,"command":85},"pnpm","pnpm dlx skills add vikasvardhanv\u002Fjerry_skills --skill securing-aws-iam-permissions","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fsecuring-aws-iam-permissions\u002FSKILL.md",true,[89,93,99],{"path":90,"resourceType":90,"resourceTypeDesc":91,"sizeBytes":92,"sourceHtmlUrl":15},"LICENSE","许可证",11255,{"path":94,"resourceType":95,"resourceTypeDesc":96,"sizeBytes":97,"sourceHtmlUrl":98},"references\u002Fapi-reference.md","REFERENCE","参考文档",2325,"https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fsecuring-aws-iam-permissions\u002Freferences\u002Fapi-reference.md",{"path":100,"resourceType":101,"resourceTypeDesc":102,"sizeBytes":103,"sourceHtmlUrl":104},"scripts\u002Fagent.py","SCRIPT","脚本",7710,"https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fsecuring-aws-iam-permissions\u002Fscripts\u002Fagent.py",[106,114,121,128,135,142],{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":110,"licenseFileUrl":6,"sourceHtmlUrl":111,"categories":112,"keywords":113,"publishedAt":19},"01M7BESR1CJ3H5SP9XM8KYJZ9W","syllabus","Generates a curated supplementary reading list from any course syllabus using Consensus academic search. Grill-me intake (syllabus input format + course audience + year range) plus a grouping forcing-options checkpoint before any search runs — so the reading list matches the course's level and recency need. Parses the syllabus to extract topics and learning outcomes, searches Consensus for recent peer-reviewed papers per topic, and produces a professionally formatted .docx with clickable Consensus links, plain-language summaries calibrated to audience level, and Bloom-higher-order discussion questions tied to course learning goals. Use when the user uploads a syllabus, course outline, or curriculum document and wants supplementary readings (e.g., 'create a reading list from this syllabus', 'find recent papers for my course') — even casual mentions with a syllabus attached should trigger this skill.","MIT","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fsyllabus\u002Fskills\u002Fsyllabus\u002FSKILL.md",[],[],{"skillNo":115,"name":116,"nameZh":6,"description":117,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":110,"licenseFileUrl":6,"sourceHtmlUrl":118,"categories":119,"keywords":120,"publishedAt":19},"01M7BES1YA6R97W7QPMFFM1PED","pulse","Multi-source recency research skill that takes the pulse of any topic across Reddit, Hacker News, the open web, and optionally X\u002FTwitter within a configurable recent window (default 30 days). Forcing intake clarifies topic specificity, angle (trend\u002Fsentiment\u002Fproblems\u002Fopportunities\u002Fcomparison), time window, and platform scope before searching. Returns a synthesized briefing with citations, engagement metrics, and cross-platform pattern analysis. Use when the user requests multi-source recency intelligence on a topic (e.g., 'pulse on [topic]', 'what's happening with [topic]', 'what are people saying about [topic]', 'current conversation about [topic]', 'take the pulse of [topic]', 'trending: [topic]', 'find me info on [topic]'), and for competitor research, trend discovery, tool comparisons, and audience sentiment analysis.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fpulse\u002Fskills\u002Fpulse\u002FSKILL.md",[],[],{"skillNo":122,"name":123,"nameZh":6,"description":124,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":110,"licenseFileUrl":6,"sourceHtmlUrl":125,"categories":126,"keywords":127,"publishedAt":19},"01M7BERNHYGY035AR00VRT03KE","patent","Patent prior-art and landscape intelligence skill — not generic patent help. Commits to one of five sub-use-cases via forcing intake (novelty search \u002F freedom-to-operate \u002F competitive landscape \u002F acquisition diligence \u002F litigation prior-art) before any search runs. Searches Google Patents, Espacenet, USPTO, and optionally Lens.org for citation-graph signals. Output is an editable Word document (.docx) with verdict, ranked closest art (claim-text extracted), CPC-class-aware landscape, family-resolved hits, geographic coverage, FTO flags where applicable, strategy recommendations, and full audit log. Use when the user asks for patent searching or analysis (e.g., 'prior art search for [invention]', 'freedom to operate analysis for [product]'). Produces search signal, not legal advice — always recommends consulting a patent attorney before filing or licensing decisions. Trademark, copyright, and trade-secret questions are out of scope.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fpatent\u002Fskills\u002Fpatent\u002FSKILL.md",[],[],{"skillNo":129,"name":130,"nameZh":6,"description":131,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":110,"licenseFileUrl":6,"sourceHtmlUrl":132,"categories":133,"keywords":134,"publishedAt":19},"01M7BERCK1EAKTWW7R436WAR0J","notebooklm","Browser automation skill for controlling Google's NotebookLM. Use when the user wants anything done in NotebookLM (e.g., 'open NotebookLM', 'check my [name] notebook', 'ask my notebook about X', 'add [source] to NotebookLM', 'generate a Video Overview from my notebook', 'use NotebookLM Studio'). Handles reading and querying notebooks, adding sources (URLs, text, files, YouTube links, synthesized content), generating Studio outputs (Audio\u002FVideo Overviews, Mind Maps, Reports incl. Briefing Doc\u002FStudy Guide\u002FFAQ, Flashcards, Quiz, slide decks, infographics — discover the exact set from the live Studio panel; the UI evolves fast), and creating new notebooks. Requires browser automation environment — fails gracefully when unavailable.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fnotebooklm\u002Fskills\u002Fnotebooklm\u002FSKILL.md",[],[],{"skillNo":136,"name":137,"nameZh":6,"description":138,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":110,"licenseFileUrl":6,"sourceHtmlUrl":139,"categories":140,"keywords":141,"publishedAt":19},"01M7BEQZAZAQRTXFJRY7RHV3TY","litreview","Academic literature orientation skill that searches papers via free keyless APIs (PubMed E-utilities + OpenAlex) by default — with the Consensus MCP as an optional enhancement lane when connected — builds a strategic search plan using PICO (default) or SPIDER \u002F Decomposition \u002F hybrid as fallbacks, and synthesizes findings into a formatted Word (.docx) research guide. Grill-me intake (research question specificity + framework hint + tentative depth) before the recon search; a second forcing checkpoint after Phase 2 confirms framework + sub-areas + depth before searches consume budget. Configurable depth (5\u002F10\u002F20 queries) controls coverage vs. speed. Output is a 'launching pad' — an orientation guide that lets a researcher dive in confidently, not a finished review. Use when the user starts literature-oriented research (e.g., 'litreview on [topic]', 'literature review on [topic]', 'I'm starting a literature review on X', 'I'm writing a paper on X', 'help me research X', 'I'm doing research on X', 'can you help me research X'). Do NOT use for single one-off paper searches wanting a quick list — that's a plain PubMed\u002FOpenAlex (or Consensus) query.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Flitreview\u002Fskills\u002Flitreview\u002FSKILL.md",[],[],{"skillNo":143,"name":144,"nameZh":6,"description":145,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":110,"licenseFileUrl":6,"sourceHtmlUrl":146,"categories":147,"keywords":148,"publishedAt":19},"01M7BEQKJ45K31QK5VRAQSVJCJ","grants","NIH grant research skill for clinical researchers. Grill-me intake (research idea + career stage + preliminary data + environment + submission posture + known institute targets) locks down the funding strategy before any search runs. Runs a 5-facet Consensus positioning analysis (with draft Significance\u002FInnovation language), maps the research to the right NIH institutes and study sections via RePORTER, finds NOSIs and funded overlap, and produces an editable Word document (.docx) with budget\u002Fscope-aware mechanism recommendations, submission timelines, and a mandatory program officer recommendation. Use when the user asks about research funding or makes any grant-related request (e.g., 'grants for [topic]', 'find grants for my research idea', 'what grants match my research', 'help me find NIH funding', 'grant opportunities for my research'). NIH-only scope — non-NIH funders (PCORI, DOD CDMRP, VA, foundations) are out of scope and flagged at intake.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fgrants\u002Fskills\u002Fgrants\u002FSKILL.md",[],[]]