내용으로 건너뛰기

Is it possible to rotate a token rather than a password using AWS Secrets Manager Rotation by Lambda function?

0

I'm looking at the possibility of using AWS Secrets Manager Rotation by Lambda function to rotate a couple of access tokens for external services. However, reading through https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_lambda.html and the examples provided, it appears that the rotation workflow is only designed to handle passwords, not tokens. That is to say, that the workflow relies on you being able to create the new secret value yourself, and then tell the service being accessed to use that new secret. Which of course, does not cater for access tokens, which you normally rotate by asking the service being accessed for a new token, which it then provides - you normally do not get to create token values yourself. Am I correct? Is AWS Secrets Manager Rotation not usable for rotating tokens that are provided to you by the service being accessed? Because if so, this seems a major gap in functionality.

질문됨 2년 전567회 조회

1개 답변
1

Hello.

I think it is possible to rotate the access token by modifying the rotation Lambda function yourself and getting the access token from Lambda to the external service.
For this purpose, AWS has created a Lambda function that can be used as a reference for rotation.
I think you can edit this code to suit your needs.
https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_available-rotation-templates.html#OTHER_rotation_templates

I think the structure on page 21 of the PDF below is close to your purpose.
https://d1.awsstatic.com/events/Summits/reinvent2022/SEC325-R_Beyond-database-password-management-5-use-cases-for-AWS-Secrets-Manager.pdf

The code for the rotation Lambda function introduced in the blog below will be helpful.
https://medium.com/@larhdid/fortify-your-apps-security-save-and-rotate-tokens-with-aws-secret-manager-and-lambda-e3f7a99c01e0

전문가

답변함 2년 전

전문가

검토됨 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.