fix(manifests): Add list bucket to IAM policy#13469
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates the IAM policy generated by the pipelines profile controller to include an explicit bucket-level permission needed by some S3 clients (e.g., KServe storage-initializer) while keeping object permissions scoped to specific prefixes.
Changes:
- Split the single S3 statement into separate bucket-level and object-level statements.
- Added
s3:ListBucketon the bucket resource to support bucket-level checks prior to object access.
| "Statement": [ | ||
| { | ||
| # Bucket-level: allows HeadBucket (used by KServe storage-initializer | ||
| # and other S3 clients before downloading model artifacts). | ||
| "Effect": "Allow", | ||
| "Action": [ | ||
| "s3:ListBucket" | ||
| ], | ||
| "Resource": [ | ||
| f"arn:aws:s3:::{S3_BUCKET_NAME}" | ||
| ] | ||
| }, |
There was a problem hiding this comment.
Is there a secure way to implement this?
| { | ||
| # Object-level: prefix-scoped to this namespace only. | ||
| "Effect": "Allow", | ||
| "Action": [ | ||
| "s3:Put*", | ||
| "s3:Get*", | ||
| "s3:List*" | ||
| ], | ||
| "Resource": [ | ||
| f"arn:aws:s3:::{S3_BUCKET_NAME}/artifacts/*", | ||
| f"arn:aws:s3:::{S3_BUCKET_NAME}/private-artifacts/{namespace}/*", | ||
| f"arn:aws:s3:::{S3_BUCKET_NAME}/private/{namespace}/*", | ||
| f"arn:aws:s3:::{S3_BUCKET_NAME}/shared/*", | ||
| ] | ||
| } |
Signed-off-by: Tarek Abouzeid <tarek.abouzeid91@gmail.com>
5fadc3d to
447477e
Compare
|
Thank you for the PR. can you verify
/hold |
Description of your changes:
Kserve storage initializer is running
HeadBucketon arn:aws:s3:::mlpipeline, need to update IAM policy to allow that.Checklist: