Skip to content

Commit deac85b

Browse files
authored
Scrub WiFi fields from Sentry events (#6048)
Make sure WiFi fields are scrubbed from Sentry events to prevent accidental exposure of sensitive information.
1 parent 7dcf5ba commit deac85b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

supervisor/utils/sentry.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from sentry_sdk.integrations.excepthook import ExcepthookIntegration
1313
from sentry_sdk.integrations.logging import LoggingIntegration
1414
from sentry_sdk.integrations.threading import ThreadingIntegration
15+
from sentry_sdk.scrubber import DEFAULT_DENYLIST, EventScrubber
1516

1617
from ..const import SUPERVISOR_VERSION
1718
from ..coresys import CoreSys
@@ -26,6 +27,7 @@ def init_sentry(coresys: CoreSys) -> None:
2627
"""Initialize sentry client."""
2728
if not sentry_sdk.is_initialized():
2829
_LOGGER.info("Initializing Supervisor Sentry")
30+
denylist = DEFAULT_DENYLIST + ["psk", "ssid"]
2931
# Don't use AsyncioIntegration(). We commonly handle task exceptions
3032
# outside of tasks. This would cause exception we gracefully handle to
3133
# be captured by sentry.
@@ -34,6 +36,7 @@ def init_sentry(coresys: CoreSys) -> None:
3436
before_send=partial(filter_data, coresys),
3537
auto_enabling_integrations=False,
3638
default_integrations=False,
39+
event_scrubber=EventScrubber(denylist=denylist),
3740
integrations=[
3841
AioHttpIntegration(
3942
failed_request_status_codes=frozenset(range(500, 600))

0 commit comments

Comments
 (0)