Skip to content

Commit 6c13c8c

Browse files
waleedlatif1claude
andcommitted
fix(iam): correct multi-resource policy simulation and tighten contracts
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LJV2dCcAYvf1JuxquCMZAd
1 parent 8c2f206 commit 6c13c8c

46 files changed

Lines changed: 1793 additions & 375 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎apps/docs/content/docs/integrations/iam.mdx‎

Lines changed: 80 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ List managed IAM policies
317317
| `region` | string | Yes | AWS region \(e.g., us-east-1\) |
318318
| `accessKeyId` | string | Yes | AWS access key ID |
319319
| `secretAccessKey` | string | Yes | AWS secret access key |
320-
| `scope` | string | No | Filter by scope: All, AWS \(AWS-managed\), or Local \(customer-managed\) |
320+
| `scope` | string | No | Filter by scope. Must be exactly one of: All, AWS \(AWS-managed\), Local \(customer-managed\) |
321321
| `onlyAttached` | boolean | No | If true, only return policies attached to an entity |
322322
| `pathPrefix` | string | No | Path prefix to filter policies |
323323
| `maxItems` | number | No | Maximum number of policies to return \(1-1000, default 100\) |
@@ -327,11 +327,41 @@ List managed IAM policies
327327

328328
| Parameter | Type | Description |
329329
| --------- | ---- | ----------- |
330-
| `policies` | json | List of policies with policyName, arn, attachmentCount, and dates |
330+
| `policies` | json | List of policies with policyName, policyId, arn, path, attachmentCount, isAttachable, defaultVersionId, permissionsBoundaryUsageCount, and dates. AWS never returns policy descriptions from ListPolicies — use IAM Get Policy for a description. |
331331
| `isTruncated` | boolean | Whether there are more results available |
332332
| `marker` | string | Pagination marker for the next page of results |
333333
| `count` | number | Number of policies returned |
334334

335+
### IAM Get Policy
336+
337+
Get details about a managed IAM policy, including its description — the field ListPolicies never returns
338+
339+
#### Input
340+
341+
| Parameter | Type | Required | Description |
342+
| --------- | ---- | -------- | ----------- |
343+
| `region` | string | Yes | AWS region \(e.g., us-east-1\) |
344+
| `accessKeyId` | string | Yes | AWS access key ID |
345+
| `secretAccessKey` | string | Yes | AWS secret access key |
346+
| `policyArn` | string | Yes | ARN of the managed policy to retrieve \(e.g., arn:aws:iam::aws:policy/ReadOnlyAccess\) |
347+
348+
#### Output
349+
350+
| Parameter | Type | Description |
351+
| --------- | ---- | ----------- |
352+
| `policyName` | string | The friendly name of the policy |
353+
| `policyId` | string | The stable unique ID of the policy |
354+
| `arn` | string | The ARN of the policy |
355+
| `path` | string | The path to the policy |
356+
| `attachmentCount` | number | Number of entities the policy is attached to |
357+
| `isAttachable` | boolean | Whether the policy can be attached |
358+
| `createDate` | string | Date the policy was created |
359+
| `updateDate` | string | Date the policy was last updated |
360+
| `description` | string | The policy description |
361+
| `defaultVersionId` | string | The identifier of the default policy version |
362+
| `permissionsBoundaryUsageCount` | number | Number of entities using the policy as a permissions boundary |
363+
| `tags` | json | Tags attached to the policy \(key, value pairs\) |
364+
335365
### IAM Create Access Key
336366

337367
Create a new access key pair for an IAM user
@@ -376,6 +406,51 @@ Delete an access key pair for an IAM user
376406
| --------- | ---- | ----------- |
377407
| `message` | string | Operation status message |
378408

409+
### IAM List Access Keys
410+
411+
List an IAM user's access key IDs with their status and age — use to find stale keys and to confirm which keys remain after a rotation
412+
413+
#### Input
414+
415+
| Parameter | Type | Required | Description |
416+
| --------- | ---- | -------- | ----------- |
417+
| `region` | string | Yes | AWS region \(e.g., us-east-1\) |
418+
| `accessKeyId` | string | Yes | AWS access key ID |
419+
| `secretAccessKey` | string | Yes | AWS secret access key |
420+
| `userName` | string | No | The IAM user whose keys to list \(defaults to the calling user if omitted\) |
421+
| `maxItems` | number | No | Maximum number of access keys to return \(1-1000\) |
422+
| `marker` | string | No | Pagination marker from a previous request |
423+
424+
#### Output
425+
426+
| Parameter | Type | Description |
427+
| --------- | ---- | ----------- |
428+
| `accessKeys` | json | Access key metadata: accessKeyId, userName, status \(Active/Inactive\), createDate. The secret access key is never returned by this operation. |
429+
| `isTruncated` | boolean | Whether there are more results available |
430+
| `marker` | string | Pagination marker for the next page of results |
431+
| `count` | number | Number of access keys returned |
432+
433+
### IAM Update Access Key
434+
435+
Activate or deactivate an IAM access key — deactivate an old key and verify nothing breaks before deleting it
436+
437+
#### Input
438+
439+
| Parameter | Type | Required | Description |
440+
| --------- | ---- | -------- | ----------- |
441+
| `region` | string | Yes | AWS region \(e.g., us-east-1\) |
442+
| `accessKeyId` | string | Yes | AWS access key ID |
443+
| `secretAccessKey` | string | Yes | AWS secret access key |
444+
| `accessKeyIdToUpdate` | string | Yes | The access key ID whose status to change |
445+
| `status` | string | Yes | The status to set. Must be exactly one of: Active, Inactive. An Inactive key is rejected by AWS but can be reactivated. |
446+
| `userName` | string | No | The IAM user that owns the key \(defaults to the calling user if omitted\) |
447+
448+
#### Output
449+
450+
| Parameter | Type | Description |
451+
| --------- | ---- | ----------- |
452+
| `message` | string | Operation status message |
453+
379454
### IAM List Groups
380455

381456
List IAM groups in your AWS account
@@ -503,15 +578,16 @@ Simulate whether a user, role, or group is allowed to perform specific AWS actio
503578
| `secretAccessKey` | string | Yes | AWS secret access key |
504579
| `policySourceArn` | string | Yes | ARN of the user, group, or role to simulate \(e.g., arn:aws:iam::123456789012:user/alice\) |
505580
| `actionNames` | string | Yes | Comma-separated list of AWS actions to simulate \(e.g., s3:GetObject,ec2:DescribeInstances\) |
506-
| `resourceArns` | string | No | Comma-separated list of resource ARNs to simulate against \(defaults to * if not provided\) |
581+
| `resourceArns` | string | No | Comma-separated list of resource ARNs to simulate against \(defaults to * if not provided\). Read the per-ARN verdict from resourceSpecificResults, not from evalDecision. |
582+
| `contextEntries` | array | No | Condition context keys to supply to the simulation. Without these, any policy gated by a Condition simulates as denied with missing context values. |
507583
| `maxResults` | number | No | Maximum number of simulation results to return \(1-1000\) |
508584
| `marker` | string | No | Pagination marker from a previous request |
509585

510586
#### Output
511587

512588
| Parameter | Type | Description |
513589
| --------- | ---- | ----------- |
514-
| `evaluationResults` | json | Simulation results per action: evalActionName, evalResourceName, evalDecision \(allowed/explicitDeny/implicitDeny\), matchedStatements \(sourcePolicyId, sourcePolicyType\), missingContextValues |
590+
| `evaluationResults` | json | One result per simulated action. evalDecision is the AGGREGATE, most-restrictive decision across every resource ARN, and evalResourceName is the resource-type ARN template \(e.g. an arn:aws:s3:::BUCKET/KEY shape with the bucket and key left as placeholders\), not a customer ARN. For the verdict on an individual ARN read resourceSpecificResults\[\]: evalResourceName, evalResourceDecision \(allowed/explicitDeny/implicitDeny\), matchedStatements, missingContextValues, permissionsBoundaryAllowed. When concrete resource ARNs are supplied, missing context values appear there rather than at the top level. |
515591
| `isTruncated` | boolean | Whether there are more results available |
516592
| `marker` | string | Pagination marker for the next page of results |
517593
| `count` | number | Number of evaluation results returned |

0 commit comments

Comments
 (0)