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
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: 2024-12-19 14:45:38 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.yml
and 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-Policy
header to log violations through SilverStripe