Skip to content

helpfulrobot/camspiers-silverstripe-csp-logging

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SilverStripe Content-Security-Policy Logging

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

About

Logs CSP violations through a logger

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%