camspiers / silverstripe-csp-logging
Logs CSP violations through a logger
Package info
github.com/camspiers/silverstripe-csp-logging
Type:silverstripe-module
pkg:composer/camspiers/silverstripe-csp-logging
dev-master
2014-02-08 10:44 UTC
Requires
- psr/log: ~1.0
Requires (Dev)
- phpunit/phpunit: ~3.7
- silverstripe/framework: ~3.1.0
- symfony/class-loader: ~2.3
This package is auto-updated.
Last update: 2026-02-19 17:34:30 UTC
README
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:
- Create a file called
mysite/_config/csp.ymland add your logging service to the controller
Injector: Camspiers\CSP\Controller: constructor: 0: %$Monolog
- Set your Content-Security-Policy headers
- Add "report-uri /csp-report/;" to the
Content-Security-Policyheader to log violations through SilverStripe