-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
iam policy fix #24333
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
base: main
Are you sure you want to change the base?
iam policy fix #24333
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -700,7 +700,7 @@ def _auth_with_web_identity_token( | |
| "RoleSessionName": aws_session_name, | ||
| "WebIdentityToken": oidc_token, | ||
| "DurationSeconds": 3600, | ||
| "Policy": '{"Version":"2012-10-17","Statement":[{"Sid":"BedrockLiteLLM","Effect":"Allow","Action":["bedrock:InvokeModel","bedrock:InvokeModelWithResponseStream"],"Resource":"*","Condition":{"Bool":{"aws:SecureTransport":"true"},"StringLike":{"aws:UserAgent":"litellm/*"}}}]}', | ||
| "Policy": '{"Version":"2012-10-17","Statement":[{"Sid":"BedrockLiteLLM","Effect":"Allow","Action":["bedrock:InvokeModel","bedrock:InvokeModelWithResponseStream","bedrock:ApplyGuardrail","bedrock:GetGuardrail","bedrock:ListGuardrails"],"Resource":"*","Condition":{"Bool":{"aws:SecureTransport":"true"}}}]}', | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The pre-submission checklist and repository policy (rule
Please add at least one unit test (mocked) under Rule Used: What: Ensure that any PR claiming to fix an issue ... (source) |
||
| } | ||
|
|
||
| # Add ExternalId parameter if provided | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original policy included
"StringLike":{"aws:UserAgent":"litellm/*"}as an additional session-policy guard, ensuring the scoped temporary credentials could only be exercised by requests that identify themselves aslitellm/*. This PR removes that restriction without any explanation.Even though user-agent values can be spoofed, the removal still weakens the security posture of the session policy by allowing any caller (e.g. AWS CLI, other SDKs, scripts) to make
bedrock:Invoke*and guardrail calls with these temporary credentials. If the motivation was that guardrail SDK calls fail the user-agent check, the fix should be to also match the guardrail SDK's user-agent (e.g."StringLike":{"aws:UserAgent":["litellm/*","boto3/*"]}) rather than dropping the condition entirely.Could you confirm whether removing this condition is intentional and, if so, document the reason here?