Aller au contenu
Skillpedia
Sécurité41k · #6922

signals-scout-csp-violations

Ce qu’il fait

Ce scout surveille les violations de Content Security Policy, c'est-à-dire les rapports indiquant qu'un navigateur a bloqué un script ou une connexion. Il s'adresse aux équipes attentives à la sécurité qui veulent repérer rapidement un nouveau script tiers ou un déploiement défectueux.

Quand l’utiliser

  • ✓Quand votre site commence soudainement à bloquer un nouveau domaine externe.
  • ✓Quand une règle de Content Security Policy est violée par de nombreux utilisateurs après un déploiement.
  • ✓Quand une seule adresse bloquée apparaît sur de nombreuses pages, ce qui peut signaler un script suspect.

Lien du skill

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

Copiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.

Comment l’utiliser

Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.

Message prêt à coller

Utilise ce skill pour m’aider : https://github.com/PostHog/posthog/blob/master/products/signals/skills/signals-scout-csp-violations/SKILL.md Lis le fichier SKILL.md de ce lien et suis ses instructions pour ma tâche.
Envie que votre IA trouve seule des skills comme celui-ci ?Installez le MCP gratuit de Skillpedia : une ligne, et elle cherche parmi 15 000+ skills avant chaque tâche.Installer en 1 minute →

Exemple de demande à votre IA

“Dis-moi si de nouveaux domaines externes sont bloqués par notre politique de sécurité sur notre site.”

5 nouveaux skills par semaine. 1 minute de lecture.

Comment ça marche

Le scout regroupe les violations par adresse bloquée et par directive, puis mesure le nombre d'utilisateurs et de pages distincts touchés par chaque groupe. Un utilisateur dont l'extension de navigateur est défectueuse pèse beaucoup moins que de nombreux utilisateurs touchant le même blocage.

Contenu technique (SKILL.md original)

Texte original de l’auteur, en anglais, directement depuis 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.

Questions fréquentes

Pourquoi la portée compte-t-elle plus que le nombre brut ?

Un seul utilisateur avec une extension défectueuse peut générer des milliers de rapports, alors qu'un vrai problème touche en général plusieurs utilisateurs différents.

Modifie-t-il ma politique de sécurité ?

Non. Il surveille et signale seulement les violations qu'il observe.

Qu'est-ce qu'une directive ?

C'est la partie de la politique de sécurité qu'une violation enfreint, comme le type de script ou de connexion qui a été bloqué.

Détails

Description originale de l’auteur

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

Popularité

Étoiles GitHub
41k
Position au classement
#6922
Licence
—
Mis à jour
02/11/2026

Ce skill vous est-il utile ?

0

Connectez-vous pour voter.

Commentaires

  • …

Autres skills de ce dépôt

Skills similaires