Scrub WiFi fields from Sentry events (#6048)

Make sure WiFi fields are scrubbed from Sentry events to prevent
accidental exposure of sensitive information.
This commit is contained in:
Stefan Agner 2025-07-29 17:42:43 +02:00 committed by GitHub
parent 7dcf5ba631
commit deac85bddb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -12,6 +12,7 @@ from sentry_sdk.integrations.dedupe import DedupeIntegration
from sentry_sdk.integrations.excepthook import ExcepthookIntegration
from sentry_sdk.integrations.logging import LoggingIntegration
from sentry_sdk.integrations.threading import ThreadingIntegration
from sentry_sdk.scrubber import DEFAULT_DENYLIST, EventScrubber
from ..const import SUPERVISOR_VERSION
from ..coresys import CoreSys
@ -26,6 +27,7 @@ def init_sentry(coresys: CoreSys) -> None:
"""Initialize sentry client."""
if not sentry_sdk.is_initialized():
_LOGGER.info("Initializing Supervisor Sentry")
denylist = DEFAULT_DENYLIST + ["psk", "ssid"]
# Don't use AsyncioIntegration(). We commonly handle task exceptions
# outside of tasks. This would cause exception we gracefully handle to
# be captured by sentry.
@ -34,6 +36,7 @@ def init_sentry(coresys: CoreSys) -> None:
before_send=partial(filter_data, coresys),
auto_enabling_integrations=False,
default_integrations=False,
event_scrubber=EventScrubber(denylist=denylist),
integrations=[
AioHttpIntegration(
failed_request_status_codes=frozenset(range(500, 600))