Default `EventScrubber` uses `recursive=False`, so nested denylist keys are not scrubbed |
还没有人认领这个 Issue。
评估
调研方向
The issue is in sentry_sdk/scrubber.py where EventScrubber.init sets recursive=False by default. Review sentry_sdk/client.py to see how the scrubber is instantiated. Write a test that creates an event with a nested denylist key (like under 'extra') and verify it's not scrubbed with the default, then is scrubbed after setting recursive=True. Check if there are performance concerns with deep recursion and consider limiting to known containers.
由索引模型根据 Issue 内容生成。
描述
Static review of public source at commit 85e7ce66fcca. No traffic was sent to any Sentry environment.
EventScrubber only walks nested dict/list values when recursive=True, and that flag defaults to False:
sentry_sdk/scrubber.py:
class EventScrubber:
def __init__(
self,
denylist: "Optional[List[str]]" = None,
recursive: bool = False,
...
) -> None:
if isinstance(k, str) and k.lower() in self.denylist:
d[k] = AnnotatedValue.substituted_because_contains_sensitive_data()
elif self.recursive:
self.scrub_dict(v)
self.scrub_list(v)
The default client wires a scrubber without enabling recursion:
sentry_sdk/client.py:
rv["event_scrubber"] = EventScrubber(
send_default_pii=False
if rv["send_default_pii"] is None
else rv["send_default_pii"]
)
Top-level keys such as authorization are scrubbed; the same key nested under extra, request.data, or breadcrumb data is not. Integrators who assume “Sentry scrubs secrets by default” get shallow coverage only.
Suggested change:
- Default
recursive=TrueonEventScrubber, or passrecursive=Truefrom the client bootstrap. - If recursion cost is the concern, recurse only into known containers (
extra,request.data, breadcrumbdata, framevars) rather than the whole event. - Document the flag next to
send_default_piiin the scrubbing guide.
Severity: low–medium data-protection hardening (secret leakage via nested event fields). No proof-of-concept; no events were submitted.
Happy to send a focused PR + regression test with a nested denylist key if useful.
- 主要语言
- Python
- 星标
- 2.2k
- 派生
- 672
- 平均合并
- 22 小时 47 分钟
- 30 天内合并 PR
- 224
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
getsentry/sentry-python 的其他 Issue
-
Python
难度 2/5 1-3 小时 新手友好度 65/100
getsentry/sentry-python#7569 · 1 条评论 ·
-
Python
难度 1/5 1 小时以内 新手友好度 85/100
getsentry/sentry-python#7568 · 2 条评论 ·
-
Python
难度 2/5 1-3 小时 新手友好度 65/100
getsentry/sentry-python#7567 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
getsentry/sentry-python#7543 · 2 条评论 · 已指派 1 人 ·
-
Python
难度 2/5 1-3 小时 新手友好度 68/100
getsentry/sentry-python#6992 · 1 条评论 ·
查看 getsentry/sentry-python 的全部 Issue
相似的 Issue
-
essnmx good first issue
难度 1/5 1 小时以内 新手友好度 95/100
-
难度 2/5 1-3 小时 新手友好度 65/100
syfoud/Simulated_Scepter#174 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
Giskard-AI/giskard-oss#2840 · 1 条评论 ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success 未关闭area: repo bug perceived difficulty: 2
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 75/100
yeti-platform/yeti#1380 ·