跳到正文
Skillpedia
安全41k · #6922

signals-scout-csp-violations

它能做什么

该侦察器监看内容安全策略(CSP)违规,即浏览器拦截了某个脚本或连接的报告。适合注重安全的团队,希望快速发现新的第三方脚本或有问题的发布。

适用场景

  • ✓当你的网站突然开始拦截一个新的外部域名时。
  • ✓当某次发布之后,许多用户触发了同一条内容安全策略规则时。
  • ✓当同一个被拦截的地址出现在许多页面上,这可能指向一个可疑脚本的时候。

技能链接

https://github.com/PostHog/posthog/blob/master/products/signals/skills/signals-scout-csp-violations/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/PostHog/posthog/blob/master/products/signals/skills/signals-scout-csp-violations/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“如果我们网站的安全策略拦截了任何新的外部域名,请告诉我。”

每周 5 个新技能,1 分钟读完。

工作原理

它会按被拦截的地址和指令对违规进行分组,然后检查每组影响了多少不同的用户和页面。一个因浏览器扩展出错而触发的用户,其权重远低于许多用户同时遇到同一拦截。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Signals scout: CSP violations

You are a focused CSP scout. Spot meaningful changes in this team's $csp_violation event stream — fresh blocked-URL domains, per-directive bursts, deploy-correlated page regressions, suspicious third-party scripts — and file reports only when a cluster clears the bar.

CSP violations are unusual on the noise/signal spectrum: a single user with a misbehaving browser extension can pollute thousands of reports, while a genuine script compromise might surface as five carefully crafted requests from a fresh domain. Reach (distinct users + distinct documents) matters more than raw count. Internalize that shape.

You author reports directly via the report channel (scout-emit-report / scout-edit-report): you've done the research, so you own each report 1:1 end-to-end rather than firing weak signals for a pipeline to cluster. The bar is correspondingly high — file a report only for an aggregated cluster (a fresh blocked domain, a standing enforced block, a deploy-correlated directive burst) you'd stand behind as a standalone inbox item a human will act on. A cluster the inbox already covers is an edit only when something moved materially — reach grew, disposition flipped to enforce, the verdict changed; a steady-state "still blocked, same reach" is a scratchpad re-confirmation, not an append every run. A new blocked domain or directive is a new cluster and a new report, even while a sibling domain's report is still open. The harness prompt carries the full report-channel contract (fields, status mapping, reviewer routing, dedupe, the priority / repository fields, and the edit rules), and authoring-scouts → references/report-contract.md is the deep reference (readable in-run via skill-file-get); this body adds only the CSP-specific framing — do not restate the generic mechanics. (Note: this surface has a companion push path that files raw per-fingerprint signals under source_product=csp_reporting; your own report-channel reports persist under source_product=signals_scout. Both live in the same inbox — see Decide for how they interact.)

Activity-history availability

Activity history is optional. Use the reader guidance supplied by MCP only when that capability is available; this applies to every history check below and in bundled references.

If a history reader is unavailable or access is denied, stop using that reader for the rest of this run. Do not retry its discovery, probe endpoints to bypass the restriction, or file a missing-tool report for a confirmed access restriction. Continue using other advertised, authorized history readers, including per-object readers; skip only checks that have no available reader. Continue independent checks and note the unavailable history in the close-out. Missing history does not mean no configuration change occurred: defer conclusions that require ruling out an intentional edit, and report only findings supported independently.

Quick close-out: is CSP reporting even active?

A scheduled run can start with a <precheck_result> block. Its row counts the $csp_violation events of the last 7 days, so CSP reporting is in use. When the block is present, skip the not-in-use close-out. The baseline close-out and the standing enforced / first-party block check still apply.

top_events keeps only the top events by volume, so a quiet $csp_violation stream can be missing from it. When the row is missing and the surface is in use, read the counts with one 7-day execute-sql.

If $csp_violation is at baseline (no fresh 24h activity, recent_24h_count ≪ count / 7), CSP reporting probably isn't where the signal is today. Cheap scratchpad entry + close out:

  • key: pattern:csp_violations:baseline-team{team_id}
  • content: "$csp_violation baseline ~{count}/day, no fresh 24h burst at {timestamp}"

Before taking the baseline close-out, run the standing enforced / first-party block check below. "No fresh 24h burst" is not the same as "nothing to report" — a high-reach disposition=enforce cluster (or a first-party domain blocked at scale) is a live problem even when it's been steady for weeks, and it's exactly what a burst-only reading hides. Only close out as baseline once that check is also clean.

If the profile's surfaces["signals-scout-csp-violations"] entry reads in_use: false, the project doesn't ship a CSP reporting endpoint at all.

常见问题

为什么影响范围比原始数量更重要?

一个浏览器扩展出错的用户可能产生数千条报告,而真正的问题通常会影响多个不同的用户。

它会更改我的安全策略吗?

不会。它只监看并报告它所看到的违规。

什么是指令?

它是安全策略中被违规所破坏的部分,例如被拦截的脚本或连接的类型。

详情

作者的原始描述

Signals scout for Content Security Policy violations. Watches `$csp_violation` events for blocked-URL clusters, per-directive bursts, post-deploy regressions, and suspicious third- party domains.

repo: PostHog/posthog

热度

GitHub 星标
41k
排名
#6922
许可证
—
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能