Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(stepfunctions-tasks): run task perm no longer valid #30788

Merged
merged 3 commits into from
Jul 23, 2024
Merged

Conversation

msambol
Copy link
Contributor

@msambol msambol commented Jul 8, 2024

Issue # (if applicable)

Closes #30751.

Reason for this change

runTask on ${taskDefinitionFamilyArn} is no longer relevant (see validation errors in the linked issue.
This was currently disabled with a FF. This PR removes the permission entirely, and removes the FF.

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@aws-cdk-automation aws-cdk-automation requested a review from a team July 8, 2024 15:34
@github-actions github-actions bot added bug This issue is a bug. effort/small Small work item – less than a day of effort p2 distinguished-contributor [Pilot] contributed 50+ PRs to the CDK labels Jul 8, 2024
@msambol
Copy link
Contributor Author

msambol commented Jul 8, 2024

@GavinZZ JFYI since you have the most context on this..

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.

The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.

A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.

@msambol
Copy link
Contributor Author

msambol commented Jul 8, 2024

Exemption request: The related integrations tests already had this permission removed.

@aws-cdk-automation aws-cdk-automation added pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback. pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. labels Jul 8, 2024
Copy link
Contributor

@GavinZZ GavinZZ left a comment

Choose a reason for hiding this comment

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

I think this looks good to me. I left a question in the relevant issue here to help me understand the issue better. I just want to confirm this does not work for the current users to make sure it's non-breaking.

@GavinZZ GavinZZ added pr-linter/exempt-integ-test The PR linter will not require integ test changes and removed pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback. labels Jul 23, 2024
GavinZZ
GavinZZ previously approved these changes Jul 23, 2024
Copy link
Contributor

@GavinZZ GavinZZ left a comment

Choose a reason for hiding this comment

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

I think this is good to merge since the removed resource in IAM policy is not a valid arn and thus removing this should not create any breaking changes.

@aws-cdk-automation aws-cdk-automation dismissed their stale review July 23, 2024 20:20

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

@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Jul 23, 2024
Copy link
Contributor

mergify bot commented Jul 23, 2024

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot dismissed GavinZZ’s stale review July 23, 2024 21:46

Pull request has been modified.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: e1a79ae
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Jul 23, 2024
Copy link
Contributor

mergify bot commented Jul 23, 2024

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit 82b163d into aws:main Jul 23, 2024
14 checks passed
Copy link

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Jul 23, 2024
obraafo pushed a commit to obraafo/aws-cdk that referenced this pull request Jul 25, 2024
### Issue # (if applicable)

Closes aws#30751.

### Reason for this change

`runTask` on `${taskDefinitionFamilyArn}` is no longer relevant (see validation errors in the linked issue.
This was currently disabled with a FF. This PR removes the permission entirely, and removes the FF.

### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@aws-cdk-automation
Copy link
Collaborator

Comments on closed issues and PRs are hard for our team to see. If you need help, please open a new issue that references this one.

@aws aws locked as resolved and limited conversation to collaborators Jul 25, 2024
const policyStatements = [
new iam.PolicyStatement({
actions: ['ecs:RunTask'],
resources: [`${this.getTaskDefinitionFamilyArn()}:*`],
Copy link
Contributor

Choose a reason for hiding this comment

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

If I understand correctly, this.getTaskDefinitionFamilyArn() strips away the revision number from this.props.taskDefinition.taskDefinitionArn. I am curious, would the CDK user be able to specify specific revision of the task definition if they would like to scope this down for strictest security?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, that's correct understanding.

I am curious, would the CDK user be able to specify specific revision of the task definition if they would like to scope this down for strictest security

Not easily, they could use escape hatch to scope it down further to a specific revision number.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue is a bug. distinguished-contributor [Pilot] contributed 50+ PRs to the CDK effort/small Small work item – less than a day of effort p2 pr-linter/exempt-integ-test The PR linter will not require integ test changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aws-cdk-lib/aws-stepfunctions: incorrect resource in ECS ecs:RunTask for State Machines
4 participants