ContentSecurityPolicy.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php namespace Config;
  2. use CodeIgniter\Config\BaseConfig;
  3. /**
  4. * Class ContentSecurityPolicyConfig
  5. *
  6. * Stores the default settings for the ContentSecurityPolicy, if you
  7. * choose to use it. The values here will be read in and set as defaults
  8. * for the site. If needed, they can be overridden on a page-by-page basis.
  9. *
  10. * Suggested reference for explanations:
  11. * https://www.html5rocks.com/en/tutorials/security/content-security-policy/
  12. *
  13. * @package Config
  14. */
  15. class ContentSecurityPolicy extends BaseConfig
  16. {
  17. // broadbrush CSP management
  18. public $reportOnly = false; // default CSP report context
  19. public $reportURI = null; // URL to send violation reports to
  20. public $upgradeInsecureRequests = false; // toggle for forcing https
  21. // sources allowed; string or array of strings
  22. // Note: once you set a policy to 'none', it cannot be further restricted
  23. public $defaultSrc = null; // will default to self if not over-ridden
  24. public $scriptSrc = 'self';
  25. public $styleSrc = 'self';
  26. public $imageSrc = 'self';
  27. public $baseURI = null; // will default to self if not over-ridden
  28. public $childSrc = 'self';
  29. public $connectSrc = 'self';
  30. public $fontSrc = null;
  31. public $formAction = 'self';
  32. public $frameAncestors = null;
  33. public $mediaSrc = null;
  34. public $objectSrc = 'self';
  35. public $manifestSrc = null;
  36. // mime types allowed; string or array of strings
  37. public $pluginTypes = null;
  38. // list of actions allowed; string or array of strings
  39. public $sandbox = null;
  40. }