Skip to content

remove unnecessary condition - #51039

Merged
cat5inthecradle merged 1 commit into
stagingfrom
fix-contributor-role
Apr 10, 2023
Merged

remove unnecessary condition#51039
cat5inthecradle merged 1 commit into
stagingfrom
fix-contributor-role

Conversation

@cat5inthecradle

@cat5inthecradle cat5inthecradle commented Mar 30, 2023

Copy link
Copy Markdown
Contributor

This PR removes a problematic condition on the ListBuckets and ListBucketVersions actions.

Links

Testing story

As these permissions are additive, I was able to add a new policy to the contributor with the correct ListBucketVersions policy. With this policy applied, the following command was successful.

Before - reproducing the problem:

> aws s3api list-object-versions --bucket cdo-v3-sources --prefix sources_development/1016/1283/main.json

An error occurred (AccessDenied) when calling the ListObjectVersions operation: Access Denied

After applying manual policy, the versions are listed.

Deployment strategy

  1. update iam stack with this code
  2. delete manual policy from Contributor role
  3. Confirm that Contributors are still able to run list-object-versions commands
  4. merge this PR

Security

Action remains scoped to the appropriate prefixes

PR Checklist:

  • Tests provide adequate coverage
  • Privacy and Security impacts have been assessed
  • Code is well-commented
  • New features are translatable or updates will not break translations
  • Relevant documentation has been added or updated
  • User impact is well-understood and desirable
  • Pull Request is labeled appropriately
  • Follow-up work items (including potential tech debt) are tracked and linked

@cat5inthecradle
cat5inthecradle requested a review from a team March 30, 2023 20:54

@Hamms Hamms left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we understand why this condition was added in the first place, and/or what value we DO expect s3:delimiter to have?

@cat5inthecradle

Copy link
Copy Markdown
Contributor Author

I added this with the initial creation of the role, and I think we're just looking at a mistaken copy paste from the previously manually created Contributor roles. These have been deleted, so I can't reference them to confirm, nor would I have much in terms of context for why. I also don't have any certainty that the previous roles were completely working.

I can't think of a reason why this condition would be useful. The condition effectively scopes access to the relevant prefixes (folders).

@Hamms Hamms left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That makes sense; LGTM!

@cat5inthecradle
cat5inthecradle merged commit 804ba03 into staging Apr 10, 2023
@cat5inthecradle
cat5inthecradle deleted the fix-contributor-role branch April 10, 2023 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants