credentials static web identity credentials not picked up without an explicit profile option
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- aws, ruby
- Ambito
- authentication, cloud
Direzione di ricerca
Inizia da gems/aws-sdk-core/lib/aws-sdk-core/credential_provider_chain.rb e gems/aws-sdk-core/lib/aws-sdk-core/plugins/credentials_configuration.rb, quindi esamina il comportamento della configurazione condivisa descritto nella riproduzione. Usa le due chiamate a Aws::SQS::Client.new con la configurazione dell’identità web per verificare le richieste STS correnti. Il lavoro è completato quando viene usata la configurazione condivisa predefinita senza un profilo esplicito e i client creati ripetutamente non eseguono ciascuno un refresh separato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
We're using STS web identity token credentials to manage AWS SDK service call authentication via SigV4 (aws-sdk-core (3.211.0), should be the relevant bit). We noticed however, during load testing, some rate limiting happening, which we narrowed down to multiple calls to the STS token refresh endpoint, exacerbated by the scaling up of certain services. After some investigation, we figured out that multiple clients (for SQS, SNS, etc) were instantiated, and the token refresh path was called for each of them. This is not ideal, as there should be a single "refresh" happening, and the token should at best be shared across the multiple clients.
In the process, we found out that the AWS SDKs already support that via "shared config", and we proceeded to change our approach using it, replacing the env var setup using AWS_WEB_IDENTITY_TOKEN_FILE and AWS_ROLE_ARN with a AWS_CONFIG_FILE pointing to a file like this:
[default]
web_identity_token_file = $AWS_WEB_IDENTITY_TOKEN_FILE
role_arn = $AWS_ROLE_ARN
Expected Behavior
This should have worked, as in, when instantiating clients multiple times, there should only be one call to STS. This can be observed using this script:
Aws.config[:http_wire_trace] = true
Aws::SQS::Client.new
# one STS request log
Aws::SQS::Client.new
# no STS request log
Current Behavior
when instantiating two client instances, two STS requests are made.
While we noticed that Aws.shared_config was correctly filled up with the expected values, unfortunately calling i.e. Aws::SQS::Client.new was still going through this strategy and generating a token + refresh loop per client, because of this clause, i.e. the routine expects a profile to be set, however it's nil as per the option setup, although the docs say it's "default".
I believe this is a bug, as if "default", this would have worked. I also tried setting the AWS_PROFILE env var, but that doesn't fill it up either.
FWIW, setting Aws.config[:profile] = "default", or explicit option set a la Aws::SQS::Client.new(profile: "default"), work as expected (shared config is picked up). However, I'm looking for a "no config code" setup that can be rolled out across multiple services.
Reproduction Steps
Aws.config[:http_wire_trace] = true
Aws::SQS::Client.new
# one STS request log
Aws::SQS::Client.new
# no STS request log
Possible Solution
Perhaps initializing the profile option to whatever AWS_PROFILE defines?
Additional Information/Context
No response
Gem name ('aws-sdk', 'aws-sdk-resources' or service gems like 'aws-sdk-s3') and its version
aws-sdk-core 3.211.0
Environment details (Version of Ruby, OS environment)
"ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-linux]"
- Lingua principale
- Ruby
- Stelle
- 3.7k
- Fork
- 1.2k
- Merge medio
- 1g 16h
- PR unite (30g)
- 25
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di aws/aws-sdk-ruby
-
service-api
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
aws/aws-sdk-ruby#3395 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
BedrockAgentCore: invoke_agent_runtime buffers entire response instead of streaming in real-timeApertadocumentation p3 queued
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
aws/aws-sdk-ruby#3348 · 6 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
investigating service-api
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
aws/aws-sdk-ruby#3217 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
service-api
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
aws/aws-sdk-ruby#3191 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
feature-request
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
aws/aws-sdk-ruby#3190 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di aws/aws-sdk-ruby
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
[Bug] Chatwoot v4.19.0 – Super Admin returns 500 due to missing superadmin.scss Vite manifest entryApertaBug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 2 giorni
-
PRM baseline System 1 and 2 fans run continuously in unoccupied hours (low priority)Forse già presa @anchapin l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
NatLabRockies/openstudio-standards#2167 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
18F/identity-idp#13734 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Ubuntu 26.04: gems linking OpenSSL statically (e.g. rugged) fail to build – libjitterentropy3-dev missingForse già presa @BattleAurora l’ha presa oggi. ApertaArea: Ruby bug report needs triage OS: Ubuntu
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
actions/runner-images#15068 · 1 commento ·
I maintainer di solito rispondono entro 3 giorni