Simple Content Security Policy example
Set
define('ENVIROMENT', 'test'); // live, test
Include
require_once('csp/directives.php')
and watch how it works.
csp/directives.php
Any violation is pushed to
csp/violations.txt
Enviroment determines which policy mode is used.
Test - won't output not allowed resources
Live - will output all resources, even not allowed.
###Preview
http://htmlpreview.github.io/?https://github.com/latenights/simple-csp/blob/master/index.php
More info about Content Security Policy: https://content-security-policy.com/