Issue Feature Closed

#102079CSP violation Event

Henrik Jensen 10/02/23, 10:32 updated 03/31/26, 09:00

Description

We would very much like to have an additional Event dispatch when an CSP violation happens.

In the case where some external javascript changes or someone adds some external javascript it would be nice
to be able to enable some kind of notification. For example by email or Slack or something else…

Our worry is that without any notification the violation could be unhandled for longer periods of time which could
leads to other and larger problems (loss of revenues, customer experience etc).

Our suggestion/idea is to dispatch an event right after the report is persisted. To keep it simple the whole report is dispatched, thus
making it the eventlisteners job to handle what/when/how notification are sent based on the incoming report.

Example gists:
https://gist.github.com/hdj-typoconsult/71a06fd4af042aed7d3efa4f3ba2c67b
https://gist.github.com/hdj-typoconsult/fbf3579a2ba38a347c1f488976116852

Reviews 1

History 917

  1. Oliver Hader commented <span data-processor="relativetime" data-value="2023-10-18T14:42:32+00:00" > 10/18/23, 14:42 </span>

    Sounds good… maybe there’s also a demand for pre-filtering these reports – e.g. having an event that allows to skip persisting particular reports (e.g. those coming from browser extensions).

  2. Henrik Jensen commented <span data-processor="relativetime" data-value="2023-10-23T06:46:00+00:00" > 10/23/23, 06:46 </span>

    Oliver Hader wrote in #note-3:
    > Sounds good… maybe there’s also a demand for pre-filtering these reports – e.g. having an event that allows to skip persisting particular reports (e.g. those coming from browser extensions).

    That is a good idea too.

  3. Oliver Hader commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-02-19T13:40:08+00:00" > 02/19/26, 13:40 </span>

    Applied in changeset commit:7b69b42337086c547c082e1e5bbb11415f3e39c9.