Skip to content

fix(stepfunctions-tasks): scope SubmitBatchJob IAM permissions to specific job definition#37248

Open
Nananao wants to merge 2 commits intoaws:mainfrom
Nananao:fix/submit-batch-job-tighter-permissions
Open

fix(stepfunctions-tasks): scope SubmitBatchJob IAM permissions to specific job definition#37248
Nananao wants to merge 2 commits intoaws:mainfrom
Nananao:fix/submit-batch-job-tighter-permissions

Conversation

@Nananao
Copy link

@Nananao Nananao commented Mar 14, 2026

What does this PR do?

BatchSubmitJob currently grants batch:SubmitJob on * (all resources) when static ARNs are provided. This PR scopes the permission to the specific job queue ARN and a wildcard over all revisions of the job definition (e.g., arn:aws:batch:...:job-definition/MyDef:*), following least-privilege best practices.

When either ARN is a dynamic value (JSONPath / JSONata expression), the existing wildcard behavior is preserved as the ARN cannot be resolved at synthesis time.

Closes

Closes #37214

Testing

  • Unit tests added (2 new test cases)
    • Static ARNs → scoped permissions to job definition name with :* revision wildcard + job queue ARN
    • JSONPath ARN → falls back to *
  • Integration test snapshot updated

Breaking Changes

None. Previously the policy used *; this change only restricts the scope, which is a security improvement and not a behavioral breaking change for CDK users.

…cific job definition

Previously, BatchSubmitJob granted batch:SubmitJob with a wildcard resource
(job-definition/*), allowing submission to any job definition in the account.

This change scopes the permission to the specific job definition using the
arn:...:job-definition/{name}:* pattern, following the principle of least
privilege. When jobDefinitionArn or jobQueueArn is a JSONPath/JSONata
expression, the policy falls back to * as before.

Closes aws#37214

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions github-actions bot added beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p1 labels Mar 14, 2026
@aws-cdk-automation aws-cdk-automation requested a review from a team March 14, 2026 12:47
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(This review is outdated)

…test

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@aws-cdk-automation aws-cdk-automation dismissed their stale review March 14, 2026 12:56

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@aws-cdk-automation aws-cdk-automation added the pr/needs-further-review PR requires additional review from our team specialists due to the scope or complexity of changes. label Mar 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p1 pr/needs-further-review PR requires additional review from our team specialists due to the scope or complexity of changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(aws-stepfunctions-tasks): Tighter permissions in SubmitBatchJob

2 participants