-
Notifications
You must be signed in to change notification settings - Fork 11
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
debug messages for wca auth #1317
base: main
Are you sure you want to change the base?
Conversation
@@ -572,7 +581,9 @@ | |||
def _get_base_headers(self, api_key: str) -> dict[str, str]: | |||
# https://www.ibm.com/docs/en/cloud-paks/cp-data/4.8.x?topic=apis-generating-api-auth-token | |||
username = settings.ANSIBLE_WCA_USERNAME | |||
logger.info(f"generating token using {api_key}:{username}") |
Check failure
Code scanning / CodeQL
Clear-text logging of sensitive information High
sensitive data (secret)
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI about 2 months ago
To fix the problem, we need to avoid logging sensitive information such as the api_key
. Instead, we can log a generic message that does not include sensitive data. This ensures that the functionality remains the same without exposing sensitive information.
- Replace the logging statement that includes the
api_key
with a generic message. - Ensure that no sensitive information is logged in any other part of the code.
-
Copy modified line R584 -
Copy modified line R586
@@ -583,5 +583,5 @@ | ||
username = settings.ANSIBLE_WCA_USERNAME | ||
logger.info(f"generating token using {api_key}:{username}") | ||
logger.info("generating token") | ||
token = base64.b64encode(bytes(f"{username}:{api_key}", "ascii")).decode("ascii") | ||
logger.info(f"token generated: {token}") | ||
logger.info("token generated") | ||
return { |
token = base64.b64encode(bytes(f"{username}:{api_key}", "ascii")).decode("ascii") | ||
logger.info(f"token generated: {token}") |
Check failure
Code scanning / CodeQL
Clear-text logging of sensitive information High
sensitive data (secret)
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI about 2 months ago
To fix the problem, we should avoid logging sensitive information such as tokens or API keys. Instead, we can log a generic message indicating that a token was generated without including the actual token value. This way, we maintain the ability to trace the flow of execution without exposing sensitive data.
- Replace the log statement on line 586 with a generic message.
- Ensure that no sensitive information is included in log messages.
-
Copy modified line R584 -
Copy modified line R586
@@ -583,5 +583,5 @@ | ||
username = settings.ANSIBLE_WCA_USERNAME | ||
logger.info(f"generating token using {api_key}:{username}") | ||
logger.info(f"generating token using provided API key and username") | ||
token = base64.b64encode(bytes(f"{username}:{api_key}", "ascii")).decode("ascii") | ||
logger.info(f"token generated: {token}") | ||
logger.info("token generated successfully") | ||
return { |
Hello @jameswnl, I tried the build locally and build is not working properly for me. When I call
But even getting error, I had to get much more context for the request, isn't it? UPD: I switched to main branch and all works as expected. So issues is whit the old code in the branch, I suppose. |
https://issues.redhat.com/browse/AAP-31642
Description
This is based on downstream
1.0.1
and so will have conflict. Don't expect to merge, only for building the debug imageTesting
Steps to test
Scenarios tested
Production deployment