CSPRules
Product · in development

CSP Ledger: a system of record for every rule in a Content Security Policy.

A CSP header records what is allowed. It does not record why, for whom, on whose approval, or until when. CSP Ledger keeps that record for each source in the policy, tied to the reports that show whether the source is still in use.

The problem the header cannot solve

Accumulation

Entries are added, rarely removed

Each campaign, vendor trial and integration adds a source. Nothing in the header expires. A 2016 analysis of 26,011 policies found that 94.72% could be bypassed, most often through allowlisted hosts no one had reviewed.1

Provenance

The reason leaves with the person

The header does not say who requested a source, what it is for, or who approved it. When staff or agencies change, that knowledge goes with them, and the entry stays because removing it is a risk no one will own.

Accountability

Auditors and incidents ask for it

PCI DSS 6.4.3 requires a written justification and an authorisation for each payment-page script.2 A vendor compromise, such as OPTIMJACK on 16 November 2026, requires knowing at once which pages trust the vendor.4

What each entry records

One record per source and directive. The example below is illustrative.

script-srchttps://cdn.optimizely.com
SUSPENDED: VENDOR INCIDENT
Scope
/products/*, /pricing. Excluded from /checkout/*
Environments
production, staging
Owner
Growth Engineering
Requested by
Growth Marketing
Justification
Optimizely Web experiments on product and pricing pages.
Reference
Change request CSP-142 · Vendor agreement on file
Approved
Application Security, 2023-04-11
Review by
2026-11-20 (quarterly)
Report evidence
412k page loads in 30 days. 0 violations until 16 Nov 2026 04:21 UTC.
History
  1. Added. Approved by Application Security.
  2. Scope narrowed. Removed from /checkout/* for PCI DSS 6.4.3.
  3. Reviewed. Retained.
  4. Suspended after vendor incident. Owner notified.

Lifecycle of a rule

Every source passes through the same stages. The header is generated from the ledger, so an entry cannot reach production without a record.

  1. RequestRequester names the source, directive, pages and business reason.
  2. ReviewSecurity checks the host for known bypasses and narrows scope to the pages that need it.
  3. ApproveAn owner is assigned and a review date set. The approval is recorded.
  4. DeployThe source ships in report-only, then enforced, per environment.6
  5. ObserveUsage and violation reports are attached to the entry.3
  6. Re-reviewAt the review date the owner confirms the source, narrows it, or lets it lapse.
  7. RetireSources with no usage, no owner or an ended contract are removed, with the reason kept.

Who uses it

RoleUses the ledger to
Application securityApprove sources against a consistent standard. Block risky values such as 'unsafe-eval' and wildcard hosts at request time, not after deployment.
EngineeringGenerate the header per environment from approved records instead of editing it by hand. See why a source exists before changing it.
Marketing and growthRequest a tag with a stated purpose and end date. Know when a vendor will be removed.
Compliance and auditExport the payment-page script inventory, justifications and approvals for PCI DSS 6.4.3, and the change history for 11.6.1.2
Vendor managementLink each source to its contract, and find every source affected when a contract ends or a vendor reports an incident.

16 November 2026, with and without a ledger

The questions every Optimizely Web customer had to answer that day, and where the answers came from.4,5

QuestionWithout a ledgerWith a ledger
Which pages load Optimizely?Search templates, tag manager and CDN configurationScope field on one record
Was it allowed on checkout?Read the header for each route, if routes differScope shows checkout excluded, and when that was decided
Who owns the relationship?Ask aroundOwner and requester on the record
Did our policy block 1688360.cc?Query raw report logs, if collectedViolation spike attached to the record from 04:21 UTC
Can we remove it today?Unknown dependencies, so usually noUsage evidence and justification support a decision
What do we tell auditors?Reconstruct from email and ticketsExport the record and its history

Check how a policy fared on 16 November with the policy test.

How this compares with existing reporting and client-side security tools: CSP tools compared.

Long-term outcomes

Smaller policy
Sources are retired on usage evidence rather than kept out of caution. Fewer allowlisted hosts means fewer potential bypasses.1
Faster response
When a vendor is compromised, the affected pages, owners and directives are already known.
Continuous evidence
Inventory, justification, approval and change history exist as a by-product of normal work, not as an audit project.2
Controlled change
Dangerous values are refused at request time. The policy cannot drift away from what was approved.
Retained knowledge
The reason for every source survives staff, agency and vendor turnover.

Interface preview

EXAMPLE DATA2 REQUIRE ACTION2 DUE FOR REVIEW
SourceDirectiveOwnerReasonAddedReview bySeen (30d)Status
https://cdn.optimizely.comscript-srcGrowth teamA/B testing on product pages2023-04-112026-11-20412kVendor incident
*.cloudfront.netscript-srcUnassignedUnknown2021-08-022024-08-020Unused, overdue
https://www.googletagmanager.comscript-srcMarketing opsTag manager2022-01-192026-12-011.2MReview soon
https://js.stripe.comscript-src, frame-srcPaymentsCheckout card element2022-06-302027-06-3038kCurrent
https://api.stripe.comconnect-srcPaymentsCheckout API calls2022-06-302027-06-3038kCurrent
https://static.hotjar.comscript-srcUX researchQ3 session recording study2025-07-012025-10-0196kCampaign ended

Rows are illustrative, not real data. "Seen (30d)" counts page loads that used the source, derived from reports.

Roadmap

Policy import AVAILABLE

Parse a header into individual sources. The parser behind the policy test provides this.

Records and ownership PLANNED

Owner, requester, justification, reference and approval per source.

Review dates PLANNED

Each source carries a review date. Overdue and unowned sources are flagged.

Report ingestion PROPOSED

A report-to endpoint that attaches usage and violations to each record.3

Change workflow PROPOSED

Request, approval and header generation per environment, with diffs and history.7

Vendor incident view PROPOSED

On a vendor incident, every affected source, page, owner and directive in one list.

Header export PROPOSED

Generate the approved policy for nginx, Apache, Caddy, HAProxy, IIS and CDN platforms. Current snippets.

Early access

CSP Ledger is in development at CSP Rules, with Thirdwave, LLC. Organisations with large, long-lived or audited policies are invited to take part. Participants supply requirements and test against their own policies.

References

  1. [1]
    CSP Is Dead, Long Live CSP! On the Insecurity of Whitelists and the Future of Content Security Policy. Weichselbaum, Spagnuolo, Lekies, Janc. ACM CCS, 2016. Analysis of 26,011 unique policies from 1,680,867 hosts.
  2. [2]
    PCI DSS v4.0.1, Requirements 6.4.3 and 11.6.1. PCI Security Standards Council. Payment-page script inventory, authorization and tamper detection. Mandatory from 31 March 2025.
  3. [3]
  4. [4]
    Optimizely supply-chain attack hits at least 178 organisations. BreachHistory, Nov 2026. Timeline, indicators of compromise and remediation steps. Cites Report URI's snippet scan.
  5. [5]
    CNN, Zoom, Fox News served visitors a crypto-stealing skimmer. Amirul Cyber, 16 Nov 2026. Original disclosure. Names the campaign OPTIMJACK.
  6. [6]
    Content Security Policy Cheat Sheet. OWASP Cheat Sheet Series.
  7. [7]
    Content Security Policy Level 3. W3C, Web Application Security Working Group. Working Draft. The normative definition of directives, source matching and fallback.