-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(aws-rds): Password length is not passed through to rotation application #27608
Comments
@peterwoodworth I can take this. |
I investigated this. One issue I see is |
The CDK uses the underlying I was initially incredulous that content out of This appears to be a problem with the AWS Secrets Manager lambda, not the CDK itself. |
Yeah, from what I'm reading here, automatic rotation generates a new password with 32 chars every time. But you can generate a secret string with a custom length. Feels like automatic rotation is missing a feature :) |
Since it's a problem on CloudFormation/Secrets Manager, I'm going to close this ticket. |
|
@indrora I agree but is it possible to open a TT to see if the team can update the automatic rotation functionality to include password length as a parameter? |
We can absolutely do that, and should do that for customers when applicable. @indrora can you please follow up internally? Also I don't think this will be the best move here, but @msambol creating issues in the cloudformation coverage roadmap does automatically create tickets internally (though i'm not sure how to follow up on those on my end) |
@peterwoodworth Happy to do so in that repo—let me know if you want to go that route or TT. |
@peterwoodworth ^ I created a new issue in the other repo. |
Closing the issue in favor of aws-cloudformation/cloudformation-coverage-roadmap#1824. |
|
Describe the bug
Hello,
We have an issue with the automatic secret rotation functionality provided by the addRotationMultiUser method.
From a casual glance of the codebase (and the generated CloudFormation template) it would seem that the default behaviour of CDK is to create passwords that are a maximum of 30 characters in length (and this cannot be changed). Indeed, there is a comment explaining the reason:
aws-cdk/packages/aws-cdk-lib/aws-rds/lib/database-secret.ts
Line 86 in 7caab7d
This is relevant to us because we are needing to create a database link from an Oracle database server back to RDS and cannot use more than 30 characters.
However, further automatic updates to this secret (possibly on initial creation also but we have not verified this) will discard this length requirement, resetting it to the default.
We traced this back to https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/blob/67a98d2745b08bc748d17dc0469e48199c039789/SecretsManagerRDSPostgreSQLRotationMultiUser/lambda_function.py#L128 which does not allow us to pass through a maximum password length (so it defaults to 32 instead).
There is an open issue for tracking this bug at aws-samples/aws-secrets-manager-rotation-lambdas#51.
Expected Behavior
We would expect the length requirement for the default rotation function to be parameterised so that the maximum password length is passed through.
Indeed, this could unblock support for longer passwords than 32 characters.
Current Behavior
The password length is not passed through, so the password is 32 characters instead of 30.
Reproduction Steps
stack.ts
bin.ts
cdk.json
Running
cdk synth
will produce, among other things, aAWS::Serverless::Application
resource that does not have the secret length as a parameter.Possible Solution
The rotation application sample would need updating to pass through the length parameter.
Additional Information/Context
No response
CDK CLI Version
2.102.0 (build 2abc59a)
Framework Version
No response
Node.js Version
v18.18.2
OS
Mac OS X
Language
TypeScript
Language Version
TypeScript 5.2.2
Other information
No response
The text was updated successfully, but these errors were encountered: