跳至內容

Best practice for Secrets Manager Usage

0

What are the best practices in structuring the secrets in secret manager?

More specifically, if I have a vendor client-id and client-secret, should i store them separately as prod/vendor/client-id and prod/vendor/client-secret OR store then as /prod/vendor-creds and then use a JSON Object {"client_id": "<id>", "client_secret": "<secret>"} as the value?

What if I have multiple secrets needed in the same service? would it be a good idea to store prod/<my-app-name> and then just put all secrets in it as a JSON Object? (e.g., {"vendor_client_id": "<id>", "private_signing_key": "<>"} etc?) -- This would allow my service to just call the secret manager api once on startup to get all credentials.

已提問 2 年前檢視次數 635 次

1 個回答
1
已接受的答案

Hi,

On your questions:

  1. yes, you can structure the secret that you need with the JSON format that you present: it would be very close to what for example RDS does with its own secrets: create one and decode it with decryptSecret API to see how they look like

  2. It may be interesting to keep 1 distinct secret for each client (if costs allow) to better respect the "least privilege" security best practice. Some of your service features may not need to know all secrets at once. In the future, it may be interesting to give access to some of the secrets to only some of the features. Also, from a hacking perspective (which I don't wish you), you'll be safer if your secrets are isolated: a hacker would have to decrypt each of them separately. It will be harder than just decrypting 1 secret to obtain all information about all customers.

Best,

Didier

專家

已回答 2 年前

專家

已審閱 2 年前

專家

已審閱 2 年前

專家

已審閱 2 年前

  • Thank you! We will keep this in mind.

  • Hi spy16, glad that it helped. Thanks for accepting my answer.

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。