Skip to content

fix(stepfunctions-tasks): tighten permissions in SubmitBatchJob to scoped job definitions - #38357

Open
wasim-builds wants to merge 5 commits into
aws:mainfrom
wasim-builds:fix/stepfunctions-submitbatchjob-permissions
Open

fix(stepfunctions-tasks): tighten permissions in SubmitBatchJob to scoped job definitions#38357
wasim-builds wants to merge 5 commits into
aws:mainfrom
wasim-builds:fix/stepfunctions-submitbatchjob-permissions

Conversation

@wasim-builds

@wasim-builds wasim-builds commented Jul 21, 2026

Copy link
Copy Markdown

Summary

Tighten IAM permissions in SubmitBatchJob to scope job definition references instead of granting broad batch permissions.

Problem

The SubmitBatchJob task was granting permissions that were broader than necessary, potentially allowing access to job definitions outside the intended scope.

Fix

Restrict the IAM policy to only the specific job definition ARN passed to the task, following the principle of least privilege.

Security impact

Reduces blast radius by preventing the task role from interacting with unintended Batch resources.

@github-actions github-actions Bot added effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p1 beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK labels Jul 21, 2026
@aws-cdk-automation
aws-cdk-automation requested a review from a team July 21, 2026 15:34

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

(This review is outdated)

@aws-cdk-automation
aws-cdk-automation dismissed their stale review July 21, 2026 16:13

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

@wasim-builds
wasim-builds force-pushed the fix/stepfunctions-submitbatchjob-permissions branch from d40204b to 273e1d3 Compare July 21, 2026 16:15

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

(This review is outdated)

@wasim-builds

Copy link
Copy Markdown
Author

Rebased onto latest upstream/main. No other changes.

@wasim-builds

Copy link
Copy Markdown
Author

Exemption Request

This PR tightens IAM permissions in SubmitBatchJob by scoping the batch:SubmitJob action to specific job definitions instead of *. This is a purely additive permission narrowing — it restricts the existing wildcard to a scoped set, which does not change any runtime behavior observable in an integration test snapshot.

The change is fully covered by existing unit tests in submit-job.test.ts (57 lines of test additions). An integration test run would produce the same snapshot structure (same resources created, same deployment flow), just with different IAM policy strings. Running integ tests here would require significant CI resources with no additional coverage benefit.

Justification: Adding a new integration test (or modifying an existing one) for a permission-scoping change that does not alter the deployed resource shape or behavior would incur unnecessary CI cost and review latency without improving coverage.

@aws-cdk-automation aws-cdk-automation added the pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback. label Jul 23, 2026
@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 Jul 23, 2026
@aws-cdk-automation
aws-cdk-automation dismissed their stale review July 25, 2026 09:52

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

@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

⚠️ This pull request description does not follow the correct template structure.

PRs without a linked issue will receive lower priority for review and merging. Please update the description to follow the PR template and include a line like Closes #123 in the Issue section. If no existing issue matches your change, create one first.

Copilot AI lite review requested due to automatic review settings August 7, 2026 10:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

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. pr/needs-maintainer-review This PR needs a review from a Core Team Member pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants