-
Notifications
You must be signed in to change notification settings - Fork 1
Add AISPM service and configuration updates #99
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
base: main
Are you sure you want to change the base?
Conversation
| def _send_request_sync(self, request: Request) -> httpx.Response: | ||
| return self._core_send_request(self.client, request) | ||
| url, headers = self._prepare_request(request) | ||
| print(f"Making request to: {url}") |
Check failure
Code scanning / CodeQL
Clear-text logging of sensitive information High
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 11 months ago
To fix the problem, we need to ensure that sensitive information such as request.secret is not logged. The best way to do this without changing existing functionality is to sanitize the url before logging it. We can replace sensitive parts of the url with placeholders before logging.
Specifically, we will:
- Create a function to sanitize the
urlby replacing sensitive information with placeholders. - Use this function to sanitize the
urlbefore logging it.
-
Copy modified lines R119-R120 -
Copy modified lines R128-R131
| @@ -118,3 +118,4 @@ | ||
| url, headers = self._prepare_request(request) | ||
| print(f"Making request to: {url}") | ||
| sanitized_url = self._sanitize_url(url) | ||
| print(f"Making request to: {sanitized_url}") | ||
| print(f"With headers: {headers}") | ||
| @@ -126,2 +127,6 @@ | ||
|
|
||
| def _sanitize_url(self, url: str) -> str: | ||
| # Replace sensitive information with placeholders | ||
| sanitized_url = url.replace(request.secret, "[SECRET]") | ||
| return sanitized_url | ||
|
|
| return self._core_send_request(self.client, request) | ||
| url, headers = self._prepare_request(request) | ||
| print(f"Making request to: {url}") | ||
| print(f"With headers: {headers}") |
Check failure
Code scanning / CodeQL
Clear-text logging of sensitive information High
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 11 months ago
To fix the problem, we should avoid logging sensitive information such as headers and URLs directly. Instead, we can log non-sensitive parts of the request or use a sanitized version of the headers and URLs. Specifically, we can remove or mask sensitive information before logging.
- Identify the lines where sensitive information is being logged.
- Modify the logging statements to exclude or mask sensitive data.
- Ensure that the functionality of the code remains unchanged.
-
Copy modified line R119 -
Copy modified line R122
| @@ -118,7 +118,6 @@ | ||
| url, headers = self._prepare_request(request) | ||
| print(f"Making request to: {url}") | ||
| print(f"With headers: {headers}") | ||
| print("Making request") | ||
| response = self._core_send_request(self.client, request) | ||
| print(f"Response status: {response.status_code}") | ||
| print(f"Response body: {response.text}") | ||
| print("Response received") | ||
| return response |
|
|
||
|
|
||
|
|
||
| #def check_permissions(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uncomment this code
|
jfyi, pr merger check will fail if you dont use formats like 'fix: ' or 'feat: ' in commit msgs. |
No description provided.