fix: Replace hardcoded AWS credentials with AnonymousCredentialsProvi… - #7148
fix: Replace hardcoded AWS credentials with AnonymousCredentialsProvi…#7148ford220102 wants to merge 2 commits into
Conversation
…der in benchmark
Security fix for java:S6263 - Long-term AWS access keys should not be used.
Replaced hardcoded dummy credentials ("test"/"test") with
AnonymousCredentialsProvider in V1CborRoundtripBenchmark.
The benchmark uses a local mock server and does not require
real AWS credentials. Using AnonymousCredentialsProvider makes
this intent explicit and avoids the security hotspot.
This change:
- Eliminates the security warning for hardcoded credentials
- Makes the code's intent clearer (no real AWS access needed)
- Is safe for benchmark code that never contacts real AWS services
|
Hi @ford220102 can you give us more context about what originated the change? Where is the security warning coming from? |
|
Hi @debora-ito, thanks for asking. The warning did not come from an AWS CI workflow or a security incident. I identified the code during a static-analysis review as matching Sonar rule These are only dummy credentials used by The purpose of the change is to remove the credential-like literals and make it clear that no real AWS credentials are required. I also noticed that my initial change used the SDK v2 new AWSStaticCredentialsProvider(new AnonymousAWSCredentials())I will update the commit and rerun the relevant build. |
I see, thank you for the additional context. Changing to use AnonymousCredentialProvider will skip the signing steps and affect the benchmarks, so we'd like to keep the test as it is. The security finding doesn't apply in this case, we are using fake credentials with a mock server for client-side benchmarking purposes. Marking to auto close soon, but let us know if you have questions. |
…der in benchmark
Security fix for java:S6263 - Long-term AWS access keys should not be used.
Replaced hardcoded dummy credentials ("test"/"test") with AnonymousCredentialsProvider in V1CborRoundtripBenchmark.
The benchmark uses a local mock server and does not require real AWS credentials. Using AnonymousCredentialsProvider makes this intent explicit and avoids the security hotspot.
This change:
Motivation and Context
Modifications
Testing
Screenshots (if appropriate)
Types of changes
Checklist
mvn installsucceedsscripts/new-changescript and following the instructions. Commit the new file created by the script in.changes/next-releasewith your changes.License