From aws
Provision and sync AWS IAM resources — IAM roles, permission boundaries, IAM Identity Center permission sets, and OIDC identity provider trust policies — from a core-iam.yaml and tenant.yaml definition. Uses the AWS MCP server. Use when applying or updating IAM changes on AWS after running define-core-iam or define-tenant-iam.
How this skill is triggered — by the user, by Claude, or both
Slash command
/aws:manage-aws-iamThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Implementation
Implementation
iam:CreateRole, iam:AttachRolePolicy, iam:PutRolePermissionsBoundaryiam:CreateOpenIDConnectProvider, iam:UpdateOpenIDConnectProviderThumbprintsso-admin:CreatePermissionSet, sso-admin:ProvisionPermissionSet, sso-admin:CreateAccountAssignmentorganizations:ListAccounts, organizations:DescribeOrganizationdesign-segmentation).Apply the IAM definitions from core-iam.yaml and/or one or more tenants/{name}.yaml files to AWS. Ensure that:
Role("operator") (non-human) identities exist in the correct accounts with the correct trust policies and permission boundaries.Role("admin"), Role("contributor"), and Role("reader") roles.Role("operator") identities.This skill is idempotent: running it multiple times produces the same result.
When writing configurations or documentation, you MUST strictly adhere to the structural notation and types defined in the book. Before proceeding, read the following reference files:
references/notation.mdreferences/types.mdBefore proceeding, ask the user (or infer from context):
core-iam.yaml and/or tenants/{name}.yaml. Read these files first.(Sector, Tier) or (Sector, Tier, _, Tenant) combination. Derive from the segmentation design or ask the user.Read the IAM definition files before proceeding. Do not apply changes based on assumptions.
Read the specified IAM definition files. Extract:
Role("operator") groupsValidate the definitions:
Role("operator") groupsReport validation errors and stop. Do not apply changes against an invalid definition.
For each unique Workload Identity issuer referenced across all Role("operator") groups:
Register the OIDC provider in each account where Role("operator") roles will be created.
For each {sector}-{tier}-operator and {tenant}-{tier}-operator group:
(Sector, Tier) or (Sector, Tier, _, Tenant) coordinate.sts:AssumeRoleWithWebIdentity, restricted to the declared OIDC issuer, subject, and audience claims. Use StringEquals conditions for subject and audience — never StringLike with wildcards.Role("operator"): PowerUserAccess with a permission boundary, or a custom policy scoped to the resources the pipeline manages.IAM Identity Center permission sets represent the human-facing roles (Role("admin"), Role("contributor"), Reader). Create one permission set per role type:
| Permission Set Name | Managed Policy | Session Duration |
|---|---|---|
PlatformAdmin | AdministratorAccess | 2 hours |
PlatformContributor | PowerUserAccess | 4 hours |
PlatformReader | ReadOnlyAccess | 8 hours |
TenantAdmin | AdministratorAccess (scoped) | 2 hours |
TenantContributor | PowerUserAccess (scoped) | 4 hours |
TenantReader | ReadOnlyAccess | 8 hours |
For each permission set:
Role("admin") and Tier("live") Role("contributor") sets, configure the session duration to match the JIT window defined in the IAM definition.Prefer AWS managed policies where they fit. Use inline policies only when the scope must be narrowed further (e.g., restricting a Role("contributor") to resources within the tenant's account only).
Assign permission sets to groups and accounts:
The mapping:
| Group | Permission Set | Account(s) |
|---|---|---|
{sector}-{tier}-admins | PlatformAdmin | Account for (Sector, Tier) |
{sector}-{tier}-contributors | PlatformContributor | Account for (Sector, Tier) |
{sector}-{tier}-readers | PlatformReader | All accounts in Sector |
{tenant}-{tier}-admins | TenantAdmin | Account for (Sector, Tier, _, Tenant) |
{tenant}-{tier}-contributors | TenantContributor | Account for (Sector, Tier, _, Tenant) |
{tenant}-readers | TenantReader | All accounts for tenant's sectors |
For each assignment:
If the corporate IdP is federated via SCIM, groups are synced automatically. Reference the group by its IdP group ID or display name as supported by IAM Identity Center. If groups are managed natively in IAM Identity Center, create them and add members per the IAM definition.
AWS IAM Identity Center does not have a native JIT approval workflow equivalent to Azure PIM. Options:
Role("admin") permission sets can do without an active session — this is not true JIT but limits standing power.For each Role("admin") and Tier("live") Role("contributor") group, record the JIT strategy in the output report. Flag groups that currently have standing write access to Tier("live") accounts and recommend a remediation path.
After applying, produce a summary:
Tier("live") write access)In dry-run mode, produce the report without making changes and await confirmation.
Produce a Markdown report named aws-iam-report.md:
``markdown
Date: [timestamp] Scope: [core / tenant names applied] Mode: [applied / dry-run]
| Issuer | Account(s) | Status |
|---|---|---|
| https://token.actions.githubusercontent.com | 123456789012 | created |
Role("operator") Roles| Role Name | Account | Trust Subject | Permission Boundary | Status |
|---|---|---|---|---|
| payments-live-operator | 123456789012 | repo:mountainlab/payments-service:environment:live | attached | created |
| Name | Managed Policy | Session Duration | Status |
|---|---|---|---|
| TenantContributor | PowerUserAccess | 4h | exists |
| Group | Permission Set | Account | Status |
|---|---|---|---|
| payments-live-admins | TenantAdmin | 123456789012 | created |
| Group | Strategy | Standing Tier("live") Write | Remediation Needed |
|---|---|---|---|
| payments-live-contributors | session duration only | no | no |
[Access keys found, wildcard trust subjects, standing Tier("live") write access, etc.]
[Actions requiring manual intervention or external tooling configuration] ``
StringEquals for OIDC subject and audience claims. Warn on any wildcard. A compromised trust policy can grant arbitrary runners access to production.Role("operator") with PowerUserAccess and no boundary can escalate privileges. Always attach a boundary scoped to the tenant's resource prefix.Role("operator") identities defeat the purpose of Workload Identity. Treat any found key as a security incident.This skill is grounded in Chapter 5: Identity and Access Management of Crafting Platforms.
npx claudepluginhub craftingplatforms/ai --plugin awsBuilds least-privilege IAM setups: roles, policies, service accounts for cloud services. Generates IaC using Terraform, Pulumi, CloudFormation.
Hardens AWS IAM configurations to enforce least privilege access across cloud accounts. Covers IAM policy scoping, permission boundaries, Access Analyzer integration, and credential rotation.
Hardens AWS IAM configurations to enforce least privilege access across cloud accounts. Covers IAM policy scoping, permission boundaries, Access Analyzer integration, and credential rotation.