mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-03-22 03:08:23 +00:00
fix(sdk): mute HPACK library logs to prevent token leakage (#10014)
Co-authored-by: Hugo Pereira Brito <101209179+HugoPBrito@users.noreply.github.com>
This commit is contained in:
@@ -7,6 +7,7 @@ All notable changes to the **Prowler SDK** are documented in this file.
|
||||
### 🐞 Fixed
|
||||
|
||||
- `--repository` and `--organization` flags combined interaction in GitHub provider, qualifying unqualified repository names with organization [(#10001)](https://github.com/prowler-cloud/prowler/pull/10001)
|
||||
- HPACK library logging tokens in debug mode for Azure, M365, and Cloudflare providers [(#10010)](https://github.com/prowler-cloud/prowler/pull/10010)
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import asyncio
|
||||
import logging
|
||||
import os
|
||||
import re
|
||||
from argparse import ArgumentTypeError
|
||||
@@ -217,6 +218,9 @@ class AzureProvider(Provider):
|
||||
"""
|
||||
logger.info("Setting Azure provider ...")
|
||||
|
||||
# Mute HPACK library logs to prevent token leakage in debug mode
|
||||
logging.getLogger("hpack").setLevel(logging.CRITICAL)
|
||||
|
||||
logger.info("Checking if any credentials mode is set ...")
|
||||
|
||||
# Validate the authentication arguments
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import logging
|
||||
import os
|
||||
from typing import Iterable
|
||||
|
||||
@@ -55,6 +56,9 @@ class CloudflareProvider(Provider):
|
||||
):
|
||||
logger.info("Instantiating Cloudflare provider...")
|
||||
|
||||
# Mute HPACK library logs to prevent token leakage in debug mode
|
||||
logging.getLogger("hpack").setLevel(logging.CRITICAL)
|
||||
|
||||
if config_content:
|
||||
self._audit_config = config_content
|
||||
else:
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import logging
|
||||
import os
|
||||
from os import environ
|
||||
from typing import Union
|
||||
@@ -134,8 +135,6 @@ class GithubProvider(Provider):
|
||||
logger.info("Instantiating GitHub Provider...")
|
||||
|
||||
# Mute GitHub library logs to reduce noise since it is already handled by the Prowler logger
|
||||
import logging
|
||||
|
||||
logging.getLogger("github").setLevel(logging.CRITICAL)
|
||||
logging.getLogger("github.GithubRetry").setLevel(logging.CRITICAL)
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import asyncio
|
||||
import base64
|
||||
import logging
|
||||
import os
|
||||
from argparse import ArgumentTypeError
|
||||
from os import getenv
|
||||
@@ -157,6 +158,9 @@ class M365Provider(Provider):
|
||||
"""
|
||||
logger.info("Setting M365 provider ...")
|
||||
|
||||
# Mute HPACK library logs to prevent token leakage in debug mode
|
||||
logging.getLogger("hpack").setLevel(logging.CRITICAL)
|
||||
|
||||
logger.info("Checking if any credentials mode is set ...")
|
||||
|
||||
# Validate the authentication arguments
|
||||
|
||||
Reference in New Issue
Block a user