-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Closed
Labels
bugThis issue is a bug.This issue is a bug.effort/mediumMedium work item – several days of effortMedium work item – several days of effortp0package/toolsRelated to AWS CDK Tools or CLIRelated to AWS CDK Tools or CLI
Description
Describe the bug
When a credential provider is used, the CDK CLI prints the credentials received from the plugin in the console output.
Regression Issue
- Select this option if this issue appears to be a regression.
Last Known Working CDK Version
No response
Expected Behavior
CDK CLI should not print credentials in the output to avoid security risks.
Current Behavior
The output includes sensitive information, such as accessKeyId, secretAccessKey, and sessionToken, as shown below:
{
accessKeyId: 'ASIAXXXXXXXXXXXXXXXXX',
secretAccessKey: 'YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY',
sessionToken: 'ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ',
expiration: 2025-02-11T17:27:31.000Z,
'$source': { CREDENTIALS_SSO: 's', CREDENTIALS_PROFILE_SSO: 'r' }
} 1739276852684
Reproduction Steps
- Configure a credential provider in AWS CDK.
- Run a CDK command that triggers credential fetching (e.g.,
cdk diff). - Observe that the credentials are printed in the console output.
Possible Solution
Remove this line:
| info(format(current), Date.now()); |
Additional Information/Context
No response
CDK CLI Version
2.178.1
Framework Version
No response
Node.js Version
22.11.0
OS
Ubuntu 24.04
Language
TypeScript
Language Version
5.7.3
Other information
No response
Metadata
Metadata
Assignees
Labels
bugThis issue is a bug.This issue is a bug.effort/mediumMedium work item – several days of effortMedium work item – several days of effortp0package/toolsRelated to AWS CDK Tools or CLIRelated to AWS CDK Tools or CLI