fix: sync e2e IAM policy and fix run eval flag - #1092
Conversation
… HTTP gateways - Add ConfigBundleManagement: CreateConfigurationBundle and related CRUD actions needed by post-deploy-config-bundles.ts - Add HttpGatewayIamRoleManagement: iam:CreateRole/DeleteRole/GetRole/ PutRolePolicy/DeleteRolePolicy scoped to arn:aws:iam::*:role/AgentCore-* needed by post-deploy-http-gateways.ts to create execution roles Without these, config-bundle-eval-rec.test.ts and ab-test-target-based.test.ts fail in CI with 403 authorization errors. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
|
Thanks for adding these. I found two IAM actions that look missing for the HTTP gateway flow — without them the e2e test will still hit AccessDenied in the same 1. Missing
|
Coverage Report
|
IAM policy (docs/policies/iam-policy-user.json): - Add BatchEvalAndRecommendation: StartBatchEvaluation, StartRecommendation and related Get/List actions (already had ConfigBundle and HttpGateway IAM) Test fix (e2e-tests/config-bundle-eval-rec.test.ts): - run eval uses --days not --lookback; fix the flag name Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Bring the documented policy fully in sync with what is deployed on the e2e-github-actions role. Adds actions that were missing from the docs: - InvokeAgentRuntimeForUser, InvokeAgentRuntimeCommand, InvokeModelWithResponseStream - DeleteApiKeyCredentialProvider, ListApiKeyCredentialProviders - Full AgentCore resource management (CreateAgentRuntime, gateways, memories, etc.) - cloudformation:*, ssm:GetParameter(s), cloudformation:GetTemplate - secretsmanager CRUD, cognito-idp for custom JWT e2e setup - HarnessManagement + HarnessPassRole - Kept ACCOUNT_ID placeholder for account-specific resources Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
CreateRoleCommand passes Tags so iam:TagRole is required. After creation, the role ARN is passed to createHttpGateway() which requires iam:PassRole on the caller. Both scoped to AgentCore-* resource. Caught by agentcore-cli-automation review on PR #1092. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…n actually grants The developer policy (docs/policies/iam-policy-user.json) drifted well beyond what PERMISSIONS.md described, after #1092 synced the e2e test runner's permission set into the shipped customer policy. Statements like HttpGatewayIamRoleManagement (iam:CreateRole/PassRole on role/AgentCore-*), CloudFormationFull (cloudformation:*), a broad SecretsManager grant on *, AgentCoreResourceManagement, HarnessManagement/HarnessPassRole (iam:PassRole on role/*), CustomJwtCognitoSetup, ConfigBundleManagement, and the ImportTest* test statements were all undocumented. This documents every statement the policy actually grants: - Expands the high-level bullet list and adds an explicit warning that the policy is a permissive superset (shared with the e2e suite), not a least-privilege policy, and can enable privilege escalation via IAM role creation. - Adds reference tables for AgentCore resource management, configuration bundles, harnesses, full CloudFormation, HTTP gateway IAM role management, Custom JWT/Cognito setup, the broad Secrets Manager grant, and the e2e-only test statements. - Extends the 'Scoping down by feature' table so admins can trim the now-documented statements toward least privilege. Closes #1683
…n actually grants (#1696) The developer policy (docs/policies/iam-policy-user.json) drifted well beyond what PERMISSIONS.md described, after #1092 synced the e2e test runner's permission set into the shipped customer policy. Statements like HttpGatewayIamRoleManagement (iam:CreateRole/PassRole on role/AgentCore-*), CloudFormationFull (cloudformation:*), a broad SecretsManager grant on *, AgentCoreResourceManagement, HarnessManagement/HarnessPassRole (iam:PassRole on role/*), CustomJwtCognitoSetup, ConfigBundleManagement, and the ImportTest* test statements were all undocumented. This documents every statement the policy actually grants: - Expands the high-level bullet list and adds an explicit warning that the policy is a permissive superset (shared with the e2e suite), not a least-privilege policy, and can enable privilege escalation via IAM role creation. - Adds reference tables for AgentCore resource management, configuration bundles, harnesses, full CloudFormation, HTTP gateway IAM role management, Custom JWT/Cognito setup, the broad Secrets Manager grant, and the e2e-only test statements. - Extends the 'Scoping down by feature' table so admins can trim the now-documented statements toward least privilege. Closes #1683
Summary
docs/policies/iam-policy-user.jsonfully with the livee2e-github-actionsrole — the doc was significantly out of datebedrock-agentcore:CreateConfigurationBundle+ CRUD (fixesconfig-bundle-eval-rec.test.ts403s)iam:CreateRole/DeleteRole/GetRole/PutRolePolicy/DeleteRolePolicyscoped toAgentCore-*(fixes HTTP gateway role creation inab-test-target-based.test.ts)bedrock-agentcore:StartBatchEvaluation,StartRecommendation+ related Get/List actions (fixes 403s in batch eval and recommendation tests)run evalCLI flag: test was passing--lookbackbut the correct flag is--daysRoot cause
Several new post-deploy operations (config bundle sync, HTTP gateway IAM role creation, batch evaluation, recommendations) were added without updating the e2e role policy or the docs. The doc had also drifted significantly from the live role.
Test plan
config-bundle-eval-rec.test.ts— deploy warnings and 403s should clearab-test-target-based.test.ts— HTTP gateway creation should succeedrun evaltest step —--daysflag resolves theunknown optionerror🤖 Generated with Claude Code