2016-02-11 22:59:25 -06:00
|
|
|
<?php namespace Config;
|
2015-12-21 15:04:45 -06:00
|
|
|
|
|
|
|
use CodeIgniter\Config\BaseConfig;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class ContentSecurityPolicyConfig
|
|
|
|
*
|
|
|
|
* Stores the default settings for the ContentSecurityPolicy, if you
|
|
|
|
* choose to use it. The values here will be read in and set as defaults
|
|
|
|
* for the site. If needed, they can be overridden on a page-by-page basis.
|
|
|
|
*
|
2018-12-05 22:28:59 -08:00
|
|
|
* Suggested reference for explanations:
|
|
|
|
* https://www.html5rocks.com/en/tutorials/security/content-security-policy/
|
|
|
|
*
|
2016-02-11 22:59:25 -06:00
|
|
|
* @package Config
|
2015-12-21 15:04:45 -06:00
|
|
|
*/
|
2016-02-11 22:48:32 -06:00
|
|
|
class ContentSecurityPolicy extends BaseConfig
|
2015-12-21 15:04:45 -06:00
|
|
|
{
|
2018-12-05 22:28:59 -08:00
|
|
|
// broadbrush CSP management
|
|
|
|
|
|
|
|
public $reportOnly = false; // default CSP report context
|
|
|
|
public $reportURI = null; // URL to send violation reports to
|
|
|
|
public $upgradeInsecureRequests = false; // toggle for forcing https
|
|
|
|
|
|
|
|
// sources allowed; string or array of strings
|
|
|
|
// Note: once you set a policy to 'none', it cannot be further restricted
|
|
|
|
|
2018-12-06 15:38:02 -08:00
|
|
|
public $defaultSrc = null; // will default to self if not over-ridden
|
2018-12-05 22:28:59 -08:00
|
|
|
public $scriptSrc = 'self';
|
|
|
|
public $styleSrc = 'self';
|
|
|
|
public $imageSrc = 'self';
|
2018-12-06 15:38:02 -08:00
|
|
|
public $baseURI = null; // will default to self if not over-ridden
|
2018-12-06 13:48:43 -08:00
|
|
|
public $childSrc = 'self';
|
2018-12-05 22:28:59 -08:00
|
|
|
public $connectSrc = 'self';
|
|
|
|
public $fontSrc = null;
|
2018-12-06 13:48:43 -08:00
|
|
|
public $formAction = 'self';
|
2015-12-21 15:04:45 -06:00
|
|
|
public $frameAncestors = null;
|
2018-12-05 22:28:59 -08:00
|
|
|
public $mediaSrc = null;
|
2018-12-06 13:48:43 -08:00
|
|
|
public $objectSrc = 'self';
|
2018-12-05 22:28:59 -08:00
|
|
|
public $manifestSrc = null;
|
2015-12-21 15:04:45 -06:00
|
|
|
|
2018-12-05 22:28:59 -08:00
|
|
|
// mime types allowed; string or array of strings
|
2015-12-21 15:04:45 -06:00
|
|
|
public $pluginTypes = null;
|
|
|
|
|
2018-12-05 22:28:59 -08:00
|
|
|
// list of actions allowed; string or array of strings
|
|
|
|
public $sandbox = null;
|
2015-12-21 15:04:45 -06:00
|
|
|
|
|
|
|
}
|