camspiers/silverstripe-csp-logging

Logs CSP violations through a logger

Installs: 11

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 3

Forks: 4

Open Issues: 3

Type:silverstripe-module

dev-master 2014-02-08 10:44 UTC

This package is auto-updated.

Last update: 2024-11-19 14:27:55 UTC


README

Build Status

Allows the logging of CSP violations in SilverStripe

Installation (with composer)

composer require camspiers/silverstripe-csp-logging

Usage

Provide an instance of Psr\Log\LoggerInterface to the CSP controller:

  1. Create a file called mysite/_config/csp.yml and add your logging service to the controller
Injector:
  Camspiers\CSP\Controller:
    constructor:
      0: %$Monolog
  1. Set your Content-Security-Policy headers
  2. Add "report-uri /csp-report/;" to the Content-Security-Policy header to log violations through SilverStripe