lyn7131: Ensure AWS credential Cvars are not logged or shown in plain text (#4519)

Signed-off-by: rppotter <rppotter@amazon.com>
monroegm-disable-blank-issue-2
Pip Potter 4 years ago committed by GitHub
parent 8fc8baa579
commit 029ad32c84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -21,7 +21,7 @@ namespace AWSCore
{ {
public: public:
AWSCVarCredentialHandler() = default; AWSCVarCredentialHandler() = default;
~AWSCVarCredentialHandler() = default; ~AWSCVarCredentialHandler() override = default;
//! Activate handler and its credentials provider, make sure activation //! Activate handler and its credentials provider, make sure activation
//! invoked after AWSNativeSDK init to avoid memory leak //! invoked after AWSNativeSDK init to avoid memory leak

@ -5,15 +5,14 @@
* SPDX-License-Identifier: Apache-2.0 OR MIT * SPDX-License-Identifier: Apache-2.0 OR MIT
* *
*/ */
#include <AzCore/Console/IConsole.h> #include <AzCore/Console/IConsole.h>
#include <Credential/AWSCVarCredentialHandler.h> #include <Credential/AWSCVarCredentialHandler.h>
namespace AWSCore namespace AWSCore
{ {
AZ_CVAR(AZ::CVarFixedString, cl_awsAccessKey, "", nullptr, AZ::ConsoleFunctorFlags::Null, "Override AWS access key"); AZ_CVAR(AZ::CVarFixedString, cl_awsAccessKey, "", nullptr, AZ::ConsoleFunctorFlags::IsInvisible, "Override AWS access key");
AZ_CVAR(AZ::CVarFixedString, cl_awsSecretKey, "", nullptr, AZ::ConsoleFunctorFlags::Null, "Override AWS secret key"); AZ_CVAR(AZ::CVarFixedString, cl_awsSecretKey, "", nullptr, AZ::ConsoleFunctorFlags::IsInvisible, "Override AWS secret key");
static constexpr char AWSCVARCREDENTIALHANDLER_ALLOC_TAG[] = "AWSCVarCredentialHandler"; static constexpr char AWSCVARCREDENTIALHANDLER_ALLOC_TAG[] = "AWSCVarCredentialHandler";
@ -36,8 +35,8 @@ namespace AWSCore
std::shared_ptr<Aws::Auth::AWSCredentialsProvider> AWSCVarCredentialHandler::GetCredentialsProvider() std::shared_ptr<Aws::Auth::AWSCredentialsProvider> AWSCVarCredentialHandler::GetCredentialsProvider()
{ {
auto accessKey = static_cast<AZ::CVarFixedString>(cl_awsAccessKey); const auto accessKey = static_cast<AZ::CVarFixedString>(cl_awsAccessKey);
auto secretKey = static_cast<AZ::CVarFixedString>(cl_awsSecretKey); const auto secretKey = static_cast<AZ::CVarFixedString>(cl_awsSecretKey);
if (!accessKey.empty() && !secretKey.empty()) if (!accessKey.empty() && !secretKey.empty())
{ {

Loading…
Cancel
Save