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 permission is too broad (under feature flag) #30389

Merged
merged 7 commits into from
Jun 24, 2024

Conversation

@aws-cdk-automation aws-cdk-automation requested a review from a team May 30, 2024 15:26
@github-actions github-actions bot added effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2 distinguished-contributor [Pilot] contributed 50+ PRs to the CDK labels May 30, 2024
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 May 30, 2024

Exemption Request: I updated integration snapshots, but a change in the integration test file isn't needed.

This was referenced Jun 1, 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 agree that we were granting too much permission in the current solution based on the documentation you provided. However, I'm a bit worried that this would introduce breaking changes for existing users (who incorrectly rely on the broad permissions) and accepting this would break their application.

@GavinZZ GavinZZ added the pr-linter/exempt-integ-test The PR linter will not require integ test changes label Jun 5, 2024
@aws-cdk-automation aws-cdk-automation dismissed stale reviews from themself June 5, 2024 20:00

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

@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 Jun 5, 2024
Copy link
Contributor

@lpizzinidev lpizzinidev left a comment

Choose a reason for hiding this comment

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

@GavinZZ #30389 (review)
Feature flag?

@GavinZZ
Copy link
Contributor

GavinZZ commented Jun 6, 2024

@GavinZZ #30389 (review) Feature flag?

Yes, thanks for leaving a comment. I think feature flag is needed in this case to guarantee no breaking change. IMO I think it's likely that only few users would experience any breaking changes from this change, but I don't have the data on me and it's our promise that stable module don't bring breaking changes.

@msambol
Copy link
Contributor Author

msambol commented Jun 7, 2024

@GavinZZ #30389 (review) Feature flag?

Yes, thanks for leaving a comment. I think feature flag is needed in this case to guarantee no breaking change. IMO I think it's likely that only few users would experience any breaking changes from this change, but I don't have the data on me and it's our promise that stable module don't bring breaking changes.

I don't even think this was working previously. See my PR description here: #27891.

@GavinZZ
Copy link
Contributor

GavinZZ commented Jun 17, 2024

@msambol Sorry for the delayed response. A bit confused here. It seems there was an issue with too little permission and you've fixed it half a year ago. So I'm assuming this is working now except we've giving too much permission in the resource field, meaning that this is currently working right and it may be a breaking change?

@msambol
Copy link
Contributor Author

msambol commented Jun 17, 2024

@msambol Sorry for the delayed response. A bit confused here. It seems there was an issue with too little permission and you've fixed it half a year ago. So I'm assuming this is working now except we've giving too much permission in the resource field, meaning that this is currently working right and it may be a breaking change?

This https://github.com/aws/aws-cdk/pull/27891/files#diff-9d5f521b191b7a78f695205cd6cdbf39fce4ffcae0de03b4c4a92d3c59c06f3cL343 permission was initially there, but it didn't actually work or allow the integration tests to run properly. Adding https://github.com/aws/aws-cdk/pull/27891/files#diff-9d5f521b191b7a78f695205cd6cdbf39fce4ffcae0de03b4c4a92d3c59c06f3cR346 permission fixed it. I should have removed the initial condition when I added the other one. But if you feel we should do a feature flag just in case, we can add that.

@GavinZZ
Copy link
Contributor

GavinZZ commented Jun 17, 2024

I would like to ask to add a feature flag just in case. Reason being is that my understanding is that currently we allow runTask on both the task itself taskDefinitionFamilyArn and all revisions of the task taskDefinitionFamilyArn/*. I'm worried that this could be a breaking change. Feel free to correct me if my understanding is incorrect.

@msambol
Copy link
Contributor Author

msambol commented Jun 17, 2024

@GavinZZ Do you have an example on where we use a FF like this?

@GavinZZ
Copy link
Contributor

GavinZZ commented Jun 17, 2024

This one seems to be similar https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/pipelines/lib/codepipeline/codepipeline.ts#L987

@msambol
Copy link
Contributor Author

msambol commented Jun 20, 2024

@GavinZZ Let me know what you think of this. Default is the extra permission gets added.

@GavinZZ
Copy link
Contributor

GavinZZ commented Jun 21, 2024

@msambol Looks good, please also add an entry to README here

@msambol
Copy link
Contributor Author

msambol commented Jun 21, 2024

@msambol Looks good, please also add an entry to README here

Done!

@GavinZZ GavinZZ changed the title fix(stepfunctions-tasks): run task permission is too broad fix(stepfunctions-tasks): run task permission is too broad (under feature flag) Jun 24, 2024
GavinZZ
GavinZZ previously approved these changes Jun 24, 2024
@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 Jun 24, 2024
Copy link
Contributor

mergify bot commented Jun 24, 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 June 24, 2024 22:33

Pull request has been modified.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: cb8f0ea
  • 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 Jun 24, 2024
@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 Jun 24, 2024
Copy link
Contributor

mergify bot commented Jun 24, 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 8ebfade into aws:main Jun 24, 2024
17 checks passed
@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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
distinguished-contributor [Pilot] contributed 50+ PRs to the CDK effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. 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.

(stepfunctions-tasks): Security action for EcsRunTask
4 participants