aws / aws/aws-encryption-sdk-python

Preferential order of decryption

Aperta
#226 4 commenti 1 reazione 0 assegnatari Vedi su GitHub
requires followup
Lingua principale
Python
Stelle
255
Fork
92
Merge medio
2g 17h
PR unite (30g)
2

Descrizione

Hi amazing crypto heroes of AWS!

We are using the library to encrypt our sensitive settings in our project (passwords, API keys etc). We encrypt with two keys, one is a "development-key" and the other is the "production-key". When we decrypt in production, we would like the SDK to not use the development key, however it tries both and always fails the decrypt on the development key. I know we can set up a KmsKeyProvider to only have the ARN of the production key, but that would make our code a lot messier (having to pass it from a dynamic environment variable etc).

Is there a way to set the order of which keys will be used to decrypt when encrypting? Such to say when we encrypt we will use keys "production-key" and then "development-key". During decryption the SDK will try the first and only if it fails will go onto the second. The failure of trying to use the development key in production is taking IO and impacting our Lambda cold start times.

I feel like this feature should already be supported and maybe I am just not able to figure it out. I see that the SDK gives preferences to keys that are in the same region, but both keys are in the same region in my case 🤕

Any insight or help would be greatly appreciated!

Stay awesome and stay safe,
Mo Kamioner

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start by reviewing KmsKeyProvider and the SDK's existing key-selection and decryption behavior, including its same-region preference. Define how an explicit production-key-first order should interact with encryption and decryption, then validate the behavior with the reported two-key scenario and its Lambda cold-start impact.

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

Valutazione

Stack tecnologico
aws, python
Ambito
cloud, cryptography, security
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
28/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.