mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-31 04:56:31 +00:00
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:
parent
7dcf5ba631
commit
deac85bddb
@ -12,6 +12,7 @@ from sentry_sdk.integrations.dedupe import DedupeIntegration
|
|||||||
from sentry_sdk.integrations.excepthook import ExcepthookIntegration
|
from sentry_sdk.integrations.excepthook import ExcepthookIntegration
|
||||||
from sentry_sdk.integrations.logging import LoggingIntegration
|
from sentry_sdk.integrations.logging import LoggingIntegration
|
||||||
from sentry_sdk.integrations.threading import ThreadingIntegration
|
from sentry_sdk.integrations.threading import ThreadingIntegration
|
||||||
|
from sentry_sdk.scrubber import DEFAULT_DENYLIST, EventScrubber
|
||||||
|
|
||||||
from ..const import SUPERVISOR_VERSION
|
from ..const import SUPERVISOR_VERSION
|
||||||
from ..coresys import CoreSys
|
from ..coresys import CoreSys
|
||||||
@ -26,6 +27,7 @@ def init_sentry(coresys: CoreSys) -> None:
|
|||||||
"""Initialize sentry client."""
|
"""Initialize sentry client."""
|
||||||
if not sentry_sdk.is_initialized():
|
if not sentry_sdk.is_initialized():
|
||||||
_LOGGER.info("Initializing Supervisor Sentry")
|
_LOGGER.info("Initializing Supervisor Sentry")
|
||||||
|
denylist = DEFAULT_DENYLIST + ["psk", "ssid"]
|
||||||
# Don't use AsyncioIntegration(). We commonly handle task exceptions
|
# Don't use AsyncioIntegration(). We commonly handle task exceptions
|
||||||
# outside of tasks. This would cause exception we gracefully handle to
|
# outside of tasks. This would cause exception we gracefully handle to
|
||||||
# be captured by sentry.
|
# be captured by sentry.
|
||||||
@ -34,6 +36,7 @@ def init_sentry(coresys: CoreSys) -> None:
|
|||||||
before_send=partial(filter_data, coresys),
|
before_send=partial(filter_data, coresys),
|
||||||
auto_enabling_integrations=False,
|
auto_enabling_integrations=False,
|
||||||
default_integrations=False,
|
default_integrations=False,
|
||||||
|
event_scrubber=EventScrubber(denylist=denylist),
|
||||||
integrations=[
|
integrations=[
|
||||||
AioHttpIntegration(
|
AioHttpIntegration(
|
||||||
failed_request_status_codes=frozenset(range(500, 600))
|
failed_request_status_codes=frozenset(range(500, 600))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user