aws-cloudformation / aws-cloudformation/cloudformation-cli

Limitations when using get_session_token

Aperta
#577 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
cli experience enhancement
Lingua principale
Python
Stelle
336
Fork
172
Merge medio
3g 5m
PR unite (30g)
3

Descrizione

Currently when doing a test the code will use `get_session_token` when an execution role isn't provided or the credential chain being used doesn't have a session token.
https://github.com/aws-cloudformation/cloudformation-cli/blob/1d32b070d26cf6c8d17b03dc06190c08d5c9444b/src/rpdk/core/boto_helpers.py#L67

The [get_session_token](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sts.html#STS.Client.get_session_token) will return back credentials that have a few exceptions.
```
You cannot call any IAM API operations unless MFA authentication information is included in the request.
You cannot call any STS API except AssumeRole or GetCallerIdentity .
```

The result is if you are testing an IAM resource or using STS in your resource the tests will fail.

The workaround is to use an execution role.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Leggi src/rpdk/core/boto_helpers.py in corrispondenza della chiamata a get_session_token, quindi riproduci il fallimento durante il test di IAM o l’uso di STS senza un ruolo di esecuzione. Il lavoro è completato quando il percorso delle credenziali non causa più il fallimento di questi test e i casi interessati hanno una copertura; l’issue non specifica il comportamento sostitutivo previsto.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
aws, python
Ambito
authentication, cloud
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
38/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.