<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.owasp.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Denis+Vinicius+de+Mello</id>
		<title>OWASP - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.owasp.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Denis+Vinicius+de+Mello"/>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php/Special:Contributions/Denis_Vinicius_de_Mello"/>
		<updated>2026-05-01T09:59:30Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.27.2</generator>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Content_Security_Policy_Cheat_Sheet&amp;diff=192721</id>
		<title>Content Security Policy Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Content_Security_Policy_Cheat_Sheet&amp;diff=192721"/>
				<updated>2015-04-04T12:38:03Z</updated>
		
		<summary type="html">&lt;p&gt;Denis Vinicius de Mello: /* CSP Cheat Sheet - Guide for main technologies */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Content Security Policy (CSP) is an important standard that is aimed to prevent attacks such as cross-site scripting (XSS) and more importantly to reduce the harm caused by content injection attacks.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Content Security Policy (CSP) is an important standard that is aimed to prevent attacks such as cross-site scripting (XSS) and '''more importantly to reduce the harm caused by content injection attacks.'''&lt;br /&gt;
&lt;br /&gt;
= Main Reference =&lt;br /&gt;
&lt;br /&gt;
The most recent version of the CSP standard can be found here:  https://w3c.github.io/webappsec/specs/content-security-policy/&lt;br /&gt;
&lt;br /&gt;
= CSP Cheat Sheet - Guide for main technologies =&lt;br /&gt;
&lt;br /&gt;
This section summarizes the implementation and/or support for CSP in different technologies (either acting as Client or Server).&lt;br /&gt;
See below the details.&lt;br /&gt;
&lt;br /&gt;
'''Google Chrome'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Google Chrome based web applications and theme uses a manifest file named manifest.json.&lt;br /&gt;
There is a section in the manifest file where the developer can declare the CSP directives.&lt;br /&gt;
For further details, please refer to Content Security Police for Google Chrome.&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
  ''// Required''&lt;br /&gt;
  &amp;quot;manifest_version&amp;quot;: 2,&lt;br /&gt;
  &amp;quot;name&amp;quot;: &amp;quot;My Extension&amp;quot;,&lt;br /&gt;
  &amp;quot;version&amp;quot;: &amp;quot;versionString&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  ''// Recommended''&lt;br /&gt;
  &amp;quot;default_locale&amp;quot;: &amp;quot;en&amp;quot;,&lt;br /&gt;
  &amp;quot;description&amp;quot;: &amp;quot;A plain text description&amp;quot;,&lt;br /&gt;
  &amp;quot;icons&amp;quot;: {...},&lt;br /&gt;
&lt;br /&gt;
  ''// Pick one (or none)''&lt;br /&gt;
  &amp;quot;browser_action&amp;quot;: {...},&lt;br /&gt;
  &amp;quot;page_action&amp;quot;: {...},&lt;br /&gt;
&lt;br /&gt;
  ''// Optional''&lt;br /&gt;
  &amp;quot;author&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;automation&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;background&amp;quot;: {&lt;br /&gt;
    // Recommended&lt;br /&gt;
    &amp;quot;persistent&amp;quot;: false&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;background_page&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;chrome_settings_overrides&amp;quot;: {...},&lt;br /&gt;
  &amp;quot;chrome_ui_overrides&amp;quot;: {&lt;br /&gt;
    &amp;quot;bookmarks_ui&amp;quot;: {&lt;br /&gt;
      &amp;quot;remove_bookmark_shortcut&amp;quot;: true,&lt;br /&gt;
      &amp;quot;remove_button&amp;quot;: true&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;chrome_url_overrides&amp;quot;: {...},&lt;br /&gt;
  &amp;quot;commands&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;content_pack&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;content_scripts&amp;quot;: [{...}],&lt;br /&gt;
  &amp;quot;content_security_policy&amp;quot;: &amp;quot;policyString&amp;quot;,&lt;br /&gt;
  &amp;quot;converted_from_user_script&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;current_locale&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;devtools_page&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;externally_connectable&amp;quot;: {&lt;br /&gt;
    &amp;quot;matches&amp;quot;: [&amp;quot;*://*.example.com/*&amp;quot;]&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;file_browser_handlers&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;homepage_url&amp;quot;: &amp;quot;http://path/to/homepage&amp;quot;,&lt;br /&gt;
  &amp;quot;import&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;incognito&amp;quot;: &amp;quot;spanning or split&amp;quot;,&lt;br /&gt;
  &amp;quot;input_components&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;key&amp;quot;: &amp;quot;publicKey&amp;quot;,&lt;br /&gt;
  &amp;quot;minimum_chrome_version&amp;quot;: &amp;quot;versionString&amp;quot;,&lt;br /&gt;
  &amp;quot;nacl_modules&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;oauth2&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;offline_enabled&amp;quot;: true,&lt;br /&gt;
  &amp;quot;omnibox&amp;quot;: {&lt;br /&gt;
    &amp;quot;keyword&amp;quot;: &amp;quot;aString&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;optional_permissions&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;options_page&amp;quot;: &amp;quot;aFile.html&amp;quot;,&lt;br /&gt;
  &amp;quot;options_ui&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;page_actions&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;permissions&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;platforms&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;plugins&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;requirements&amp;quot;: {...},&lt;br /&gt;
  &amp;quot;sandbox&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;script_badge&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;short_name&amp;quot;: &amp;quot;Short Name&amp;quot;,&lt;br /&gt;
  &amp;quot;signature&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;spellcheck&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;storage&amp;quot;: {&lt;br /&gt;
    &amp;quot;managed_schema&amp;quot;: &amp;quot;schema.json&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;system_indicator&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;tts_engine&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;update_url&amp;quot;: &amp;quot;http://path/to/updateInfo.xml&amp;quot;,&lt;br /&gt;
  &amp;quot;web_accessible_resources&amp;quot;: [...]}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Apache'''&lt;br /&gt;
&lt;br /&gt;
It is required to add lines to the httpd.conf configuration file, or inside .htaccess files or virtual host sections.&lt;br /&gt;
Also, it is required to enable mod_headers, and after inserting the lines according to your specific needs, restart Apache.&lt;br /&gt;
The headers below are good examples to add in the files (change/modify it properly):&lt;br /&gt;
&lt;br /&gt;
Header unset Content-Security-Policy &lt;br /&gt;
Header add Content-Security-Policy &amp;quot;default-src 'self'&amp;quot; &lt;br /&gt;
Header unset X-Content-Security-Policy &lt;br /&gt;
Header add X-Content-Security-Policy &amp;quot;default-src 'self'&amp;quot; &lt;br /&gt;
Header unset X-WebKit-CSP Header add X-WebKit-CSP &amp;quot;default-src 'self'&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''WordPress'''&lt;br /&gt;
&lt;br /&gt;
Most of the configuration can be done in Apache, however, Wordpress has a plugin that allows developers/administrator to set up their own custom policies. The plugin however is not update for 2 years. Use it carefully.&lt;br /&gt;
A workaround can be the creation or modification of the file htaccess under wp-admin directory.&lt;br /&gt;
&lt;br /&gt;
An example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;IfModule mod_headers.c&amp;gt; &lt;br /&gt;
Header set Content-Security-Policy &amp;quot;default-src 'self'; &lt;br /&gt;
img-src 'self' data: http: https: *.gravatar.com; &lt;br /&gt;
script-src 'self' 'unsafe-inline' 'unsafe-eval'; &lt;br /&gt;
style-src 'self' 'unsafe-inline' http: https: fonts.googleapis.com; &lt;br /&gt;
font-src 'self' data: http: https: fonts.googleapis.com themes.googleusercontent.com;&amp;quot; &lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''nginx'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;For nginx, it is required to edit the nginx.conf file. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# config to don't allow the browser to render the page inside an frame or iframe&lt;br /&gt;
&lt;br /&gt;
# and avoid clickjacking http://en.wikipedia.org/wiki/Clickjacking&lt;br /&gt;
&lt;br /&gt;
# if you need to allow [i]frames, you can use SAMEORIGIN or even set an uri with ALLOW-FROM uri # https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Options&lt;br /&gt;
add_header X-Frame-Options SAMEORIGIN;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# when serving user-supplied content, include a X-Content-Type-Options: nosniff header along with the Content-Type: header,&lt;br /&gt;
&lt;br /&gt;
# to disable content-type sniffing on some browsers.&lt;br /&gt;
&lt;br /&gt;
# https://www.owasp.org/index.php/List_of_useful_HTTP_headers&lt;br /&gt;
&lt;br /&gt;
# currently suppoorted in IE &amp;gt; 8 http://blogs.msdn.com/b/ie/archive/2008/09/02/ie8-security-part-vi-beta-2-update.aspx&lt;br /&gt;
&lt;br /&gt;
# http://msdn.microsoft.com/en-us/library/ie/gg622941(v=vs.85).aspx&lt;br /&gt;
&lt;br /&gt;
# 'soon' on Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=471020&lt;br /&gt;
add_header X-Content-Type-Options nosniff;&lt;br /&gt;
&lt;br /&gt;
# This header enables the Cross-site scripting (XSS) filter built into most recent web browsers.&lt;br /&gt;
&lt;br /&gt;
# It's usually enabled by default anyway, so the role of this header is to re-enable the filter for&lt;br /&gt;
&lt;br /&gt;
# this particular website if it was disabled by the user.&lt;br /&gt;
&lt;br /&gt;
# https://www.owasp.org/index.php/List_of_useful_HTTP_headers&lt;br /&gt;
add_header X-XSS-Protection &amp;quot;1; mode=block&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
# with Content Security Policy (CSP) enabled(and a browser that supports it(http://caniuse.com/#feat=contentsecuritypolicy),&lt;br /&gt;
&lt;br /&gt;
# you can tell the browser that it can only download content from the domains you explicitly allow&lt;br /&gt;
&lt;br /&gt;
# http://www.html5rocks.com/en/tutorials/security/content-security-policy/&lt;br /&gt;
&lt;br /&gt;
# https://www.owasp.org/index.php/Content_Security_Policy&lt;br /&gt;
&lt;br /&gt;
# I need to change our application code so we can increase security by disabling 'unsafe-inline' 'unsafe-eval'&lt;br /&gt;
&lt;br /&gt;
# directives for css and js(if you have inline css or js, you will need to keep it too).&lt;br /&gt;
&lt;br /&gt;
# more: http://www.html5rocks.com/en/tutorials/security/content-security-policy/#inline-code-considered-harmful&lt;br /&gt;
add_header Content-Security-Policy &amp;quot;default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://ssl.google-analytics.com https://assets.zendesk.com https://connect.facebook.net; img-src 'self' https://example.com https://example1.com; style-src https://example.com; font-src https://example.com; frame-src https://example.com; object-src 'none'&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
server {&lt;br /&gt;
 listen 443 ssl default deferred;&lt;br /&gt;
 server_name .forgott.com;&lt;br /&gt;
 &lt;br /&gt;
 ssl_certificate the_path_of_your_certificate.crt;&lt;br /&gt;
 ssl_certificate_key the_path_of_your_key.key;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Django'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Django recently introduced a package with a number a collection of models, views and middlewares to aid secure Django based projects.&lt;br /&gt;
The installation of this model can be done through from Python packages repository: &lt;br /&gt;
pip install django-security&lt;br /&gt;
Also, the the latest development version, install from django-security repository on GitHub:&lt;br /&gt;
git clone https://github.com/sdelements/django-security.git&lt;br /&gt;
cd django-security&lt;br /&gt;
sudo python setup.py install&lt;br /&gt;
For each Djangon’s application, the settings.py file must be modified.&lt;br /&gt;
&lt;br /&gt;
== INSTALLED_APPS = (&lt;br /&gt;
    ...&lt;br /&gt;
    'security',&lt;br /&gt;
    ...&lt;br /&gt;
    )&lt;br /&gt;
 ==&lt;br /&gt;
&lt;br /&gt;
Middleware modules can be added to MIDDLEWARE_CLASSES list in settings file. Particularly, it is our interesting the ContentSecurityPolicyMiddleware. It sends Content Security Policy (CSP) header in HTTP response.:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MIDDLEWARE_CLASSES = (&lt;br /&gt;
...&lt;br /&gt;
'security.middleware.DoNotTrackMiddleware',&lt;br /&gt;
 ==&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors =&lt;br /&gt;
&lt;br /&gt;
Neil Mattatall - neil[at]owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
Denis Mello - ddtaxe&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
{{Cheatsheet_Navigation}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Denis Vinicius de Mello</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Content_Security_Policy_Cheat_Sheet&amp;diff=192720</id>
		<title>Content Security Policy Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Content_Security_Policy_Cheat_Sheet&amp;diff=192720"/>
				<updated>2015-04-04T12:36:22Z</updated>
		
		<summary type="html">&lt;p&gt;Denis Vinicius de Mello: /* CSP Cheat Sheet - Guide for main technologies */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Content Security Policy (CSP) is an important standard that is aimed to prevent attacks such as cross-site scripting (XSS) and more importantly to reduce the harm caused by content injection attacks.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Content Security Policy (CSP) is an important standard that is aimed to prevent attacks such as cross-site scripting (XSS) and '''more importantly to reduce the harm caused by content injection attacks.'''&lt;br /&gt;
&lt;br /&gt;
= Main Reference =&lt;br /&gt;
&lt;br /&gt;
The most recent version of the CSP standard can be found here:  https://w3c.github.io/webappsec/specs/content-security-policy/&lt;br /&gt;
&lt;br /&gt;
= CSP Cheat Sheet - Guide for main technologies =&lt;br /&gt;
&lt;br /&gt;
This section summarizes the implementation and/or support for CSP in different technologies (either acting as Client or Server).&lt;br /&gt;
See below the details.&lt;br /&gt;
&lt;br /&gt;
'''Google Chrome'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Google Chrome based web applications and theme uses a manifest file named manifest.json.&lt;br /&gt;
There is a section in the manifest file where the developer can declare the CSP directives.&lt;br /&gt;
For further details, please refer to Content Security Police for Google Chrome.&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
  ''// Required''&lt;br /&gt;
  &amp;quot;manifest_version&amp;quot;: 2,&lt;br /&gt;
  &amp;quot;name&amp;quot;: &amp;quot;My Extension&amp;quot;,&lt;br /&gt;
  &amp;quot;version&amp;quot;: &amp;quot;versionString&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  ''// Recommended''&lt;br /&gt;
  &amp;quot;default_locale&amp;quot;: &amp;quot;en&amp;quot;,&lt;br /&gt;
  &amp;quot;description&amp;quot;: &amp;quot;A plain text description&amp;quot;,&lt;br /&gt;
  &amp;quot;icons&amp;quot;: {...},&lt;br /&gt;
&lt;br /&gt;
  ''// Pick one (or none)''&lt;br /&gt;
  &amp;quot;browser_action&amp;quot;: {...},&lt;br /&gt;
  &amp;quot;page_action&amp;quot;: {...},&lt;br /&gt;
&lt;br /&gt;
  ''// Optional''&lt;br /&gt;
  &amp;quot;author&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;automation&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;background&amp;quot;: {&lt;br /&gt;
    // Recommended&lt;br /&gt;
    &amp;quot;persistent&amp;quot;: false&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;background_page&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;chrome_settings_overrides&amp;quot;: {...},&lt;br /&gt;
  &amp;quot;chrome_ui_overrides&amp;quot;: {&lt;br /&gt;
    &amp;quot;bookmarks_ui&amp;quot;: {&lt;br /&gt;
      &amp;quot;remove_bookmark_shortcut&amp;quot;: true,&lt;br /&gt;
      &amp;quot;remove_button&amp;quot;: true&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;chrome_url_overrides&amp;quot;: {...},&lt;br /&gt;
  &amp;quot;commands&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;content_pack&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;content_scripts&amp;quot;: [{...}],&lt;br /&gt;
  &amp;quot;content_security_policy&amp;quot;: &amp;quot;policyString&amp;quot;,&lt;br /&gt;
  &amp;quot;converted_from_user_script&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;current_locale&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;devtools_page&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;externally_connectable&amp;quot;: {&lt;br /&gt;
    &amp;quot;matches&amp;quot;: [&amp;quot;*://*.example.com/*&amp;quot;]&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;file_browser_handlers&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;homepage_url&amp;quot;: &amp;quot;http://path/to/homepage&amp;quot;,&lt;br /&gt;
  &amp;quot;import&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;incognito&amp;quot;: &amp;quot;spanning or split&amp;quot;,&lt;br /&gt;
  &amp;quot;input_components&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;key&amp;quot;: &amp;quot;publicKey&amp;quot;,&lt;br /&gt;
  &amp;quot;minimum_chrome_version&amp;quot;: &amp;quot;versionString&amp;quot;,&lt;br /&gt;
  &amp;quot;nacl_modules&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;oauth2&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;offline_enabled&amp;quot;: true,&lt;br /&gt;
  &amp;quot;omnibox&amp;quot;: {&lt;br /&gt;
    &amp;quot;keyword&amp;quot;: &amp;quot;aString&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;optional_permissions&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;options_page&amp;quot;: &amp;quot;aFile.html&amp;quot;,&lt;br /&gt;
  &amp;quot;options_ui&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;page_actions&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;permissions&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;platforms&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;plugins&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;requirements&amp;quot;: {...},&lt;br /&gt;
  &amp;quot;sandbox&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;script_badge&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;short_name&amp;quot;: &amp;quot;Short Name&amp;quot;,&lt;br /&gt;
  &amp;quot;signature&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;spellcheck&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;storage&amp;quot;: {&lt;br /&gt;
    &amp;quot;managed_schema&amp;quot;: &amp;quot;schema.json&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;system_indicator&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;tts_engine&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;update_url&amp;quot;: &amp;quot;http://path/to/updateInfo.xml&amp;quot;,&lt;br /&gt;
  &amp;quot;web_accessible_resources&amp;quot;: [...]}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Apache'''&lt;br /&gt;
&lt;br /&gt;
It is required to add lines to the httpd.conf configuration file, or inside .htaccess files or virtual host sections.&lt;br /&gt;
Also, it is required to enable mod_headers, and after inserting the lines according to your specific needs, restart Apache.&lt;br /&gt;
The headers below are good examples to add in the files (change/modify it properly):&lt;br /&gt;
&lt;br /&gt;
Header unset Content-Security-Policy &lt;br /&gt;
Header add Content-Security-Policy &amp;quot;default-src 'self'&amp;quot; &lt;br /&gt;
Header unset X-Content-Security-Policy &lt;br /&gt;
Header add X-Content-Security-Policy &amp;quot;default-src 'self'&amp;quot; &lt;br /&gt;
Header unset X-WebKit-CSP Header add X-WebKit-CSP &amp;quot;default-src 'self'&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''WordPress'''&lt;br /&gt;
&lt;br /&gt;
Most of the configuration can be done in Apache, however, Wordpress has a plugin that allows developers/administrator to set up their own custom policies. The plugin however is not update for 2 years. Use it carefully.&lt;br /&gt;
A workaround can be the creation or modification of the file htaccess under wp-admin directory.&lt;br /&gt;
&lt;br /&gt;
An example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;IfModule mod_headers.c&amp;gt; &lt;br /&gt;
Header set Content-Security-Policy &amp;quot;default-src 'self'; &lt;br /&gt;
img-src 'self' data: http: https: *.gravatar.com; &lt;br /&gt;
script-src 'self' 'unsafe-inline' 'unsafe-eval'; &lt;br /&gt;
style-src 'self' 'unsafe-inline' http: https: fonts.googleapis.com; &lt;br /&gt;
font-src 'self' data: http: https: fonts.googleapis.com themes.googleusercontent.com;&amp;quot; &lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''nginx'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;For nginx, it is required to edit the nginx.conf file. &lt;br /&gt;
&lt;br /&gt;
# config to don't allow the browser to render the page inside an frame or iframe&lt;br /&gt;
# and avoid clickjacking http://en.wikipedia.org/wiki/Clickjacking&lt;br /&gt;
# if you need to allow [i]frames, you can use SAMEORIGIN or even set an uri with ALLOW-FROM uri # https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Options&lt;br /&gt;
add_header X-Frame-Options SAMEORIGIN;&lt;br /&gt;
&lt;br /&gt;
# when serving user-supplied content, include a X-Content-Type-Options: nosniff header along with the Content-Type: header,&lt;br /&gt;
# to disable content-type sniffing on some browsers.&lt;br /&gt;
# https://www.owasp.org/index.php/List_of_useful_HTTP_headers&lt;br /&gt;
# currently suppoorted in IE &amp;gt; 8 http://blogs.msdn.com/b/ie/archive/2008/09/02/ie8-security-part-vi-beta-2-update.aspx&lt;br /&gt;
# http://msdn.microsoft.com/en-us/library/ie/gg622941(v=vs.85).aspx&lt;br /&gt;
# 'soon' on Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=471020&lt;br /&gt;
add_header X-Content-Type-Options nosniff;&lt;br /&gt;
&lt;br /&gt;
# This header enables the Cross-site scripting (XSS) filter built into most recent web browsers.&lt;br /&gt;
# It's usually enabled by default anyway, so the role of this header is to re-enable the filter for&lt;br /&gt;
# this particular website if it was disabled by the user.&lt;br /&gt;
# https://www.owasp.org/index.php/List_of_useful_HTTP_headers&lt;br /&gt;
add_header X-XSS-Protection &amp;quot;1; mode=block&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
# with Content Security Policy (CSP) enabled(and a browser that supports it(http://caniuse.com/#feat=contentsecuritypolicy),&lt;br /&gt;
# you can tell the browser that it can only download content from the domains you explicitly allow&lt;br /&gt;
# http://www.html5rocks.com/en/tutorials/security/content-security-policy/&lt;br /&gt;
# https://www.owasp.org/index.php/Content_Security_Policy&lt;br /&gt;
# I need to change our application code so we can increase security by disabling 'unsafe-inline' 'unsafe-eval'&lt;br /&gt;
# directives for css and js(if you have inline css or js, you will need to keep it too).&lt;br /&gt;
# more: http://www.html5rocks.com/en/tutorials/security/content-security-policy/#inline-code-considered-harmful&lt;br /&gt;
add_header Content-Security-Policy &amp;quot;default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://ssl.google-analytics.com https://assets.zendesk.com https://connect.facebook.net; img-src 'self' https://example.com https://example1.com; style-src https://example.com; font-src https://example.com; frame-src https://example.com; object-src 'none'&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
server {&lt;br /&gt;
 listen 443 ssl default deferred;&lt;br /&gt;
 server_name .forgott.com;&lt;br /&gt;
 &lt;br /&gt;
 ssl_certificate the_path_of_your_certificate.crt;&lt;br /&gt;
 ssl_certificate_key the_path_of_your_key.key;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Django'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Django recently introduced a package with a number a collection of models, views and middlewares to aid secure Django based projects.&lt;br /&gt;
The installation of this model can be done through from Python packages repository: &lt;br /&gt;
pip install django-security&lt;br /&gt;
Also, the the latest development version, install from django-security repository on GitHub:&lt;br /&gt;
git clone https://github.com/sdelements/django-security.git&lt;br /&gt;
cd django-security&lt;br /&gt;
sudo python setup.py install&lt;br /&gt;
For each Djangon’s application, the settings.py file must be modified.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== INSTALLED_APPS = (&lt;br /&gt;
    ...&lt;br /&gt;
    'security',&lt;br /&gt;
    ...&lt;br /&gt;
    )&lt;br /&gt;
 ==&lt;br /&gt;
&lt;br /&gt;
Middleware modules can be added to MIDDLEWARE_CLASSES list in settings file. Particularly, it is our interesting the ContentSecurityPolicyMiddleware. It sends Content Security Policy (CSP) header in HTTP response.:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MIDDLEWARE_CLASSES = (&lt;br /&gt;
...&lt;br /&gt;
'security.middleware.DoNotTrackMiddleware',&lt;br /&gt;
 ==&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors =&lt;br /&gt;
&lt;br /&gt;
Neil Mattatall - neil[at]owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
Denis Mello - ddtaxe&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
{{Cheatsheet_Navigation}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Denis Vinicius de Mello</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Content_Security_Policy_Cheat_Sheet&amp;diff=192719</id>
		<title>Content Security Policy Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Content_Security_Policy_Cheat_Sheet&amp;diff=192719"/>
				<updated>2015-04-04T12:34:23Z</updated>
		
		<summary type="html">&lt;p&gt;Denis Vinicius de Mello: /* CSP Cheat Sheet - Guide for main technologies */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Content Security Policy (CSP) is an important standard that is aimed to prevent attacks such as cross-site scripting (XSS) and more importantly to reduce the harm caused by content injection attacks.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Content Security Policy (CSP) is an important standard that is aimed to prevent attacks such as cross-site scripting (XSS) and '''more importantly to reduce the harm caused by content injection attacks.'''&lt;br /&gt;
&lt;br /&gt;
= Main Reference =&lt;br /&gt;
&lt;br /&gt;
The most recent version of the CSP standard can be found here:  https://w3c.github.io/webappsec/specs/content-security-policy/&lt;br /&gt;
&lt;br /&gt;
= CSP Cheat Sheet - Guide for main technologies =&lt;br /&gt;
&lt;br /&gt;
This section summarizes the implementation and/or support for CSP in different technologies (either acting as Client or Server).&lt;br /&gt;
See below the details.&lt;br /&gt;
&lt;br /&gt;
'''Google Chrome'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Google Chrome based web applications and theme uses a manifest file named manifest.json.&lt;br /&gt;
There is a section in the manifest file where the developer can declare the CSP directives.&lt;br /&gt;
For further details, please refer to Content Security Police for Google Chrome.&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
  ''// Required''&lt;br /&gt;
  &amp;quot;manifest_version&amp;quot;: 2,&lt;br /&gt;
  &amp;quot;name&amp;quot;: &amp;quot;My Extension&amp;quot;,&lt;br /&gt;
  &amp;quot;version&amp;quot;: &amp;quot;versionString&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  ''// Recommended''&lt;br /&gt;
  &amp;quot;default_locale&amp;quot;: &amp;quot;en&amp;quot;,&lt;br /&gt;
  &amp;quot;description&amp;quot;: &amp;quot;A plain text description&amp;quot;,&lt;br /&gt;
  &amp;quot;icons&amp;quot;: {...},&lt;br /&gt;
&lt;br /&gt;
  ''// Pick one (or none)''&lt;br /&gt;
  &amp;quot;browser_action&amp;quot;: {...},&lt;br /&gt;
  &amp;quot;page_action&amp;quot;: {...},&lt;br /&gt;
&lt;br /&gt;
  ''// Optional''&lt;br /&gt;
  &amp;quot;author&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;automation&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;background&amp;quot;: {&lt;br /&gt;
    // Recommended&lt;br /&gt;
    &amp;quot;persistent&amp;quot;: false&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;background_page&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;chrome_settings_overrides&amp;quot;: {...},&lt;br /&gt;
  &amp;quot;chrome_ui_overrides&amp;quot;: {&lt;br /&gt;
    &amp;quot;bookmarks_ui&amp;quot;: {&lt;br /&gt;
      &amp;quot;remove_bookmark_shortcut&amp;quot;: true,&lt;br /&gt;
      &amp;quot;remove_button&amp;quot;: true&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;chrome_url_overrides&amp;quot;: {...},&lt;br /&gt;
  &amp;quot;commands&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;content_pack&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;content_scripts&amp;quot;: [{...}],&lt;br /&gt;
  &amp;quot;content_security_policy&amp;quot;: &amp;quot;policyString&amp;quot;,&lt;br /&gt;
  &amp;quot;converted_from_user_script&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;current_locale&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;devtools_page&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;externally_connectable&amp;quot;: {&lt;br /&gt;
    &amp;quot;matches&amp;quot;: [&amp;quot;*://*.example.com/*&amp;quot;]&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;file_browser_handlers&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;homepage_url&amp;quot;: &amp;quot;http://path/to/homepage&amp;quot;,&lt;br /&gt;
  &amp;quot;import&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;incognito&amp;quot;: &amp;quot;spanning or split&amp;quot;,&lt;br /&gt;
  &amp;quot;input_components&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;key&amp;quot;: &amp;quot;publicKey&amp;quot;,&lt;br /&gt;
  &amp;quot;minimum_chrome_version&amp;quot;: &amp;quot;versionString&amp;quot;,&lt;br /&gt;
  &amp;quot;nacl_modules&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;oauth2&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;offline_enabled&amp;quot;: true,&lt;br /&gt;
  &amp;quot;omnibox&amp;quot;: {&lt;br /&gt;
    &amp;quot;keyword&amp;quot;: &amp;quot;aString&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;optional_permissions&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;options_page&amp;quot;: &amp;quot;aFile.html&amp;quot;,&lt;br /&gt;
  &amp;quot;options_ui&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;page_actions&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;permissions&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;platforms&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;plugins&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;requirements&amp;quot;: {...},&lt;br /&gt;
  &amp;quot;sandbox&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;script_badge&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;short_name&amp;quot;: &amp;quot;Short Name&amp;quot;,&lt;br /&gt;
  &amp;quot;signature&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;spellcheck&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;storage&amp;quot;: {&lt;br /&gt;
    &amp;quot;managed_schema&amp;quot;: &amp;quot;schema.json&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;system_indicator&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;tts_engine&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;update_url&amp;quot;: &amp;quot;http://path/to/updateInfo.xml&amp;quot;,&lt;br /&gt;
  &amp;quot;web_accessible_resources&amp;quot;: [...]}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Apache'''&lt;br /&gt;
&lt;br /&gt;
It is required to add lines to the httpd.conf configuration file, or inside .htaccess files or virtual host sections.&lt;br /&gt;
Also, it is required to enable mod_headers, and after inserting the lines according to your specific needs, restart Apache.&lt;br /&gt;
The headers below are good examples to add in the files (change/modify it properly):&lt;br /&gt;
&lt;br /&gt;
Header unset Content-Security-Policy &lt;br /&gt;
Header add Content-Security-Policy &amp;quot;default-src 'self'&amp;quot; &lt;br /&gt;
Header unset X-Content-Security-Policy &lt;br /&gt;
Header add X-Content-Security-Policy &amp;quot;default-src 'self'&amp;quot; &lt;br /&gt;
Header unset X-WebKit-CSP Header add X-WebKit-CSP &amp;quot;default-src 'self'&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''WordPress'''&lt;br /&gt;
&lt;br /&gt;
Most of the configuration can be done in Apache, however, Wordpress has a plugin that allows developers/administrator to set up their own custom policies. The plugin however is not update for 2 years. Use it carefully.&lt;br /&gt;
A workaround can be the creation or modification of the file htaccess under wp-admin directory.&lt;br /&gt;
&lt;br /&gt;
An example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;IfModule mod_headers.c&amp;gt; &lt;br /&gt;
Header set Content-Security-Policy &amp;quot;default-src 'self'; &lt;br /&gt;
img-src 'self' data: http: https: *.gravatar.com; &lt;br /&gt;
script-src 'self' 'unsafe-inline' 'unsafe-eval'; &lt;br /&gt;
style-src 'self' 'unsafe-inline' http: https: fonts.googleapis.com; &lt;br /&gt;
font-src 'self' data: http: https: fonts.googleapis.com themes.googleusercontent.com;&amp;quot; &lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''nginx'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;For nginx, it is required to edit the nginx.conf file. &lt;br /&gt;
&lt;br /&gt;
# config to don't allow the browser to render the page inside an frame or iframe&lt;br /&gt;
# and avoid clickjacking http://en.wikipedia.org/wiki/Clickjacking&lt;br /&gt;
# if you need to allow [i]frames, you can use SAMEORIGIN or even set an uri with ALLOW-FROM uri # https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Options&lt;br /&gt;
add_header X-Frame-Options SAMEORIGIN;&lt;br /&gt;
&lt;br /&gt;
# when serving user-supplied content, include a X-Content-Type-Options: nosniff header along with the Content-Type: header,&lt;br /&gt;
# to disable content-type sniffing on some browsers.&lt;br /&gt;
# https://www.owasp.org/index.php/List_of_useful_HTTP_headers&lt;br /&gt;
# currently suppoorted in IE &amp;gt; 8 http://blogs.msdn.com/b/ie/archive/2008/09/02/ie8-security-part-vi-beta-2-update.aspx&lt;br /&gt;
# http://msdn.microsoft.com/en-us/library/ie/gg622941(v=vs.85).aspx&lt;br /&gt;
# 'soon' on Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=471020&lt;br /&gt;
add_header X-Content-Type-Options nosniff;&lt;br /&gt;
&lt;br /&gt;
# This header enables the Cross-site scripting (XSS) filter built into most recent web browsers.&lt;br /&gt;
# It's usually enabled by default anyway, so the role of this header is to re-enable the filter for&lt;br /&gt;
# this particular website if it was disabled by the user.&lt;br /&gt;
# https://www.owasp.org/index.php/List_of_useful_HTTP_headers&lt;br /&gt;
add_header X-XSS-Protection &amp;quot;1; mode=block&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
# with Content Security Policy (CSP) enabled(and a browser that supports it(http://caniuse.com/#feat=contentsecuritypolicy),&lt;br /&gt;
# you can tell the browser that it can only download content from the domains you explicitly allow&lt;br /&gt;
# http://www.html5rocks.com/en/tutorials/security/content-security-policy/&lt;br /&gt;
# https://www.owasp.org/index.php/Content_Security_Policy&lt;br /&gt;
# I need to change our application code so we can increase security by disabling 'unsafe-inline' 'unsafe-eval'&lt;br /&gt;
# directives for css and js(if you have inline css or js, you will need to keep it too).&lt;br /&gt;
# more: http://www.html5rocks.com/en/tutorials/security/content-security-policy/#inline-code-considered-harmful&lt;br /&gt;
add_header Content-Security-Policy &amp;quot;default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://ssl.google-analytics.com https://assets.zendesk.com https://connect.facebook.net; img-src 'self' https://example.com https://example1.com; style-src https://example.com; font-src https://example.com; frame-src https://example.com; object-src 'none'&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
server {&lt;br /&gt;
 listen 443 ssl default deferred;&lt;br /&gt;
 server_name .forgott.com;&lt;br /&gt;
 &lt;br /&gt;
 ssl_certificate the_path_of_your_certificate.crt;&lt;br /&gt;
 ssl_certificate_key the_path_of_your_key.key;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''===Django'''===&lt;br /&gt;
&lt;br /&gt;
Django recently introduced a package with a number a collection of models, views and middlewares to aid secure Django based projects.&lt;br /&gt;
The installation of this model can be done through from Python packages repository: &lt;br /&gt;
pip install django-security&lt;br /&gt;
Also, the the latest development version, install from django-security repository on GitHub:&lt;br /&gt;
git clone https://github.com/sdelements/django-security.git&lt;br /&gt;
cd django-security&lt;br /&gt;
sudo python setup.py install&lt;br /&gt;
For each Djangon’s application, the settings.py file must be modified.&lt;br /&gt;
&lt;br /&gt;
INSTALLED_APPS = (&lt;br /&gt;
    ...&lt;br /&gt;
    'security',&lt;br /&gt;
    ...&lt;br /&gt;
    )&lt;br /&gt;
Middleware modules can be added to MIDDLEWARE_CLASSES list in settings file. Particularly, it is our interesting the ContentSecurityPolicyMiddleware. It sends Content Security Policy (CSP) header in HTTP response.:&lt;br /&gt;
MIDDLEWARE_CLASSES = (&lt;br /&gt;
...&lt;br /&gt;
'security.middleware.DoNotTrackMiddleware',&lt;br /&gt;
'security.ContentSecurityPolicyMiddleware',&lt;br /&gt;
'security.middleware.ContentNoSniff',&lt;br /&gt;
'security.middleware.XssProtectMiddleware',&lt;br /&gt;
'security.middleware.XFrameOptionsMiddleware',&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors =&lt;br /&gt;
&lt;br /&gt;
Neil Mattatall - neil[at]owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
Denis Mello - ddtaxe&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
{{Cheatsheet_Navigation}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Denis Vinicius de Mello</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Content_Security_Policy_Cheat_Sheet&amp;diff=192718</id>
		<title>Content Security Policy Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Content_Security_Policy_Cheat_Sheet&amp;diff=192718"/>
				<updated>2015-04-04T12:32:58Z</updated>
		
		<summary type="html">&lt;p&gt;Denis Vinicius de Mello: /* CSP Cheat Sheet - Guide for main technologies */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Content Security Policy (CSP) is an important standard that is aimed to prevent attacks such as cross-site scripting (XSS) and more importantly to reduce the harm caused by content injection attacks.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Content Security Policy (CSP) is an important standard that is aimed to prevent attacks such as cross-site scripting (XSS) and '''more importantly to reduce the harm caused by content injection attacks.'''&lt;br /&gt;
&lt;br /&gt;
= Main Reference =&lt;br /&gt;
&lt;br /&gt;
The most recent version of the CSP standard can be found here:  https://w3c.github.io/webappsec/specs/content-security-policy/&lt;br /&gt;
&lt;br /&gt;
= CSP Cheat Sheet - Guide for main technologies =&lt;br /&gt;
&lt;br /&gt;
This section summarizes the implementation and/or support for CSP in different technologies (either acting as Client or Server).&lt;br /&gt;
See below the details.&lt;br /&gt;
&lt;br /&gt;
'''Google Chrome'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Google Chrome based web applications and theme uses a manifest file named manifest.json.&lt;br /&gt;
There is a section in the manifest file where the developer can declare the CSP directives.&lt;br /&gt;
For further details, please refer to Content Security Police for Google Chrome.&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
  ''// Required''&lt;br /&gt;
  &amp;quot;manifest_version&amp;quot;: 2,&lt;br /&gt;
  &amp;quot;name&amp;quot;: &amp;quot;My Extension&amp;quot;,&lt;br /&gt;
  &amp;quot;version&amp;quot;: &amp;quot;versionString&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  ''// Recommended''&lt;br /&gt;
  &amp;quot;default_locale&amp;quot;: &amp;quot;en&amp;quot;,&lt;br /&gt;
  &amp;quot;description&amp;quot;: &amp;quot;A plain text description&amp;quot;,&lt;br /&gt;
  &amp;quot;icons&amp;quot;: {...},&lt;br /&gt;
&lt;br /&gt;
  ''// Pick one (or none)''&lt;br /&gt;
  &amp;quot;browser_action&amp;quot;: {...},&lt;br /&gt;
  &amp;quot;page_action&amp;quot;: {...},&lt;br /&gt;
&lt;br /&gt;
  ''// Optional''&lt;br /&gt;
  &amp;quot;author&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;automation&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;background&amp;quot;: {&lt;br /&gt;
    // Recommended&lt;br /&gt;
    &amp;quot;persistent&amp;quot;: false&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;background_page&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;chrome_settings_overrides&amp;quot;: {...},&lt;br /&gt;
  &amp;quot;chrome_ui_overrides&amp;quot;: {&lt;br /&gt;
    &amp;quot;bookmarks_ui&amp;quot;: {&lt;br /&gt;
      &amp;quot;remove_bookmark_shortcut&amp;quot;: true,&lt;br /&gt;
      &amp;quot;remove_button&amp;quot;: true&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;chrome_url_overrides&amp;quot;: {...},&lt;br /&gt;
  &amp;quot;commands&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;content_pack&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;content_scripts&amp;quot;: [{...}],&lt;br /&gt;
  &amp;quot;content_security_policy&amp;quot;: &amp;quot;policyString&amp;quot;,&lt;br /&gt;
  &amp;quot;converted_from_user_script&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;current_locale&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;devtools_page&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;externally_connectable&amp;quot;: {&lt;br /&gt;
    &amp;quot;matches&amp;quot;: [&amp;quot;*://*.example.com/*&amp;quot;]&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;file_browser_handlers&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;homepage_url&amp;quot;: &amp;quot;http://path/to/homepage&amp;quot;,&lt;br /&gt;
  &amp;quot;import&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;incognito&amp;quot;: &amp;quot;spanning or split&amp;quot;,&lt;br /&gt;
  &amp;quot;input_components&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;key&amp;quot;: &amp;quot;publicKey&amp;quot;,&lt;br /&gt;
  &amp;quot;minimum_chrome_version&amp;quot;: &amp;quot;versionString&amp;quot;,&lt;br /&gt;
  &amp;quot;nacl_modules&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;oauth2&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;offline_enabled&amp;quot;: true,&lt;br /&gt;
  &amp;quot;omnibox&amp;quot;: {&lt;br /&gt;
    &amp;quot;keyword&amp;quot;: &amp;quot;aString&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;optional_permissions&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;options_page&amp;quot;: &amp;quot;aFile.html&amp;quot;,&lt;br /&gt;
  &amp;quot;options_ui&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;page_actions&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;permissions&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;platforms&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;plugins&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;requirements&amp;quot;: {...},&lt;br /&gt;
  &amp;quot;sandbox&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;script_badge&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;short_name&amp;quot;: &amp;quot;Short Name&amp;quot;,&lt;br /&gt;
  &amp;quot;signature&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;spellcheck&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;storage&amp;quot;: {&lt;br /&gt;
    &amp;quot;managed_schema&amp;quot;: &amp;quot;schema.json&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;system_indicator&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;tts_engine&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;update_url&amp;quot;: &amp;quot;http://path/to/updateInfo.xml&amp;quot;,&lt;br /&gt;
  &amp;quot;web_accessible_resources&amp;quot;: [...]}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Apache'''&lt;br /&gt;
&lt;br /&gt;
It is required to add lines to the httpd.conf configuration file, or inside .htaccess files or virtual host sections.&lt;br /&gt;
Also, it is required to enable mod_headers, and after inserting the lines according to your specific needs, restart Apache.&lt;br /&gt;
The headers below are good examples to add in the files (change/modify it properly):&lt;br /&gt;
&lt;br /&gt;
Header unset Content-Security-Policy &lt;br /&gt;
Header add Content-Security-Policy &amp;quot;default-src 'self'&amp;quot; &lt;br /&gt;
Header unset X-Content-Security-Policy &lt;br /&gt;
Header add X-Content-Security-Policy &amp;quot;default-src 'self'&amp;quot; &lt;br /&gt;
Header unset X-WebKit-CSP Header add X-WebKit-CSP &amp;quot;default-src 'self'&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''WordPress'''&lt;br /&gt;
&lt;br /&gt;
Most of the configuration can be done in Apache, however, Wordpress has a plugin that allows developers/administrator to set up their own custom policies. The plugin however is not update for 2 years. Use it carefully.&lt;br /&gt;
A workaround can be the creation or modification of the file htaccess under wp-admin directory.&lt;br /&gt;
&lt;br /&gt;
An example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;IfModule mod_headers.c&amp;gt; &lt;br /&gt;
Header set Content-Security-Policy &amp;quot;default-src 'self'; &lt;br /&gt;
img-src 'self' data: http: https: *.gravatar.com; &lt;br /&gt;
script-src 'self' 'unsafe-inline' 'unsafe-eval'; &lt;br /&gt;
style-src 'self' 'unsafe-inline' http: https: fonts.googleapis.com; &lt;br /&gt;
font-src 'self' data: http: https: fonts.googleapis.com themes.googleusercontent.com;&amp;quot; &lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''nginx'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;For nginx, it is required to edit the nginx.conf file. &lt;br /&gt;
&lt;br /&gt;
# config to don't allow the browser to render the page inside an frame or iframe&lt;br /&gt;
# and avoid clickjacking http://en.wikipedia.org/wiki/Clickjacking&lt;br /&gt;
# if you need to allow [i]frames, you can use SAMEORIGIN or even set an uri with ALLOW-FROM uri # https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Options&lt;br /&gt;
&lt;br /&gt;
add_header X-Frame-Options SAMEORIGIN;&lt;br /&gt;
&lt;br /&gt;
# when serving user-supplied content, include a X-Content-Type-Options: nosniff header along with the Content-Type: header,&lt;br /&gt;
# to disable content-type sniffing on some browsers.&lt;br /&gt;
# https://www.owasp.org/index.php/List_of_useful_HTTP_headers&lt;br /&gt;
# currently suppoorted in IE &amp;gt; 8 http://blogs.msdn.com/b/ie/archive/2008/09/02/ie8-security-part-vi-beta-2-update.aspx&lt;br /&gt;
# http://msdn.microsoft.com/en-us/library/ie/gg622941(v=vs.85).aspx&lt;br /&gt;
# 'soon' on Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=471020&lt;br /&gt;
add_header X-Content-Type-Options nosniff;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# This header enables the Cross-site scripting (XSS) filter built into most recent web browsers.&lt;br /&gt;
# It's usually enabled by default anyway, so the role of this header is to re-enable the filter for&lt;br /&gt;
# this particular website if it was disabled by the user.&lt;br /&gt;
# https://www.owasp.org/index.php/List_of_useful_HTTP_headers&lt;br /&gt;
add_header X-XSS-Protection &amp;quot;1; mode=block&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
# with Content Security Policy (CSP) enabled(and a browser that supports it(http://caniuse.com/#feat=contentsecuritypolicy),&lt;br /&gt;
# you can tell the browser that it can only download content from the domains you explicitly allow&lt;br /&gt;
# http://www.html5rocks.com/en/tutorials/security/content-security-policy/&lt;br /&gt;
# https://www.owasp.org/index.php/Content_Security_Policy&lt;br /&gt;
# I need to change our application code so we can increase security by disabling 'unsafe-inline' 'unsafe-eval'&lt;br /&gt;
# directives for css and js(if you have inline css or js, you will need to keep it too).&lt;br /&gt;
# more: http://www.html5rocks.com/en/tutorials/security/content-security-policy/#inline-code-considered-harmful&lt;br /&gt;
add_header Content-Security-Policy &amp;quot;default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://ssl.google-analytics.com https://assets.zendesk.com https://connect.facebook.net; img-src 'self' https://example.com https://example1.com; style-src https://example.com; font-src https://example.com; frame-src https://example.com; object-src 'none'&amp;quot;;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
server {&lt;br /&gt;
 listen 443 ssl default deferred;&lt;br /&gt;
 server_name .forgott.com;&lt;br /&gt;
 &lt;br /&gt;
 ssl_certificate the_path_of_your_certificate.crt;&lt;br /&gt;
 ssl_certificate_key the_path_of_your_key.key;&lt;br /&gt;
&lt;br /&gt;
'''===Django'''===&lt;br /&gt;
&lt;br /&gt;
Django recently introduced a package with a number a collection of models, views and middlewares to aid secure Django based projects.&lt;br /&gt;
The installation of this model can be done through from Python packages repository: &lt;br /&gt;
pip install django-security&lt;br /&gt;
Also, the the latest development version, install from django-security repository on GitHub:&lt;br /&gt;
git clone https://github.com/sdelements/django-security.git&lt;br /&gt;
cd django-security&lt;br /&gt;
sudo python setup.py install&lt;br /&gt;
For each Djangon’s application, the settings.py file must be modified.&lt;br /&gt;
&lt;br /&gt;
INSTALLED_APPS = (&lt;br /&gt;
    ...&lt;br /&gt;
    'security',&lt;br /&gt;
    ...&lt;br /&gt;
    )&lt;br /&gt;
Middleware modules can be added to MIDDLEWARE_CLASSES list in settings file. Particularly, it is our interesting the ContentSecurityPolicyMiddleware. It sends Content Security Policy (CSP) header in HTTP response.:&lt;br /&gt;
MIDDLEWARE_CLASSES = (&lt;br /&gt;
...&lt;br /&gt;
'security.middleware.DoNotTrackMiddleware',&lt;br /&gt;
'security.ContentSecurityPolicyMiddleware',&lt;br /&gt;
'security.middleware.ContentNoSniff',&lt;br /&gt;
'security.middleware.XssProtectMiddleware',&lt;br /&gt;
'security.middleware.XFrameOptionsMiddleware',&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors =&lt;br /&gt;
&lt;br /&gt;
Neil Mattatall - neil[at]owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
Denis Mello - ddtaxe&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
{{Cheatsheet_Navigation}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Denis Vinicius de Mello</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Content_Security_Policy_Cheat_Sheet&amp;diff=192717</id>
		<title>Content Security Policy Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Content_Security_Policy_Cheat_Sheet&amp;diff=192717"/>
				<updated>2015-04-04T12:30:16Z</updated>
		
		<summary type="html">&lt;p&gt;Denis Vinicius de Mello: /* CSP Cheat Sheet - Guide for main technologies */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Content Security Policy (CSP) is an important standard that is aimed to prevent attacks such as cross-site scripting (XSS) and more importantly to reduce the harm caused by content injection attacks.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Content Security Policy (CSP) is an important standard that is aimed to prevent attacks such as cross-site scripting (XSS) and '''more importantly to reduce the harm caused by content injection attacks.'''&lt;br /&gt;
&lt;br /&gt;
= Main Reference =&lt;br /&gt;
&lt;br /&gt;
The most recent version of the CSP standard can be found here:  https://w3c.github.io/webappsec/specs/content-security-policy/&lt;br /&gt;
&lt;br /&gt;
= CSP Cheat Sheet - Guide for main technologies =&lt;br /&gt;
&lt;br /&gt;
This section summarizes the implementation and/or support for CSP in different technologies (either acting as Client or Server).&lt;br /&gt;
See below the details.&lt;br /&gt;
&lt;br /&gt;
'''Google Chrome'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Google Chrome based web applications and theme uses a manifest file named manifest.json.&lt;br /&gt;
There is a section in the manifest file where the developer can declare the CSP directives.&lt;br /&gt;
For further details, please refer to Content Security Police for Google Chrome.&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
  ''// Required''&lt;br /&gt;
  &amp;quot;manifest_version&amp;quot;: 2,&lt;br /&gt;
  &amp;quot;name&amp;quot;: &amp;quot;My Extension&amp;quot;,&lt;br /&gt;
  &amp;quot;version&amp;quot;: &amp;quot;versionString&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  ''// Recommended''&lt;br /&gt;
  &amp;quot;default_locale&amp;quot;: &amp;quot;en&amp;quot;,&lt;br /&gt;
  &amp;quot;description&amp;quot;: &amp;quot;A plain text description&amp;quot;,&lt;br /&gt;
  &amp;quot;icons&amp;quot;: {...},&lt;br /&gt;
&lt;br /&gt;
  ''// Pick one (or none)''&lt;br /&gt;
  &amp;quot;browser_action&amp;quot;: {...},&lt;br /&gt;
  &amp;quot;page_action&amp;quot;: {...},&lt;br /&gt;
&lt;br /&gt;
  ''// Optional''&lt;br /&gt;
  &amp;quot;author&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;automation&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;background&amp;quot;: {&lt;br /&gt;
    // Recommended&lt;br /&gt;
    &amp;quot;persistent&amp;quot;: false&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;background_page&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;chrome_settings_overrides&amp;quot;: {...},&lt;br /&gt;
  &amp;quot;chrome_ui_overrides&amp;quot;: {&lt;br /&gt;
    &amp;quot;bookmarks_ui&amp;quot;: {&lt;br /&gt;
      &amp;quot;remove_bookmark_shortcut&amp;quot;: true,&lt;br /&gt;
      &amp;quot;remove_button&amp;quot;: true&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;chrome_url_overrides&amp;quot;: {...},&lt;br /&gt;
  &amp;quot;commands&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;content_pack&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;content_scripts&amp;quot;: [{...}],&lt;br /&gt;
  &amp;quot;content_security_policy&amp;quot;: &amp;quot;policyString&amp;quot;,&lt;br /&gt;
  &amp;quot;converted_from_user_script&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;current_locale&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;devtools_page&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;externally_connectable&amp;quot;: {&lt;br /&gt;
    &amp;quot;matches&amp;quot;: [&amp;quot;*://*.example.com/*&amp;quot;]&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;file_browser_handlers&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;homepage_url&amp;quot;: &amp;quot;http://path/to/homepage&amp;quot;,&lt;br /&gt;
  &amp;quot;import&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;incognito&amp;quot;: &amp;quot;spanning or split&amp;quot;,&lt;br /&gt;
  &amp;quot;input_components&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;key&amp;quot;: &amp;quot;publicKey&amp;quot;,&lt;br /&gt;
  &amp;quot;minimum_chrome_version&amp;quot;: &amp;quot;versionString&amp;quot;,&lt;br /&gt;
  &amp;quot;nacl_modules&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;oauth2&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;offline_enabled&amp;quot;: true,&lt;br /&gt;
  &amp;quot;omnibox&amp;quot;: {&lt;br /&gt;
    &amp;quot;keyword&amp;quot;: &amp;quot;aString&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;optional_permissions&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;options_page&amp;quot;: &amp;quot;aFile.html&amp;quot;,&lt;br /&gt;
  &amp;quot;options_ui&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;page_actions&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;permissions&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;platforms&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;plugins&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;requirements&amp;quot;: {...},&lt;br /&gt;
  &amp;quot;sandbox&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;script_badge&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;short_name&amp;quot;: &amp;quot;Short Name&amp;quot;,&lt;br /&gt;
  &amp;quot;signature&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;spellcheck&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;storage&amp;quot;: {&lt;br /&gt;
    &amp;quot;managed_schema&amp;quot;: &amp;quot;schema.json&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;system_indicator&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;tts_engine&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;update_url&amp;quot;: &amp;quot;http://path/to/updateInfo.xml&amp;quot;,&lt;br /&gt;
  &amp;quot;web_accessible_resources&amp;quot;: [...]}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Apache'''&lt;br /&gt;
&lt;br /&gt;
It is required to add lines to the httpd.conf configuration file, or inside .htaccess files or virtual host sections.&lt;br /&gt;
Also, it is required to enable mod_headers, and after inserting the lines according to your specific needs, restart Apache.&lt;br /&gt;
The headers below are good examples to add in the files (change/modify it properly):&lt;br /&gt;
&lt;br /&gt;
Header unset Content-Security-Policy &lt;br /&gt;
Header add Content-Security-Policy &amp;quot;default-src 'self'&amp;quot; &lt;br /&gt;
Header unset X-Content-Security-Policy &lt;br /&gt;
Header add X-Content-Security-Policy &amp;quot;default-src 'self'&amp;quot; &lt;br /&gt;
Header unset X-WebKit-CSP Header add X-WebKit-CSP &amp;quot;default-src 'self'&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''WordPress'''&lt;br /&gt;
&lt;br /&gt;
Most of the configuration can be done in Apache, however, Wordpress has a plugin that allows developers/administrator to set up their own custom policies. The plugin however is not update for 2 years. Use it carefully.&lt;br /&gt;
A workaround can be the creation or modification of the file htaccess under wp-admin directory.&lt;br /&gt;
&lt;br /&gt;
An example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;IfModule mod_headers.c&amp;gt; &lt;br /&gt;
Header set Content-Security-Policy &amp;quot;default-src 'self'; &lt;br /&gt;
img-src 'self' data: http: https: *.gravatar.com; &lt;br /&gt;
script-src 'self' 'unsafe-inline' 'unsafe-eval'; &lt;br /&gt;
style-src 'self' 'unsafe-inline' http: https: fonts.googleapis.com; &lt;br /&gt;
font-src 'self' data: http: https: fonts.googleapis.com themes.googleusercontent.com;&amp;quot; &lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''nginx'''&lt;br /&gt;
&lt;br /&gt;
For nginx, it is required to edit the nginx.conf file. &lt;br /&gt;
&lt;br /&gt;
[[# config to don't allow the browser to render the page inside an frame or iframe&lt;br /&gt;
# and avoid clickjacking http://en.wikipedia.org/wiki/Clickjacking&lt;br /&gt;
# if you need to allow [i]frames, you can use SAMEORIGIN or even set an uri with ALLOW-FROM uri # https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Options]]&lt;br /&gt;
&lt;br /&gt;
add_header X-Frame-Options SAMEORIGIN;&lt;br /&gt;
&lt;br /&gt;
[[# when serving user-supplied content, include a X-Content-Type-Options: nosniff header along with the Content-Type: header,&lt;br /&gt;
# to disable content-type sniffing on some browsers.&lt;br /&gt;
# https://www.owasp.org/index.php/List_of_useful_HTTP_headers&lt;br /&gt;
# currently suppoorted in IE &amp;gt; 8 http://blogs.msdn.com/b/ie/archive/2008/09/02/ie8-security-part-vi-beta-2-update.aspx&lt;br /&gt;
# http://msdn.microsoft.com/en-us/library/ie/gg622941(v=vs.85).aspx&lt;br /&gt;
# 'soon' on Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=471020&lt;br /&gt;
add_header X-Content-Type-Options nosniff;]]&lt;br /&gt;
&lt;br /&gt;
[[# This header enables the Cross-site scripting (XSS) filter built into most recent web browsers.&lt;br /&gt;
# It's usually enabled by default anyway, so the role of this header is to re-enable the filter for&lt;br /&gt;
# this particular website if it was disabled by the user.&lt;br /&gt;
# https://www.owasp.org/index.php/List_of_useful_HTTP_headers&lt;br /&gt;
add_header X-XSS-Protection &amp;quot;1; mode=block&amp;quot;;]]&lt;br /&gt;
&lt;br /&gt;
# with Content Security Policy (CSP) enabled(and a browser that supports it(http://caniuse.com/#feat=contentsecuritypolicy),&lt;br /&gt;
# you can tell the browser that it can only download content from the domains you explicitly allow&lt;br /&gt;
# http://www.html5rocks.com/en/tutorials/security/content-security-policy/&lt;br /&gt;
# https://www.owasp.org/index.php/Content_Security_Policy&lt;br /&gt;
# I need to change our application code so we can increase security by disabling 'unsafe-inline' 'unsafe-eval'&lt;br /&gt;
# directives for css and js(if you have inline css or js, you will need to keep it too).&lt;br /&gt;
# more: http://www.html5rocks.com/en/tutorials/security/content-security-policy/#inline-code-considered-harmful&lt;br /&gt;
add_header Content-Security-Policy &amp;quot;default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://ssl.google-analytics.com https://assets.zendesk.com https://connect.facebook.net; img-src 'self' https://example.com https://example1.com; style-src https://example.com; font-src https://example.com; frame-src https://example.com; object-src 'none'&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
server {&lt;br /&gt;
 listen 443 ssl default deferred;&lt;br /&gt;
 server_name .forgott.com;&lt;br /&gt;
 &lt;br /&gt;
 ssl_certificate the_path_of_your_certificate.crt;&lt;br /&gt;
 ssl_certificate_key the_path_of_your_key.key;&lt;br /&gt;
&lt;br /&gt;
'''===Django'''===&lt;br /&gt;
&lt;br /&gt;
Django recently introduced a package with a number a collection of models, views and middlewares to aid secure Django based projects.&lt;br /&gt;
The installation of this model can be done through from Python packages repository: &lt;br /&gt;
pip install django-security&lt;br /&gt;
Also, the the latest development version, install from django-security repository on GitHub:&lt;br /&gt;
git clone https://github.com/sdelements/django-security.git&lt;br /&gt;
cd django-security&lt;br /&gt;
sudo python setup.py install&lt;br /&gt;
For each Djangon’s application, the settings.py file must be modified.&lt;br /&gt;
&lt;br /&gt;
INSTALLED_APPS = (&lt;br /&gt;
    ...&lt;br /&gt;
    'security',&lt;br /&gt;
    ...&lt;br /&gt;
    )&lt;br /&gt;
Middleware modules can be added to MIDDLEWARE_CLASSES list in settings file. Particularly, it is our interesting the ContentSecurityPolicyMiddleware. It sends Content Security Policy (CSP) header in HTTP response.:&lt;br /&gt;
MIDDLEWARE_CLASSES = (&lt;br /&gt;
...&lt;br /&gt;
'security.middleware.DoNotTrackMiddleware',&lt;br /&gt;
'security.ContentSecurityPolicyMiddleware',&lt;br /&gt;
'security.middleware.ContentNoSniff',&lt;br /&gt;
'security.middleware.XssProtectMiddleware',&lt;br /&gt;
'security.middleware.XFrameOptionsMiddleware',&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors =&lt;br /&gt;
&lt;br /&gt;
Neil Mattatall - neil[at]owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
Denis Mello - ddtaxe&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
{{Cheatsheet_Navigation}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Denis Vinicius de Mello</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Content_Security_Policy_Cheat_Sheet&amp;diff=192716</id>
		<title>Content Security Policy Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Content_Security_Policy_Cheat_Sheet&amp;diff=192716"/>
				<updated>2015-04-04T12:29:22Z</updated>
		
		<summary type="html">&lt;p&gt;Denis Vinicius de Mello: /* CSP Cheat Sheet - Guide for main technologies */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Content Security Policy (CSP) is an important standard that is aimed to prevent attacks such as cross-site scripting (XSS) and more importantly to reduce the harm caused by content injection attacks.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Content Security Policy (CSP) is an important standard that is aimed to prevent attacks such as cross-site scripting (XSS) and '''more importantly to reduce the harm caused by content injection attacks.'''&lt;br /&gt;
&lt;br /&gt;
= Main Reference =&lt;br /&gt;
&lt;br /&gt;
The most recent version of the CSP standard can be found here:  https://w3c.github.io/webappsec/specs/content-security-policy/&lt;br /&gt;
&lt;br /&gt;
= CSP Cheat Sheet - Guide for main technologies =&lt;br /&gt;
&lt;br /&gt;
This section summarizes the implementation and/or support for CSP in different technologies (either acting as Client or Server).&lt;br /&gt;
See below the details.&lt;br /&gt;
&lt;br /&gt;
'''Google Chrome'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Google Chrome based web applications and theme uses a manifest file named manifest.json.&lt;br /&gt;
There is a section in the manifest file where the developer can declare the CSP directives.&lt;br /&gt;
For further details, please refer to Content Security Police for Google Chrome.&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
  ''// Required''&lt;br /&gt;
  &amp;quot;manifest_version&amp;quot;: 2,&lt;br /&gt;
  &amp;quot;name&amp;quot;: &amp;quot;My Extension&amp;quot;,&lt;br /&gt;
  &amp;quot;version&amp;quot;: &amp;quot;versionString&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  ''// Recommended''&lt;br /&gt;
  &amp;quot;default_locale&amp;quot;: &amp;quot;en&amp;quot;,&lt;br /&gt;
  &amp;quot;description&amp;quot;: &amp;quot;A plain text description&amp;quot;,&lt;br /&gt;
  &amp;quot;icons&amp;quot;: {...},&lt;br /&gt;
&lt;br /&gt;
  ''// Pick one (or none)''&lt;br /&gt;
  &amp;quot;browser_action&amp;quot;: {...},&lt;br /&gt;
  &amp;quot;page_action&amp;quot;: {...},&lt;br /&gt;
&lt;br /&gt;
  ''// Optional''&lt;br /&gt;
  &amp;quot;author&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;automation&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;background&amp;quot;: {&lt;br /&gt;
    // Recommended&lt;br /&gt;
    &amp;quot;persistent&amp;quot;: false&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;background_page&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;chrome_settings_overrides&amp;quot;: {...},&lt;br /&gt;
  &amp;quot;chrome_ui_overrides&amp;quot;: {&lt;br /&gt;
    &amp;quot;bookmarks_ui&amp;quot;: {&lt;br /&gt;
      &amp;quot;remove_bookmark_shortcut&amp;quot;: true,&lt;br /&gt;
      &amp;quot;remove_button&amp;quot;: true&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;chrome_url_overrides&amp;quot;: {...},&lt;br /&gt;
  &amp;quot;commands&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;content_pack&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;content_scripts&amp;quot;: [{...}],&lt;br /&gt;
  &amp;quot;content_security_policy&amp;quot;: &amp;quot;policyString&amp;quot;,&lt;br /&gt;
  &amp;quot;converted_from_user_script&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;current_locale&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;devtools_page&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;externally_connectable&amp;quot;: {&lt;br /&gt;
    &amp;quot;matches&amp;quot;: [&amp;quot;*://*.example.com/*&amp;quot;]&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;file_browser_handlers&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;homepage_url&amp;quot;: &amp;quot;http://path/to/homepage&amp;quot;,&lt;br /&gt;
  &amp;quot;import&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;incognito&amp;quot;: &amp;quot;spanning or split&amp;quot;,&lt;br /&gt;
  &amp;quot;input_components&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;key&amp;quot;: &amp;quot;publicKey&amp;quot;,&lt;br /&gt;
  &amp;quot;minimum_chrome_version&amp;quot;: &amp;quot;versionString&amp;quot;,&lt;br /&gt;
  &amp;quot;nacl_modules&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;oauth2&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;offline_enabled&amp;quot;: true,&lt;br /&gt;
  &amp;quot;omnibox&amp;quot;: {&lt;br /&gt;
    &amp;quot;keyword&amp;quot;: &amp;quot;aString&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;optional_permissions&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;options_page&amp;quot;: &amp;quot;aFile.html&amp;quot;,&lt;br /&gt;
  &amp;quot;options_ui&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;page_actions&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;permissions&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;platforms&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;plugins&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;requirements&amp;quot;: {...},&lt;br /&gt;
  &amp;quot;sandbox&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;script_badge&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;short_name&amp;quot;: &amp;quot;Short Name&amp;quot;,&lt;br /&gt;
  &amp;quot;signature&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;spellcheck&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;storage&amp;quot;: {&lt;br /&gt;
    &amp;quot;managed_schema&amp;quot;: &amp;quot;schema.json&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;system_indicator&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;tts_engine&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;update_url&amp;quot;: &amp;quot;http://path/to/updateInfo.xml&amp;quot;,&lt;br /&gt;
  &amp;quot;web_accessible_resources&amp;quot;: [...]}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Apache'''&lt;br /&gt;
&lt;br /&gt;
It is required to add lines to the httpd.conf configuration file, or inside .htaccess files or virtual host sections.&lt;br /&gt;
Also, it is required to enable mod_headers, and after inserting the lines according to your specific needs, restart Apache.&lt;br /&gt;
The headers below are good examples to add in the files (change/modify it properly):&lt;br /&gt;
&lt;br /&gt;
Header unset Content-Security-Policy &lt;br /&gt;
Header add Content-Security-Policy &amp;quot;default-src 'self'&amp;quot; &lt;br /&gt;
Header unset X-Content-Security-Policy &lt;br /&gt;
Header add X-Content-Security-Policy &amp;quot;default-src 'self'&amp;quot; &lt;br /&gt;
Header unset X-WebKit-CSP Header add X-WebKit-CSP &amp;quot;default-src 'self'&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''WordPress'''&lt;br /&gt;
&lt;br /&gt;
Most of the configuration can be done in Apache, however, Wordpress has a plugin that allows developers/administrator to set up their own custom policies. The plugin however is not update for 2 years. Use it carefully.&lt;br /&gt;
A workaround can be the creation or modification of the file htaccess under wp-admin directory.&lt;br /&gt;
&lt;br /&gt;
An example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;IfModule mod_headers.c&amp;gt; &lt;br /&gt;
Header set Content-Security-Policy &amp;quot;default-src 'self'; &lt;br /&gt;
img-src 'self' data: http: https: *.gravatar.com; &lt;br /&gt;
script-src 'self' 'unsafe-inline' 'unsafe-eval'; &lt;br /&gt;
style-src 'self' 'unsafe-inline' http: https: fonts.googleapis.com; &lt;br /&gt;
font-src 'self' data: http: https: fonts.googleapis.com themes.googleusercontent.com;&amp;quot; &lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''nginx'''&lt;br /&gt;
&lt;br /&gt;
For nginx, it is required to edit the nginx.conf file. &lt;br /&gt;
&lt;br /&gt;
# config to don't allow the browser to render the page inside an frame or iframe&lt;br /&gt;
# and avoid clickjacking http://en.wikipedia.org/wiki/Clickjacking&lt;br /&gt;
# if you need to allow [i]frames, you can use SAMEORIGIN or even set an uri with ALLOW-FROM uri # https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Options&lt;br /&gt;
&lt;br /&gt;
add_header X-Frame-Options SAMEORIGIN;&lt;br /&gt;
&lt;br /&gt;
# when serving user-supplied content, include a X-Content-Type-Options: nosniff header along with the Content-Type: header,&lt;br /&gt;
# to disable content-type sniffing on some browsers.&lt;br /&gt;
# https://www.owasp.org/index.php/List_of_useful_HTTP_headers&lt;br /&gt;
# currently suppoorted in IE &amp;gt; 8 http://blogs.msdn.com/b/ie/archive/2008/09/02/ie8-security-part-vi-beta-2-update.aspx&lt;br /&gt;
# http://msdn.microsoft.com/en-us/library/ie/gg622941(v=vs.85).aspx&lt;br /&gt;
# 'soon' on Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=471020&lt;br /&gt;
add_header X-Content-Type-Options nosniff;&lt;br /&gt;
&lt;br /&gt;
# This header enables the Cross-site scripting (XSS) filter built into most recent web browsers.&lt;br /&gt;
# It's usually enabled by default anyway, so the role of this header is to re-enable the filter for&lt;br /&gt;
# this particular website if it was disabled by the user.&lt;br /&gt;
# https://www.owasp.org/index.php/List_of_useful_HTTP_headers&lt;br /&gt;
add_header X-XSS-Protection &amp;quot;1; mode=block&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
# with Content Security Policy (CSP) enabled(and a browser that supports it(http://caniuse.com/#feat=contentsecuritypolicy),&lt;br /&gt;
# you can tell the browser that it can only download content from the domains you explicitly allow&lt;br /&gt;
# http://www.html5rocks.com/en/tutorials/security/content-security-policy/&lt;br /&gt;
# https://www.owasp.org/index.php/Content_Security_Policy&lt;br /&gt;
# I need to change our application code so we can increase security by disabling 'unsafe-inline' 'unsafe-eval'&lt;br /&gt;
# directives for css and js(if you have inline css or js, you will need to keep it too).&lt;br /&gt;
# more: http://www.html5rocks.com/en/tutorials/security/content-security-policy/#inline-code-considered-harmful&lt;br /&gt;
add_header Content-Security-Policy &amp;quot;default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://ssl.google-analytics.com https://assets.zendesk.com https://connect.facebook.net; img-src 'self' https://example.com https://example1.com; style-src https://example.com; font-src https://example.com; frame-src https://example.com; object-src 'none'&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
server {&lt;br /&gt;
 listen 443 ssl default deferred;&lt;br /&gt;
 server_name .forgott.com;&lt;br /&gt;
 &lt;br /&gt;
 ssl_certificate the_path_of_your_certificate.crt;&lt;br /&gt;
 ssl_certificate_key the_path_of_your_key.key;&lt;br /&gt;
&lt;br /&gt;
'''===Django'''===&lt;br /&gt;
&lt;br /&gt;
Django recently introduced a package with a number a collection of models, views and middlewares to aid secure Django based projects.&lt;br /&gt;
The installation of this model can be done through from Python packages repository: &lt;br /&gt;
pip install django-security&lt;br /&gt;
Also, the the latest development version, install from django-security repository on GitHub:&lt;br /&gt;
git clone https://github.com/sdelements/django-security.git&lt;br /&gt;
cd django-security&lt;br /&gt;
sudo python setup.py install&lt;br /&gt;
For each Djangon’s application, the settings.py file must be modified.&lt;br /&gt;
&lt;br /&gt;
INSTALLED_APPS = (&lt;br /&gt;
    ...&lt;br /&gt;
    'security',&lt;br /&gt;
    ...&lt;br /&gt;
    )&lt;br /&gt;
Middleware modules can be added to MIDDLEWARE_CLASSES list in settings file. Particularly, it is our interesting the ContentSecurityPolicyMiddleware. It sends Content Security Policy (CSP) header in HTTP response.:&lt;br /&gt;
MIDDLEWARE_CLASSES = (&lt;br /&gt;
...&lt;br /&gt;
'security.middleware.DoNotTrackMiddleware',&lt;br /&gt;
'security.ContentSecurityPolicyMiddleware',&lt;br /&gt;
'security.middleware.ContentNoSniff',&lt;br /&gt;
'security.middleware.XssProtectMiddleware',&lt;br /&gt;
'security.middleware.XFrameOptionsMiddleware',&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors =&lt;br /&gt;
&lt;br /&gt;
Neil Mattatall - neil[at]owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
Denis Mello - ddtaxe&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
{{Cheatsheet_Navigation}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Denis Vinicius de Mello</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Content_Security_Policy_Cheat_Sheet&amp;diff=192715</id>
		<title>Content Security Policy Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Content_Security_Policy_Cheat_Sheet&amp;diff=192715"/>
				<updated>2015-04-04T12:26:53Z</updated>
		
		<summary type="html">&lt;p&gt;Denis Vinicius de Mello: /* CSP Cheat Sheet - Guide for main technologies */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Content Security Policy (CSP) is an important standard that is aimed to prevent attacks such as cross-site scripting (XSS) and more importantly to reduce the harm caused by content injection attacks.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Content Security Policy (CSP) is an important standard that is aimed to prevent attacks such as cross-site scripting (XSS) and '''more importantly to reduce the harm caused by content injection attacks.'''&lt;br /&gt;
&lt;br /&gt;
= Main Reference =&lt;br /&gt;
&lt;br /&gt;
The most recent version of the CSP standard can be found here:  https://w3c.github.io/webappsec/specs/content-security-policy/&lt;br /&gt;
&lt;br /&gt;
= CSP Cheat Sheet - Guide for main technologies =&lt;br /&gt;
&lt;br /&gt;
This section summarizes the implementation and/or support for CSP in different technologies (either acting as Client or Server).&lt;br /&gt;
See below the details.&lt;br /&gt;
&lt;br /&gt;
'''Google Chrome'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Google Chrome based web applications and theme uses a manifest file named manifest.json.&lt;br /&gt;
There is a section in the manifest file where the developer can declare the CSP directives.&lt;br /&gt;
For further details, please refer to Content Security Police for Google Chrome.&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
  ''// Required''&lt;br /&gt;
  &amp;quot;manifest_version&amp;quot;: 2,&lt;br /&gt;
  &amp;quot;name&amp;quot;: &amp;quot;My Extension&amp;quot;,&lt;br /&gt;
  &amp;quot;version&amp;quot;: &amp;quot;versionString&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  ''// Recommended''&lt;br /&gt;
  &amp;quot;default_locale&amp;quot;: &amp;quot;en&amp;quot;,&lt;br /&gt;
  &amp;quot;description&amp;quot;: &amp;quot;A plain text description&amp;quot;,&lt;br /&gt;
  &amp;quot;icons&amp;quot;: {...},&lt;br /&gt;
&lt;br /&gt;
  ''// Pick one (or none)''&lt;br /&gt;
  &amp;quot;browser_action&amp;quot;: {...},&lt;br /&gt;
  &amp;quot;page_action&amp;quot;: {...},&lt;br /&gt;
&lt;br /&gt;
  ''// Optional''&lt;br /&gt;
  &amp;quot;author&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;automation&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;background&amp;quot;: {&lt;br /&gt;
    // Recommended&lt;br /&gt;
    &amp;quot;persistent&amp;quot;: false&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;background_page&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;chrome_settings_overrides&amp;quot;: {...},&lt;br /&gt;
  &amp;quot;chrome_ui_overrides&amp;quot;: {&lt;br /&gt;
    &amp;quot;bookmarks_ui&amp;quot;: {&lt;br /&gt;
      &amp;quot;remove_bookmark_shortcut&amp;quot;: true,&lt;br /&gt;
      &amp;quot;remove_button&amp;quot;: true&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;chrome_url_overrides&amp;quot;: {...},&lt;br /&gt;
  &amp;quot;commands&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;content_pack&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;content_scripts&amp;quot;: [{...}],&lt;br /&gt;
  &amp;quot;content_security_policy&amp;quot;: &amp;quot;policyString&amp;quot;,&lt;br /&gt;
  &amp;quot;converted_from_user_script&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;current_locale&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;devtools_page&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;externally_connectable&amp;quot;: {&lt;br /&gt;
    &amp;quot;matches&amp;quot;: [&amp;quot;*://*.example.com/*&amp;quot;]&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;file_browser_handlers&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;homepage_url&amp;quot;: &amp;quot;http://path/to/homepage&amp;quot;,&lt;br /&gt;
  &amp;quot;import&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;incognito&amp;quot;: &amp;quot;spanning or split&amp;quot;,&lt;br /&gt;
  &amp;quot;input_components&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;key&amp;quot;: &amp;quot;publicKey&amp;quot;,&lt;br /&gt;
  &amp;quot;minimum_chrome_version&amp;quot;: &amp;quot;versionString&amp;quot;,&lt;br /&gt;
  &amp;quot;nacl_modules&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;oauth2&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;offline_enabled&amp;quot;: true,&lt;br /&gt;
  &amp;quot;omnibox&amp;quot;: {&lt;br /&gt;
    &amp;quot;keyword&amp;quot;: &amp;quot;aString&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;optional_permissions&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;options_page&amp;quot;: &amp;quot;aFile.html&amp;quot;,&lt;br /&gt;
  &amp;quot;options_ui&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;page_actions&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;permissions&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;platforms&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;plugins&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;requirements&amp;quot;: {...},&lt;br /&gt;
  &amp;quot;sandbox&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;script_badge&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;short_name&amp;quot;: &amp;quot;Short Name&amp;quot;,&lt;br /&gt;
  &amp;quot;signature&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;spellcheck&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;storage&amp;quot;: {&lt;br /&gt;
    &amp;quot;managed_schema&amp;quot;: &amp;quot;schema.json&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;system_indicator&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;tts_engine&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;update_url&amp;quot;: &amp;quot;http://path/to/updateInfo.xml&amp;quot;,&lt;br /&gt;
  &amp;quot;web_accessible_resources&amp;quot;: [...]&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Apache'''&lt;br /&gt;
&lt;br /&gt;
It is required to add lines to the httpd.conf configuration file, or inside .htaccess files or virtual host sections.&lt;br /&gt;
Also, it is required to enable mod_headers, and after inserting the lines according to your specific needs, restart Apache.&lt;br /&gt;
The headers below are good examples to add in the files (change/modify it properly):&lt;br /&gt;
&lt;br /&gt;
Header unset Content-Security-Policy &lt;br /&gt;
Header add Content-Security-Policy &amp;quot;default-src 'self'&amp;quot; &lt;br /&gt;
Header unset X-Content-Security-Policy &lt;br /&gt;
Header add X-Content-Security-Policy &amp;quot;default-src 'self'&amp;quot; &lt;br /&gt;
Header unset X-WebKit-CSP Header add X-WebKit-CSP &amp;quot;default-src 'self'&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''WordPress'''&lt;br /&gt;
&lt;br /&gt;
Most of the configuration can be done in Apache, however, Wordpress has a plugin that allows developers/administrator to set up their own custom policies. The plugin however is not update for 2 years. Use it carefully.&lt;br /&gt;
A workaround can be the creation or modification of the file htaccess under wp-admin directory.&lt;br /&gt;
&lt;br /&gt;
An example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;IfModule mod_headers.c&amp;gt; &lt;br /&gt;
Header set Content-Security-Policy &amp;quot;default-src 'self'; &lt;br /&gt;
img-src 'self' data: http: https: *.gravatar.com; &lt;br /&gt;
script-src 'self' 'unsafe-inline' 'unsafe-eval'; &lt;br /&gt;
style-src 'self' 'unsafe-inline' http: https: fonts.googleapis.com; &lt;br /&gt;
font-src 'self' data: http: https: fonts.googleapis.com themes.googleusercontent.com;&amp;quot; &lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''nginx'''&lt;br /&gt;
&lt;br /&gt;
For nginx, it is required to edit the nginx.conf file. &lt;br /&gt;
&lt;br /&gt;
# config to don't allow the browser to render the page inside an frame or iframe&lt;br /&gt;
# and avoid clickjacking http://en.wikipedia.org/wiki/Clickjacking&lt;br /&gt;
# if you need to allow [i]frames, you can use SAMEORIGIN or even set an uri with ALLOW-FROM uri # https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Options&lt;br /&gt;
add_header X-Frame-Options SAMEORIGIN;&lt;br /&gt;
&lt;br /&gt;
# when serving user-supplied content, include a X-Content-Type-Options: nosniff header along with the Content-Type: header,&lt;br /&gt;
# to disable content-type sniffing on some browsers.&lt;br /&gt;
# https://www.owasp.org/index.php/List_of_useful_HTTP_headers&lt;br /&gt;
# currently suppoorted in IE &amp;gt; 8 http://blogs.msdn.com/b/ie/archive/2008/09/02/ie8-security-part-vi-beta-2-update.aspx&lt;br /&gt;
# http://msdn.microsoft.com/en-us/library/ie/gg622941(v=vs.85).aspx&lt;br /&gt;
# 'soon' on Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=471020&lt;br /&gt;
add_header X-Content-Type-Options nosniff;&lt;br /&gt;
&lt;br /&gt;
# This header enables the Cross-site scripting (XSS) filter built into most recent web browsers.&lt;br /&gt;
# It's usually enabled by default anyway, so the role of this header is to re-enable the filter for&lt;br /&gt;
# this particular website if it was disabled by the user.&lt;br /&gt;
# https://www.owasp.org/index.php/List_of_useful_HTTP_headers&lt;br /&gt;
add_header X-XSS-Protection &amp;quot;1; mode=block&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
# with Content Security Policy (CSP) enabled(and a browser that supports it(http://caniuse.com/#feat=contentsecuritypolicy),&lt;br /&gt;
# you can tell the browser that it can only download content from the domains you explicitly allow&lt;br /&gt;
# http://www.html5rocks.com/en/tutorials/security/content-security-policy/&lt;br /&gt;
# https://www.owasp.org/index.php/Content_Security_Policy&lt;br /&gt;
# I need to change our application code so we can increase security by disabling 'unsafe-inline' 'unsafe-eval'&lt;br /&gt;
# directives for css and js(if you have inline css or js, you will need to keep it too).&lt;br /&gt;
# more: http://www.html5rocks.com/en/tutorials/security/content-security-policy/#inline-code-considered-harmful&lt;br /&gt;
add_header Content-Security-Policy &amp;quot;default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://ssl.google-analytics.com https://assets.zendesk.com https://connect.facebook.net; img-src 'self' https://example.com https://example1.com; style-src https://example.com; font-src https://example.com; frame-src https://example.com; object-src 'none'&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
server {&lt;br /&gt;
 listen 443 ssl default deferred;&lt;br /&gt;
 server_name .forgott.com;&lt;br /&gt;
 &lt;br /&gt;
 ssl_certificate the_path_of_your_certificate.crt;&lt;br /&gt;
 ssl_certificate_key the_path_of_your_key.key;&lt;br /&gt;
&lt;br /&gt;
'''===Django'''===&lt;br /&gt;
&lt;br /&gt;
Django recently introduced a package with a number a collection of models, views and middlewares to aid secure Django based projects.&lt;br /&gt;
The installation of this model can be done through from Python packages repository: &lt;br /&gt;
pip install django-security&lt;br /&gt;
Also, the the latest development version, install from django-security repository on GitHub:&lt;br /&gt;
git clone https://github.com/sdelements/django-security.git&lt;br /&gt;
cd django-security&lt;br /&gt;
sudo python setup.py install&lt;br /&gt;
For each Djangon’s application, the settings.py file must be modified.&lt;br /&gt;
&lt;br /&gt;
INSTALLED_APPS = (&lt;br /&gt;
    ...&lt;br /&gt;
    'security',&lt;br /&gt;
    ...&lt;br /&gt;
    )&lt;br /&gt;
Middleware modules can be added to MIDDLEWARE_CLASSES list in settings file. Particularly, it is our interesting the ContentSecurityPolicyMiddleware. It sends Content Security Policy (CSP) header in HTTP response.:&lt;br /&gt;
MIDDLEWARE_CLASSES = (&lt;br /&gt;
...&lt;br /&gt;
'security.middleware.DoNotTrackMiddleware',&lt;br /&gt;
'security.ContentSecurityPolicyMiddleware',&lt;br /&gt;
'security.middleware.ContentNoSniff',&lt;br /&gt;
'security.middleware.XssProtectMiddleware',&lt;br /&gt;
'security.middleware.XFrameOptionsMiddleware',&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors =&lt;br /&gt;
&lt;br /&gt;
Neil Mattatall - neil[at]owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
Denis Mello - ddtaxe&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
{{Cheatsheet_Navigation}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Denis Vinicius de Mello</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Content_Security_Policy_Cheat_Sheet&amp;diff=192714</id>
		<title>Content Security Policy Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Content_Security_Policy_Cheat_Sheet&amp;diff=192714"/>
				<updated>2015-04-04T12:26:25Z</updated>
		
		<summary type="html">&lt;p&gt;Denis Vinicius de Mello: /* CSP Cheat Sheet - Guide for main technologies */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Content Security Policy (CSP) is an important standard that is aimed to prevent attacks such as cross-site scripting (XSS) and more importantly to reduce the harm caused by content injection attacks.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Content Security Policy (CSP) is an important standard that is aimed to prevent attacks such as cross-site scripting (XSS) and '''more importantly to reduce the harm caused by content injection attacks.'''&lt;br /&gt;
&lt;br /&gt;
= Main Reference =&lt;br /&gt;
&lt;br /&gt;
The most recent version of the CSP standard can be found here:  https://w3c.github.io/webappsec/specs/content-security-policy/&lt;br /&gt;
&lt;br /&gt;
= CSP Cheat Sheet - Guide for main technologies =&lt;br /&gt;
&lt;br /&gt;
This section summarizes the implementation and/or support for CSP in different technologies (either acting as Client or Server).&lt;br /&gt;
See below the details.&lt;br /&gt;
&lt;br /&gt;
'''Google Chromes'''&lt;br /&gt;
Google Chrome based web applications and theme uses a manifest file named manifest.json.&lt;br /&gt;
There is a section in the manifest file where the developer can declare the CSP directives.&lt;br /&gt;
For further details, please refer to Content Security Police for Google Chrome.&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
  ''// Required''&lt;br /&gt;
  &amp;quot;manifest_version&amp;quot;: 2,&lt;br /&gt;
  &amp;quot;name&amp;quot;: &amp;quot;My Extension&amp;quot;,&lt;br /&gt;
  &amp;quot;version&amp;quot;: &amp;quot;versionString&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  ''// Recommended''&lt;br /&gt;
  &amp;quot;default_locale&amp;quot;: &amp;quot;en&amp;quot;,&lt;br /&gt;
  &amp;quot;description&amp;quot;: &amp;quot;A plain text description&amp;quot;,&lt;br /&gt;
  &amp;quot;icons&amp;quot;: {...},&lt;br /&gt;
&lt;br /&gt;
  ''// Pick one (or none)''&lt;br /&gt;
  &amp;quot;browser_action&amp;quot;: {...},&lt;br /&gt;
  &amp;quot;page_action&amp;quot;: {...},&lt;br /&gt;
&lt;br /&gt;
  ''// Optional''&lt;br /&gt;
  &amp;quot;author&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;automation&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;background&amp;quot;: {&lt;br /&gt;
    // Recommended&lt;br /&gt;
    &amp;quot;persistent&amp;quot;: false&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;background_page&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;chrome_settings_overrides&amp;quot;: {...},&lt;br /&gt;
  &amp;quot;chrome_ui_overrides&amp;quot;: {&lt;br /&gt;
    &amp;quot;bookmarks_ui&amp;quot;: {&lt;br /&gt;
      &amp;quot;remove_bookmark_shortcut&amp;quot;: true,&lt;br /&gt;
      &amp;quot;remove_button&amp;quot;: true&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;chrome_url_overrides&amp;quot;: {...},&lt;br /&gt;
  &amp;quot;commands&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;content_pack&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;content_scripts&amp;quot;: [{...}],&lt;br /&gt;
  &amp;quot;content_security_policy&amp;quot;: &amp;quot;policyString&amp;quot;,&lt;br /&gt;
  &amp;quot;converted_from_user_script&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;current_locale&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;devtools_page&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;externally_connectable&amp;quot;: {&lt;br /&gt;
    &amp;quot;matches&amp;quot;: [&amp;quot;*://*.example.com/*&amp;quot;]&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;file_browser_handlers&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;homepage_url&amp;quot;: &amp;quot;http://path/to/homepage&amp;quot;,&lt;br /&gt;
  &amp;quot;import&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;incognito&amp;quot;: &amp;quot;spanning or split&amp;quot;,&lt;br /&gt;
  &amp;quot;input_components&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;key&amp;quot;: &amp;quot;publicKey&amp;quot;,&lt;br /&gt;
  &amp;quot;minimum_chrome_version&amp;quot;: &amp;quot;versionString&amp;quot;,&lt;br /&gt;
  &amp;quot;nacl_modules&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;oauth2&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;offline_enabled&amp;quot;: true,&lt;br /&gt;
  &amp;quot;omnibox&amp;quot;: {&lt;br /&gt;
    &amp;quot;keyword&amp;quot;: &amp;quot;aString&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;optional_permissions&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;options_page&amp;quot;: &amp;quot;aFile.html&amp;quot;,&lt;br /&gt;
  &amp;quot;options_ui&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;page_actions&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;permissions&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;platforms&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;plugins&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;requirements&amp;quot;: {...},&lt;br /&gt;
  &amp;quot;sandbox&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;script_badge&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;short_name&amp;quot;: &amp;quot;Short Name&amp;quot;,&lt;br /&gt;
  &amp;quot;signature&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;spellcheck&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;storage&amp;quot;: {&lt;br /&gt;
    &amp;quot;managed_schema&amp;quot;: &amp;quot;schema.json&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;system_indicator&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;tts_engine&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;update_url&amp;quot;: &amp;quot;http://path/to/updateInfo.xml&amp;quot;,&lt;br /&gt;
  &amp;quot;web_accessible_resources&amp;quot;: [...]&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Apache'''&lt;br /&gt;
&lt;br /&gt;
It is required to add lines to the httpd.conf configuration file, or inside .htaccess files or virtual host sections.&lt;br /&gt;
Also, it is required to enable mod_headers, and after inserting the lines according to your specific needs, restart Apache.&lt;br /&gt;
The headers below are good examples to add in the files (change/modify it properly):&lt;br /&gt;
&lt;br /&gt;
Header unset Content-Security-Policy &lt;br /&gt;
Header add Content-Security-Policy &amp;quot;default-src 'self'&amp;quot; &lt;br /&gt;
Header unset X-Content-Security-Policy &lt;br /&gt;
Header add X-Content-Security-Policy &amp;quot;default-src 'self'&amp;quot; &lt;br /&gt;
Header unset X-WebKit-CSP Header add X-WebKit-CSP &amp;quot;default-src 'self'&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''WordPress'''&lt;br /&gt;
&lt;br /&gt;
Most of the configuration can be done in Apache, however, Wordpress has a plugin that allows developers/administrator to set up their own custom policies. The plugin however is not update for 2 years. Use it carefully.&lt;br /&gt;
A workaround can be the creation or modification of the file htaccess under wp-admin directory.&lt;br /&gt;
&lt;br /&gt;
An example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;IfModule mod_headers.c&amp;gt; &lt;br /&gt;
Header set Content-Security-Policy &amp;quot;default-src 'self'; &lt;br /&gt;
img-src 'self' data: http: https: *.gravatar.com; &lt;br /&gt;
script-src 'self' 'unsafe-inline' 'unsafe-eval'; &lt;br /&gt;
style-src 'self' 'unsafe-inline' http: https: fonts.googleapis.com; &lt;br /&gt;
font-src 'self' data: http: https: fonts.googleapis.com themes.googleusercontent.com;&amp;quot; &lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''nginx'''&lt;br /&gt;
&lt;br /&gt;
For nginx, it is required to edit the nginx.conf file. &lt;br /&gt;
&lt;br /&gt;
# config to don't allow the browser to render the page inside an frame or iframe&lt;br /&gt;
# and avoid clickjacking http://en.wikipedia.org/wiki/Clickjacking&lt;br /&gt;
# if you need to allow [i]frames, you can use SAMEORIGIN or even set an uri with ALLOW-FROM uri # https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Options&lt;br /&gt;
add_header X-Frame-Options SAMEORIGIN;&lt;br /&gt;
&lt;br /&gt;
# when serving user-supplied content, include a X-Content-Type-Options: nosniff header along with the Content-Type: header,&lt;br /&gt;
# to disable content-type sniffing on some browsers.&lt;br /&gt;
# https://www.owasp.org/index.php/List_of_useful_HTTP_headers&lt;br /&gt;
# currently suppoorted in IE &amp;gt; 8 http://blogs.msdn.com/b/ie/archive/2008/09/02/ie8-security-part-vi-beta-2-update.aspx&lt;br /&gt;
# http://msdn.microsoft.com/en-us/library/ie/gg622941(v=vs.85).aspx&lt;br /&gt;
# 'soon' on Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=471020&lt;br /&gt;
add_header X-Content-Type-Options nosniff;&lt;br /&gt;
&lt;br /&gt;
# This header enables the Cross-site scripting (XSS) filter built into most recent web browsers.&lt;br /&gt;
# It's usually enabled by default anyway, so the role of this header is to re-enable the filter for&lt;br /&gt;
# this particular website if it was disabled by the user.&lt;br /&gt;
# https://www.owasp.org/index.php/List_of_useful_HTTP_headers&lt;br /&gt;
add_header X-XSS-Protection &amp;quot;1; mode=block&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
# with Content Security Policy (CSP) enabled(and a browser that supports it(http://caniuse.com/#feat=contentsecuritypolicy),&lt;br /&gt;
# you can tell the browser that it can only download content from the domains you explicitly allow&lt;br /&gt;
# http://www.html5rocks.com/en/tutorials/security/content-security-policy/&lt;br /&gt;
# https://www.owasp.org/index.php/Content_Security_Policy&lt;br /&gt;
# I need to change our application code so we can increase security by disabling 'unsafe-inline' 'unsafe-eval'&lt;br /&gt;
# directives for css and js(if you have inline css or js, you will need to keep it too).&lt;br /&gt;
# more: http://www.html5rocks.com/en/tutorials/security/content-security-policy/#inline-code-considered-harmful&lt;br /&gt;
add_header Content-Security-Policy &amp;quot;default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://ssl.google-analytics.com https://assets.zendesk.com https://connect.facebook.net; img-src 'self' https://example.com https://example1.com; style-src https://example.com; font-src https://example.com; frame-src https://example.com; object-src 'none'&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
server {&lt;br /&gt;
 listen 443 ssl default deferred;&lt;br /&gt;
 server_name .forgott.com;&lt;br /&gt;
 &lt;br /&gt;
 ssl_certificate the_path_of_your_certificate.crt;&lt;br /&gt;
 ssl_certificate_key the_path_of_your_key.key;&lt;br /&gt;
&lt;br /&gt;
'''===Django'''===&lt;br /&gt;
&lt;br /&gt;
Django recently introduced a package with a number a collection of models, views and middlewares to aid secure Django based projects.&lt;br /&gt;
The installation of this model can be done through from Python packages repository: &lt;br /&gt;
pip install django-security&lt;br /&gt;
Also, the the latest development version, install from django-security repository on GitHub:&lt;br /&gt;
git clone https://github.com/sdelements/django-security.git&lt;br /&gt;
cd django-security&lt;br /&gt;
sudo python setup.py install&lt;br /&gt;
For each Djangon’s application, the settings.py file must be modified.&lt;br /&gt;
&lt;br /&gt;
INSTALLED_APPS = (&lt;br /&gt;
    ...&lt;br /&gt;
    'security',&lt;br /&gt;
    ...&lt;br /&gt;
    )&lt;br /&gt;
Middleware modules can be added to MIDDLEWARE_CLASSES list in settings file. Particularly, it is our interesting the ContentSecurityPolicyMiddleware. It sends Content Security Policy (CSP) header in HTTP response.:&lt;br /&gt;
MIDDLEWARE_CLASSES = (&lt;br /&gt;
...&lt;br /&gt;
'security.middleware.DoNotTrackMiddleware',&lt;br /&gt;
'security.ContentSecurityPolicyMiddleware',&lt;br /&gt;
'security.middleware.ContentNoSniff',&lt;br /&gt;
'security.middleware.XssProtectMiddleware',&lt;br /&gt;
'security.middleware.XFrameOptionsMiddleware',&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors =&lt;br /&gt;
&lt;br /&gt;
Neil Mattatall - neil[at]owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
Denis Mello - ddtaxe&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
{{Cheatsheet_Navigation}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Denis Vinicius de Mello</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Content_Security_Policy_Cheat_Sheet&amp;diff=192713</id>
		<title>Content Security Policy Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Content_Security_Policy_Cheat_Sheet&amp;diff=192713"/>
				<updated>2015-04-04T12:23:29Z</updated>
		
		<summary type="html">&lt;p&gt;Denis Vinicius de Mello: /* CSP Cheat Sheet - Guide for main technologies */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Content Security Policy (CSP) is an important standard that is aimed to prevent attacks such as cross-site scripting (XSS) and more importantly to reduce the harm caused by content injection attacks.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Content Security Policy (CSP) is an important standard that is aimed to prevent attacks such as cross-site scripting (XSS) and '''more importantly to reduce the harm caused by content injection attacks.'''&lt;br /&gt;
&lt;br /&gt;
= Main Reference =&lt;br /&gt;
&lt;br /&gt;
The most recent version of the CSP standard can be found here:  https://w3c.github.io/webappsec/specs/content-security-policy/&lt;br /&gt;
&lt;br /&gt;
= CSP Cheat Sheet - Guide for main technologies =&lt;br /&gt;
&lt;br /&gt;
This section summarizes the implementation and/or support for CSP in different technologies (either acting as Client or Server).&lt;br /&gt;
See below the details.&lt;br /&gt;
&lt;br /&gt;
'''===Google Chromes==='''&lt;br /&gt;
Google Chrome based web applications and theme uses a manifest file named manifest.json.&lt;br /&gt;
There is a section in the manifest file where the developer can declare the CSP directives.&lt;br /&gt;
For further details, please refer to Content Security Police for Google Chrome.&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
  ''// Required''&lt;br /&gt;
  &amp;quot;manifest_version&amp;quot;: 2,&lt;br /&gt;
  &amp;quot;name&amp;quot;: &amp;quot;My Extension&amp;quot;,&lt;br /&gt;
  &amp;quot;version&amp;quot;: &amp;quot;versionString&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  ''// Recommended''&lt;br /&gt;
  &amp;quot;default_locale&amp;quot;: &amp;quot;en&amp;quot;,&lt;br /&gt;
  &amp;quot;description&amp;quot;: &amp;quot;A plain text description&amp;quot;,&lt;br /&gt;
  &amp;quot;icons&amp;quot;: {...},&lt;br /&gt;
&lt;br /&gt;
  ''// Pick one (or none)''&lt;br /&gt;
  &amp;quot;browser_action&amp;quot;: {...},&lt;br /&gt;
  &amp;quot;page_action&amp;quot;: {...},&lt;br /&gt;
&lt;br /&gt;
  ''// Optional''&lt;br /&gt;
  &amp;quot;author&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;automation&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;background&amp;quot;: {&lt;br /&gt;
    // Recommended&lt;br /&gt;
    &amp;quot;persistent&amp;quot;: false&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;background_page&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;chrome_settings_overrides&amp;quot;: {...},&lt;br /&gt;
  &amp;quot;chrome_ui_overrides&amp;quot;: {&lt;br /&gt;
    &amp;quot;bookmarks_ui&amp;quot;: {&lt;br /&gt;
      &amp;quot;remove_bookmark_shortcut&amp;quot;: true,&lt;br /&gt;
      &amp;quot;remove_button&amp;quot;: true&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;chrome_url_overrides&amp;quot;: {...},&lt;br /&gt;
  &amp;quot;commands&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;content_pack&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;content_scripts&amp;quot;: [{...}],&lt;br /&gt;
  &amp;quot;content_security_policy&amp;quot;: &amp;quot;policyString&amp;quot;,&lt;br /&gt;
  &amp;quot;converted_from_user_script&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;current_locale&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;devtools_page&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;externally_connectable&amp;quot;: {&lt;br /&gt;
    &amp;quot;matches&amp;quot;: [&amp;quot;*://*.example.com/*&amp;quot;]&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;file_browser_handlers&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;homepage_url&amp;quot;: &amp;quot;http://path/to/homepage&amp;quot;,&lt;br /&gt;
  &amp;quot;import&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;incognito&amp;quot;: &amp;quot;spanning or split&amp;quot;,&lt;br /&gt;
  &amp;quot;input_components&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;key&amp;quot;: &amp;quot;publicKey&amp;quot;,&lt;br /&gt;
  &amp;quot;minimum_chrome_version&amp;quot;: &amp;quot;versionString&amp;quot;,&lt;br /&gt;
  &amp;quot;nacl_modules&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;oauth2&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;offline_enabled&amp;quot;: true,&lt;br /&gt;
  &amp;quot;omnibox&amp;quot;: {&lt;br /&gt;
    &amp;quot;keyword&amp;quot;: &amp;quot;aString&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;optional_permissions&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;options_page&amp;quot;: &amp;quot;aFile.html&amp;quot;,&lt;br /&gt;
  &amp;quot;options_ui&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;page_actions&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;permissions&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;platforms&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;plugins&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;requirements&amp;quot;: {...},&lt;br /&gt;
  &amp;quot;sandbox&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;script_badge&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;short_name&amp;quot;: &amp;quot;Short Name&amp;quot;,&lt;br /&gt;
  &amp;quot;signature&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;spellcheck&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;storage&amp;quot;: {&lt;br /&gt;
    &amp;quot;managed_schema&amp;quot;: &amp;quot;schema.json&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;system_indicator&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;tts_engine&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;update_url&amp;quot;: &amp;quot;http://path/to/updateInfo.xml&amp;quot;,&lt;br /&gt;
  &amp;quot;web_accessible_resources&amp;quot;: [...]&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''===Apache'''===&lt;br /&gt;
&lt;br /&gt;
It is required to add lines to the httpd.conf configuration file, or inside .htaccess files or virtual host sections.&lt;br /&gt;
Also, it is required to enable mod_headers, and after inserting the lines according to your specific needs, restart Apache.&lt;br /&gt;
The headers below are good examples to add in the files (change/modify it properly):&lt;br /&gt;
&lt;br /&gt;
Header unset Content-Security-Policy &lt;br /&gt;
Header add Content-Security-Policy &amp;quot;default-src 'self'&amp;quot; &lt;br /&gt;
Header unset X-Content-Security-Policy &lt;br /&gt;
Header add X-Content-Security-Policy &amp;quot;default-src 'self'&amp;quot; &lt;br /&gt;
Header unset X-WebKit-CSP Header add X-WebKit-CSP &amp;quot;default-src 'self'&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''===WordPress'''===&lt;br /&gt;
&lt;br /&gt;
Most of the configuration can be done in Apache, however, Wordpress has a plugin that allows developers/administrator to set up their own custom policies. The plugin however is not update for 2 years. Use it carefully.&lt;br /&gt;
A workaround can be the creation or modification of the file htaccess under wp-admin directory.&lt;br /&gt;
An example:&lt;br /&gt;
&amp;lt;IfModule mod_headers.c&amp;gt; &lt;br /&gt;
Header set Content-Security-Policy &amp;quot;default-src 'self'; &lt;br /&gt;
img-src 'self' data: http: https: *.gravatar.com; &lt;br /&gt;
script-src 'self' 'unsafe-inline' 'unsafe-eval'; &lt;br /&gt;
style-src 'self' 'unsafe-inline' http: https: fonts.googleapis.com; &lt;br /&gt;
font-src 'self' data: http: https: fonts.googleapis.com themes.googleusercontent.com;&amp;quot; &lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
nginx&lt;br /&gt;
For nginx, it is required to edit the nginx.conf file. &lt;br /&gt;
&lt;br /&gt;
# config to don't allow the browser to render the page inside an frame or iframe&lt;br /&gt;
# and avoid clickjacking http://en.wikipedia.org/wiki/Clickjacking&lt;br /&gt;
# if you need to allow [i]frames, you can use SAMEORIGIN or even set an uri with ALLOW-FROM uri # https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Options&lt;br /&gt;
add_header X-Frame-Options SAMEORIGIN;&lt;br /&gt;
&lt;br /&gt;
# when serving user-supplied content, include a X-Content-Type-Options: nosniff header along with the Content-Type: header,&lt;br /&gt;
# to disable content-type sniffing on some browsers.&lt;br /&gt;
# https://www.owasp.org/index.php/List_of_useful_HTTP_headers&lt;br /&gt;
# currently suppoorted in IE &amp;gt; 8 http://blogs.msdn.com/b/ie/archive/2008/09/02/ie8-security-part-vi-beta-2-update.aspx&lt;br /&gt;
# http://msdn.microsoft.com/en-us/library/ie/gg622941(v=vs.85).aspx&lt;br /&gt;
# 'soon' on Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=471020&lt;br /&gt;
add_header X-Content-Type-Options nosniff;&lt;br /&gt;
&lt;br /&gt;
# This header enables the Cross-site scripting (XSS) filter built into most recent web browsers.&lt;br /&gt;
# It's usually enabled by default anyway, so the role of this header is to re-enable the filter for&lt;br /&gt;
# this particular website if it was disabled by the user.&lt;br /&gt;
# https://www.owasp.org/index.php/List_of_useful_HTTP_headers&lt;br /&gt;
add_header X-XSS-Protection &amp;quot;1; mode=block&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
# with Content Security Policy (CSP) enabled(and a browser that supports it(http://caniuse.com/#feat=contentsecuritypolicy),&lt;br /&gt;
# you can tell the browser that it can only download content from the domains you explicitly allow&lt;br /&gt;
# http://www.html5rocks.com/en/tutorials/security/content-security-policy/&lt;br /&gt;
# https://www.owasp.org/index.php/Content_Security_Policy&lt;br /&gt;
# I need to change our application code so we can increase security by disabling 'unsafe-inline' 'unsafe-eval'&lt;br /&gt;
# directives for css and js(if you have inline css or js, you will need to keep it too).&lt;br /&gt;
# more: http://www.html5rocks.com/en/tutorials/security/content-security-policy/#inline-code-considered-harmful&lt;br /&gt;
add_header Content-Security-Policy &amp;quot;default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://ssl.google-analytics.com https://assets.zendesk.com https://connect.facebook.net; img-src 'self' https://example.com https://example1.com; style-src https://example.com; font-src https://example.com; frame-src https://example.com; object-src 'none'&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
server {&lt;br /&gt;
 listen 443 ssl default deferred;&lt;br /&gt;
 server_name .forgott.com;&lt;br /&gt;
 &lt;br /&gt;
 ssl_certificate the_path_of_your_certificate.crt;&lt;br /&gt;
 ssl_certificate_key the_path_of_your_key.key;&lt;br /&gt;
&lt;br /&gt;
'''===Django'''===&lt;br /&gt;
&lt;br /&gt;
Django recently introduced a package with a number a collection of models, views and middlewares to aid secure Django based projects.&lt;br /&gt;
The installation of this model can be done through from Python packages repository: &lt;br /&gt;
pip install django-security&lt;br /&gt;
Also, the the latest development version, install from django-security repository on GitHub:&lt;br /&gt;
git clone https://github.com/sdelements/django-security.git&lt;br /&gt;
cd django-security&lt;br /&gt;
sudo python setup.py install&lt;br /&gt;
For each Djangon’s application, the settings.py file must be modified.&lt;br /&gt;
&lt;br /&gt;
INSTALLED_APPS = (&lt;br /&gt;
    ...&lt;br /&gt;
    'security',&lt;br /&gt;
    ...&lt;br /&gt;
    )&lt;br /&gt;
Middleware modules can be added to MIDDLEWARE_CLASSES list in settings file. Particularly, it is our interesting the ContentSecurityPolicyMiddleware. It sends Content Security Policy (CSP) header in HTTP response.:&lt;br /&gt;
MIDDLEWARE_CLASSES = (&lt;br /&gt;
...&lt;br /&gt;
'security.middleware.DoNotTrackMiddleware',&lt;br /&gt;
'security.ContentSecurityPolicyMiddleware',&lt;br /&gt;
'security.middleware.ContentNoSniff',&lt;br /&gt;
'security.middleware.XssProtectMiddleware',&lt;br /&gt;
'security.middleware.XFrameOptionsMiddleware',&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors =&lt;br /&gt;
&lt;br /&gt;
Neil Mattatall - neil[at]owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
Denis Mello - ddtaxe&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
{{Cheatsheet_Navigation}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Denis Vinicius de Mello</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Content_Security_Policy_Cheat_Sheet&amp;diff=192712</id>
		<title>Content Security Policy Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Content_Security_Policy_Cheat_Sheet&amp;diff=192712"/>
				<updated>2015-04-04T12:18:36Z</updated>
		
		<summary type="html">&lt;p&gt;Denis Vinicius de Mello: /* CSP Cheat Sheet - Guide for main technologies */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Content Security Policy (CSP) is an important standard that is aimed to prevent attacks such as cross-site scripting (XSS) and more importantly to reduce the harm caused by content injection attacks.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Content Security Policy (CSP) is an important standard that is aimed to prevent attacks such as cross-site scripting (XSS) and '''more importantly to reduce the harm caused by content injection attacks.'''&lt;br /&gt;
&lt;br /&gt;
= Main Reference =&lt;br /&gt;
&lt;br /&gt;
The most recent version of the CSP standard can be found here:  https://w3c.github.io/webappsec/specs/content-security-policy/&lt;br /&gt;
&lt;br /&gt;
= CSP Cheat Sheet - Guide for main technologies =&lt;br /&gt;
&lt;br /&gt;
This section summarizes the implementation and/or support for CSP in different technologies (either acting as Client or Server).&lt;br /&gt;
See below the details.&lt;br /&gt;
&lt;br /&gt;
'''Google Chrome'''&lt;br /&gt;
Google Chrome based web applications and theme uses a manifest file named manifest.json.&lt;br /&gt;
There is a section in the manifest file where the developer can declare the CSP directives.&lt;br /&gt;
For further details, please refer to Content Security Police for Google Chrome.&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
  ''// Required''&lt;br /&gt;
  &amp;quot;manifest_version&amp;quot;: 2,&lt;br /&gt;
  &amp;quot;name&amp;quot;: &amp;quot;My Extension&amp;quot;,&lt;br /&gt;
  &amp;quot;version&amp;quot;: &amp;quot;versionString&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  ''// Recommended''&lt;br /&gt;
  &amp;quot;default_locale&amp;quot;: &amp;quot;en&amp;quot;,&lt;br /&gt;
  &amp;quot;description&amp;quot;: &amp;quot;A plain text description&amp;quot;,&lt;br /&gt;
  &amp;quot;icons&amp;quot;: {...},&lt;br /&gt;
&lt;br /&gt;
  ''// Pick one (or none)''&lt;br /&gt;
  &amp;quot;browser_action&amp;quot;: {...},&lt;br /&gt;
  &amp;quot;page_action&amp;quot;: {...},&lt;br /&gt;
&lt;br /&gt;
  ''// Optional''&lt;br /&gt;
  &amp;quot;author&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;automation&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;background&amp;quot;: {&lt;br /&gt;
    // Recommended&lt;br /&gt;
    &amp;quot;persistent&amp;quot;: false&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;background_page&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;chrome_settings_overrides&amp;quot;: {...},&lt;br /&gt;
  &amp;quot;chrome_ui_overrides&amp;quot;: {&lt;br /&gt;
    &amp;quot;bookmarks_ui&amp;quot;: {&lt;br /&gt;
      &amp;quot;remove_bookmark_shortcut&amp;quot;: true,&lt;br /&gt;
      &amp;quot;remove_button&amp;quot;: true&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;chrome_url_overrides&amp;quot;: {...},&lt;br /&gt;
  &amp;quot;commands&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;content_pack&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;content_scripts&amp;quot;: [{...}],&lt;br /&gt;
  &amp;quot;content_security_policy&amp;quot;: &amp;quot;policyString&amp;quot;,&lt;br /&gt;
  &amp;quot;converted_from_user_script&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;current_locale&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;devtools_page&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;externally_connectable&amp;quot;: {&lt;br /&gt;
    &amp;quot;matches&amp;quot;: [&amp;quot;*://*.example.com/*&amp;quot;]&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;file_browser_handlers&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;homepage_url&amp;quot;: &amp;quot;http://path/to/homepage&amp;quot;,&lt;br /&gt;
  &amp;quot;import&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;incognito&amp;quot;: &amp;quot;spanning or split&amp;quot;,&lt;br /&gt;
  &amp;quot;input_components&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;key&amp;quot;: &amp;quot;publicKey&amp;quot;,&lt;br /&gt;
  &amp;quot;minimum_chrome_version&amp;quot;: &amp;quot;versionString&amp;quot;,&lt;br /&gt;
  &amp;quot;nacl_modules&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;oauth2&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;offline_enabled&amp;quot;: true,&lt;br /&gt;
  &amp;quot;omnibox&amp;quot;: {&lt;br /&gt;
    &amp;quot;keyword&amp;quot;: &amp;quot;aString&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;optional_permissions&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;options_page&amp;quot;: &amp;quot;aFile.html&amp;quot;,&lt;br /&gt;
  &amp;quot;options_ui&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;page_actions&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;permissions&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;platforms&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;plugins&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;requirements&amp;quot;: {...},&lt;br /&gt;
  &amp;quot;sandbox&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;script_badge&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;short_name&amp;quot;: &amp;quot;Short Name&amp;quot;,&lt;br /&gt;
  &amp;quot;signature&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;spellcheck&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;storage&amp;quot;: {&lt;br /&gt;
    &amp;quot;managed_schema&amp;quot;: &amp;quot;schema.json&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;system_indicator&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;tts_engine&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;update_url&amp;quot;: &amp;quot;http://path/to/updateInfo.xml&amp;quot;,&lt;br /&gt;
  &amp;quot;web_accessible_resources&amp;quot;: [...]&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Apache'''&lt;br /&gt;
It is required to add lines to the httpd.conf configuration file, or inside .htaccess files or virtual host sections.&lt;br /&gt;
Also, it is required to enable mod_headers, and after inserting the lines according to your specific needs, restart Apache.&lt;br /&gt;
The headers below are good examples to add in the files (change/modify it properly):&lt;br /&gt;
&lt;br /&gt;
Header unset Content-Security-Policy &lt;br /&gt;
Header add Content-Security-Policy &amp;quot;default-src 'self'&amp;quot; &lt;br /&gt;
Header unset X-Content-Security-Policy &lt;br /&gt;
Header add X-Content-Security-Policy &amp;quot;default-src 'self'&amp;quot; &lt;br /&gt;
Header unset X-WebKit-CSP Header add X-WebKit-CSP &amp;quot;default-src 'self'&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''WordPress'''&lt;br /&gt;
&lt;br /&gt;
Most of the configuration can be done in Apache, however, Wordpress has a plugin that allows developers/administrator to set up their own custom policies. The plugin however is not update for 2 years. Use it carefully.&lt;br /&gt;
A workaround can be the creation or modification of the file htaccess under wp-admin directory.&lt;br /&gt;
An example:&lt;br /&gt;
&amp;lt;IfModule mod_headers.c&amp;gt; &lt;br /&gt;
Header set Content-Security-Policy &amp;quot;default-src 'self'; &lt;br /&gt;
img-src 'self' data: http: https: *.gravatar.com; &lt;br /&gt;
script-src 'self' 'unsafe-inline' 'unsafe-eval'; &lt;br /&gt;
style-src 'self' 'unsafe-inline' http: https: fonts.googleapis.com; &lt;br /&gt;
font-src 'self' data: http: https: fonts.googleapis.com themes.googleusercontent.com;&amp;quot; &lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
nginx&lt;br /&gt;
For nginx, it is required to edit the nginx.conf file. &lt;br /&gt;
&lt;br /&gt;
# config to don't allow the browser to render the page inside an frame or iframe&lt;br /&gt;
# and avoid clickjacking http://en.wikipedia.org/wiki/Clickjacking&lt;br /&gt;
# if you need to allow [i]frames, you can use SAMEORIGIN or even set an uri with ALLOW-FROM uri # https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Options&lt;br /&gt;
add_header X-Frame-Options SAMEORIGIN;&lt;br /&gt;
&lt;br /&gt;
# when serving user-supplied content, include a X-Content-Type-Options: nosniff header along with the Content-Type: header,&lt;br /&gt;
# to disable content-type sniffing on some browsers.&lt;br /&gt;
# https://www.owasp.org/index.php/List_of_useful_HTTP_headers&lt;br /&gt;
# currently suppoorted in IE &amp;gt; 8 http://blogs.msdn.com/b/ie/archive/2008/09/02/ie8-security-part-vi-beta-2-update.aspx&lt;br /&gt;
# http://msdn.microsoft.com/en-us/library/ie/gg622941(v=vs.85).aspx&lt;br /&gt;
# 'soon' on Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=471020&lt;br /&gt;
add_header X-Content-Type-Options nosniff;&lt;br /&gt;
&lt;br /&gt;
# This header enables the Cross-site scripting (XSS) filter built into most recent web browsers.&lt;br /&gt;
# It's usually enabled by default anyway, so the role of this header is to re-enable the filter for&lt;br /&gt;
# this particular website if it was disabled by the user.&lt;br /&gt;
# https://www.owasp.org/index.php/List_of_useful_HTTP_headers&lt;br /&gt;
add_header X-XSS-Protection &amp;quot;1; mode=block&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
# with Content Security Policy (CSP) enabled(and a browser that supports it(http://caniuse.com/#feat=contentsecuritypolicy),&lt;br /&gt;
# you can tell the browser that it can only download content from the domains you explicitly allow&lt;br /&gt;
# http://www.html5rocks.com/en/tutorials/security/content-security-policy/&lt;br /&gt;
# https://www.owasp.org/index.php/Content_Security_Policy&lt;br /&gt;
# I need to change our application code so we can increase security by disabling 'unsafe-inline' 'unsafe-eval'&lt;br /&gt;
# directives for css and js(if you have inline css or js, you will need to keep it too).&lt;br /&gt;
# more: http://www.html5rocks.com/en/tutorials/security/content-security-policy/#inline-code-considered-harmful&lt;br /&gt;
add_header Content-Security-Policy &amp;quot;default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://ssl.google-analytics.com https://assets.zendesk.com https://connect.facebook.net; img-src 'self' https://example.com https://example1.com; style-src https://example.com; font-src https://example.com; frame-src https://example.com; object-src 'none'&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
server {&lt;br /&gt;
 listen 443 ssl default deferred;&lt;br /&gt;
 server_name .forgott.com;&lt;br /&gt;
 &lt;br /&gt;
 ssl_certificate the_path_of_your_certificate.crt;&lt;br /&gt;
 ssl_certificate_key the_path_of_your_key.key;&lt;br /&gt;
&lt;br /&gt;
'''Django'''&lt;br /&gt;
&lt;br /&gt;
Django recently introduced a package with a number a collection of models, views and middlewares to aid secure Django based projects.&lt;br /&gt;
The installation of this model can be done through from Python packages repository: &lt;br /&gt;
pip install django-security&lt;br /&gt;
Also, the the latest development version, install from django-security repository on GitHub:&lt;br /&gt;
git clone https://github.com/sdelements/django-security.git&lt;br /&gt;
cd django-security&lt;br /&gt;
sudo python setup.py install&lt;br /&gt;
For each Djangon’s application, the settings.py file must be modified.&lt;br /&gt;
&lt;br /&gt;
INSTALLED_APPS = (&lt;br /&gt;
    ...&lt;br /&gt;
    'security',&lt;br /&gt;
    ...&lt;br /&gt;
    )&lt;br /&gt;
Middleware modules can be added to MIDDLEWARE_CLASSES list in settings file. Particularly, it is our interesting the ContentSecurityPolicyMiddleware. It sends Content Security Policy (CSP) header in HTTP response.:&lt;br /&gt;
MIDDLEWARE_CLASSES = (&lt;br /&gt;
...&lt;br /&gt;
'security.middleware.DoNotTrackMiddleware',&lt;br /&gt;
'security.ContentSecurityPolicyMiddleware',&lt;br /&gt;
'security.middleware.ContentNoSniff',&lt;br /&gt;
'security.middleware.XssProtectMiddleware',&lt;br /&gt;
'security.middleware.XFrameOptionsMiddleware',&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors =&lt;br /&gt;
&lt;br /&gt;
Neil Mattatall - neil[at]owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
Denis Mello - ddtaxe&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
{{Cheatsheet_Navigation}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Denis Vinicius de Mello</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Content_Security_Policy_Cheat_Sheet&amp;diff=192711</id>
		<title>Content Security Policy Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Content_Security_Policy_Cheat_Sheet&amp;diff=192711"/>
				<updated>2015-04-04T12:14:37Z</updated>
		
		<summary type="html">&lt;p&gt;Denis Vinicius de Mello: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Content Security Policy (CSP) is an important standard that is aimed to prevent attacks such as cross-site scripting (XSS) and more importantly to reduce the harm caused by content injection attacks.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Content Security Policy (CSP) is an important standard that is aimed to prevent attacks such as cross-site scripting (XSS) and '''more importantly to reduce the harm caused by content injection attacks.'''&lt;br /&gt;
&lt;br /&gt;
= Main Reference =&lt;br /&gt;
&lt;br /&gt;
The most recent version of the CSP standard can be found here:  https://w3c.github.io/webappsec/specs/content-security-policy/&lt;br /&gt;
&lt;br /&gt;
= CSP Cheat Sheet - Guide for main technologies =&lt;br /&gt;
&lt;br /&gt;
This section summarizes the implementation and/or support for CSP in different technologies (either acting as Client or Server).&lt;br /&gt;
See below the details.&lt;br /&gt;
&lt;br /&gt;
Google Chrome&lt;br /&gt;
Google Chrome based web applications and theme uses a manifest file named manifest.json.&lt;br /&gt;
There is a section in the manifest file where the developer can declare the CSP directives.&lt;br /&gt;
For further details, please refer to Content Security Police for Google Chrome.&lt;br /&gt;
{&lt;br /&gt;
  // Required&lt;br /&gt;
  &amp;quot;manifest_version&amp;quot;: 2,&lt;br /&gt;
  &amp;quot;name&amp;quot;: &amp;quot;My Extension&amp;quot;,&lt;br /&gt;
  &amp;quot;version&amp;quot;: &amp;quot;versionString&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  // Recommended&lt;br /&gt;
  &amp;quot;default_locale&amp;quot;: &amp;quot;en&amp;quot;,&lt;br /&gt;
  &amp;quot;description&amp;quot;: &amp;quot;A plain text description&amp;quot;,&lt;br /&gt;
  &amp;quot;icons&amp;quot;: {...},&lt;br /&gt;
&lt;br /&gt;
  // Pick one (or none)&lt;br /&gt;
  &amp;quot;browser_action&amp;quot;: {...},&lt;br /&gt;
  &amp;quot;page_action&amp;quot;: {...},&lt;br /&gt;
&lt;br /&gt;
  // Optional&lt;br /&gt;
  &amp;quot;author&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;automation&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;background&amp;quot;: {&lt;br /&gt;
    // Recommended&lt;br /&gt;
    &amp;quot;persistent&amp;quot;: false&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;background_page&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;chrome_settings_overrides&amp;quot;: {...},&lt;br /&gt;
  &amp;quot;chrome_ui_overrides&amp;quot;: {&lt;br /&gt;
    &amp;quot;bookmarks_ui&amp;quot;: {&lt;br /&gt;
      &amp;quot;remove_bookmark_shortcut&amp;quot;: true,&lt;br /&gt;
      &amp;quot;remove_button&amp;quot;: true&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;chrome_url_overrides&amp;quot;: {...},&lt;br /&gt;
  &amp;quot;commands&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;content_pack&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;content_scripts&amp;quot;: [{...}],&lt;br /&gt;
  &amp;quot;content_security_policy&amp;quot;: &amp;quot;policyString&amp;quot;,&lt;br /&gt;
  &amp;quot;converted_from_user_script&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;current_locale&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;devtools_page&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;externally_connectable&amp;quot;: {&lt;br /&gt;
    &amp;quot;matches&amp;quot;: [&amp;quot;*://*.example.com/*&amp;quot;]&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;file_browser_handlers&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;homepage_url&amp;quot;: &amp;quot;http://path/to/homepage&amp;quot;,&lt;br /&gt;
  &amp;quot;import&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;incognito&amp;quot;: &amp;quot;spanning or split&amp;quot;,&lt;br /&gt;
  &amp;quot;input_components&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;key&amp;quot;: &amp;quot;publicKey&amp;quot;,&lt;br /&gt;
  &amp;quot;minimum_chrome_version&amp;quot;: &amp;quot;versionString&amp;quot;,&lt;br /&gt;
  &amp;quot;nacl_modules&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;oauth2&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;offline_enabled&amp;quot;: true,&lt;br /&gt;
  &amp;quot;omnibox&amp;quot;: {&lt;br /&gt;
    &amp;quot;keyword&amp;quot;: &amp;quot;aString&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;optional_permissions&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;options_page&amp;quot;: &amp;quot;aFile.html&amp;quot;,&lt;br /&gt;
  &amp;quot;options_ui&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;page_actions&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;permissions&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;platforms&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;plugins&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;requirements&amp;quot;: {...},&lt;br /&gt;
  &amp;quot;sandbox&amp;quot;: [...],&lt;br /&gt;
  &amp;quot;script_badge&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;short_name&amp;quot;: &amp;quot;Short Name&amp;quot;,&lt;br /&gt;
  &amp;quot;signature&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;spellcheck&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;storage&amp;quot;: {&lt;br /&gt;
    &amp;quot;managed_schema&amp;quot;: &amp;quot;schema.json&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;system_indicator&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;tts_engine&amp;quot;: ...,&lt;br /&gt;
  &amp;quot;update_url&amp;quot;: &amp;quot;http://path/to/updateInfo.xml&amp;quot;,&lt;br /&gt;
  &amp;quot;web_accessible_resources&amp;quot;: [...]&lt;br /&gt;
}&lt;br /&gt;
Apache&lt;br /&gt;
It is required to add lines to the httpd.conf configuration file, or inside .htaccess files or virtual host sections.&lt;br /&gt;
Also, it is required to enable mod_headers, and after inserting the lines according to your specific needs, restart Apache.&lt;br /&gt;
The headers below are good examples to add in the files (change/modify it properly):&lt;br /&gt;
&lt;br /&gt;
Header unset Content-Security-Policy &lt;br /&gt;
Header add Content-Security-Policy &amp;quot;default-src 'self'&amp;quot; &lt;br /&gt;
Header unset X-Content-Security-Policy &lt;br /&gt;
Header add X-Content-Security-Policy &amp;quot;default-src 'self'&amp;quot; &lt;br /&gt;
Header unset X-WebKit-CSP Header add X-WebKit-CSP &amp;quot;default-src 'self'&amp;quot;&lt;br /&gt;
WordPress&lt;br /&gt;
Most of the configuration can be done in Apache, however, Wordpress has a plugin that allows developers/administrator to set up their own custom policies. The plugin however is not update for 2 years. Use it carefully.&lt;br /&gt;
A workaround can be the creation or modification of the file htaccess under wp-admin directory.&lt;br /&gt;
An example:&lt;br /&gt;
&amp;lt;IfModule mod_headers.c&amp;gt; &lt;br /&gt;
Header set Content-Security-Policy &amp;quot;default-src 'self'; &lt;br /&gt;
img-src 'self' data: http: https: *.gravatar.com; &lt;br /&gt;
script-src 'self' 'unsafe-inline' 'unsafe-eval'; &lt;br /&gt;
style-src 'self' 'unsafe-inline' http: https: fonts.googleapis.com; &lt;br /&gt;
font-src 'self' data: http: https: fonts.googleapis.com themes.googleusercontent.com;&amp;quot; &lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
nginx&lt;br /&gt;
For nginx, it is required to edit the nginx.conf file. &lt;br /&gt;
&lt;br /&gt;
# config to don't allow the browser to render the page inside an frame or iframe&lt;br /&gt;
# and avoid clickjacking http://en.wikipedia.org/wiki/Clickjacking&lt;br /&gt;
# if you need to allow [i]frames, you can use SAMEORIGIN or even set an uri with ALLOW-FROM uri # https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Options&lt;br /&gt;
add_header X-Frame-Options SAMEORIGIN;&lt;br /&gt;
&lt;br /&gt;
# when serving user-supplied content, include a X-Content-Type-Options: nosniff header along with the Content-Type: header,&lt;br /&gt;
# to disable content-type sniffing on some browsers.&lt;br /&gt;
# https://www.owasp.org/index.php/List_of_useful_HTTP_headers&lt;br /&gt;
# currently suppoorted in IE &amp;gt; 8 http://blogs.msdn.com/b/ie/archive/2008/09/02/ie8-security-part-vi-beta-2-update.aspx&lt;br /&gt;
# http://msdn.microsoft.com/en-us/library/ie/gg622941(v=vs.85).aspx&lt;br /&gt;
# 'soon' on Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=471020&lt;br /&gt;
add_header X-Content-Type-Options nosniff;&lt;br /&gt;
&lt;br /&gt;
# This header enables the Cross-site scripting (XSS) filter built into most recent web browsers.&lt;br /&gt;
# It's usually enabled by default anyway, so the role of this header is to re-enable the filter for&lt;br /&gt;
# this particular website if it was disabled by the user.&lt;br /&gt;
# https://www.owasp.org/index.php/List_of_useful_HTTP_headers&lt;br /&gt;
add_header X-XSS-Protection &amp;quot;1; mode=block&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
# with Content Security Policy (CSP) enabled(and a browser that supports it(http://caniuse.com/#feat=contentsecuritypolicy),&lt;br /&gt;
# you can tell the browser that it can only download content from the domains you explicitly allow&lt;br /&gt;
# http://www.html5rocks.com/en/tutorials/security/content-security-policy/&lt;br /&gt;
# https://www.owasp.org/index.php/Content_Security_Policy&lt;br /&gt;
# I need to change our application code so we can increase security by disabling 'unsafe-inline' 'unsafe-eval'&lt;br /&gt;
# directives for css and js(if you have inline css or js, you will need to keep it too).&lt;br /&gt;
# more: http://www.html5rocks.com/en/tutorials/security/content-security-policy/#inline-code-considered-harmful&lt;br /&gt;
add_header Content-Security-Policy &amp;quot;default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://ssl.google-analytics.com https://assets.zendesk.com https://connect.facebook.net; img-src 'self' https://example.com https://example1.com; style-src https://example.com; font-src https://example.com; frame-src https://example.com; object-src 'none'&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
server {&lt;br /&gt;
 listen 443 ssl default deferred;&lt;br /&gt;
 server_name .forgott.com;&lt;br /&gt;
 &lt;br /&gt;
 ssl_certificate the_path_of_your_certificate.crt;&lt;br /&gt;
 ssl_certificate_key the_path_of_your_key.key;&lt;br /&gt;
&lt;br /&gt;
Django&lt;br /&gt;
Django recently introduced a package with a number a collection of models, views and middlewares to aid secure Django based projects.&lt;br /&gt;
The installation of this model can be done through from Python packages repository: &lt;br /&gt;
pip install django-security&lt;br /&gt;
Also, the the latest development version, install from django-security repository on GitHub:&lt;br /&gt;
git clone https://github.com/sdelements/django-security.git&lt;br /&gt;
cd django-security&lt;br /&gt;
sudo python setup.py install&lt;br /&gt;
For each Djangon’s application, the settings.py file must be modified.&lt;br /&gt;
&lt;br /&gt;
INSTALLED_APPS = (&lt;br /&gt;
    ...&lt;br /&gt;
    'security',&lt;br /&gt;
    ...&lt;br /&gt;
    )&lt;br /&gt;
Middleware modules can be added to MIDDLEWARE_CLASSES list in settings file. Particularly, it is our interesting the ContentSecurityPolicyMiddleware. It sends Content Security Policy (CSP) header in HTTP response.:&lt;br /&gt;
MIDDLEWARE_CLASSES = (&lt;br /&gt;
...&lt;br /&gt;
'security.middleware.DoNotTrackMiddleware',&lt;br /&gt;
'security.ContentSecurityPolicyMiddleware',&lt;br /&gt;
'security.middleware.ContentNoSniff',&lt;br /&gt;
'security.middleware.XssProtectMiddleware',&lt;br /&gt;
'security.middleware.XFrameOptionsMiddleware',&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors =&lt;br /&gt;
&lt;br /&gt;
Neil Mattatall - neil[at]owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
Denis Mello - ddtaxe&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
{{Cheatsheet_Navigation}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Denis Vinicius de Mello</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Content_Security_Policy_Cheat_Sheet&amp;diff=192710</id>
		<title>Content Security Policy Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Content_Security_Policy_Cheat_Sheet&amp;diff=192710"/>
				<updated>2015-04-04T12:09:35Z</updated>
		
		<summary type="html">&lt;p&gt;Denis Vinicius de Mello: /* DRAFT CHEAT SHEET - WORK IN PROGRESS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Content Security Policy (CSP) is an important standard that is aimed to prevent attacks such as cross-site scripting (XSS) and more importantly to reduce the harm caused by content injection attacks.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Introduction to CSP here.&lt;br /&gt;
&lt;br /&gt;
= 80% Solution Policy =&lt;br /&gt;
&lt;br /&gt;
This allows inline javascript and styles while ensuring flash and mixed content can't happen.&lt;br /&gt;
&lt;br /&gt;
 default-src 'self'; font-src data: 'self'; img-src data: https:&lt;br /&gt;
 'self'; media-src *; object-src 'none'; script-src 'self'&lt;br /&gt;
 'unsafe-inline'; style-src 'self' 'unsafe-inline'; report-uri ???&lt;br /&gt;
&lt;br /&gt;
[todo] adding eval&lt;br /&gt;
[todo] adding a CDN, for example&lt;br /&gt;
[todo] Add instructions for google analytics/translation&lt;br /&gt;
&lt;br /&gt;
= Configurations =&lt;br /&gt;
&lt;br /&gt;
[todo] add context around these examples and where they would go in a&lt;br /&gt;
config file.&lt;br /&gt;
&lt;br /&gt;
== Apache ==&lt;br /&gt;
&lt;br /&gt;
 Header set X-Content-Type-Options &amp;quot;nosniff&amp;quot;&lt;br /&gt;
 Header set X-XSS-Protection &amp;quot;1; mode=block&amp;quot;&lt;br /&gt;
 Header set X-Frame-Options &amp;quot;SAMEORIGIN&amp;quot;&lt;br /&gt;
 Header set Strict-Transport-Security &amp;quot;max-age=631138519&amp;quot;&lt;br /&gt;
 Header unset Content-Security-Policy&lt;br /&gt;
 Header add Content-Security-Policy-Report-Only &amp;lt;whatever the policy ends up being&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== nginx ==&lt;br /&gt;
 &lt;br /&gt;
 add_header X-Content-Type-Options &amp;quot;nosniff&amp;quot;;&lt;br /&gt;
 add_header X-XSS-Protection &amp;quot;1; mode=block&amp;quot;;&lt;br /&gt;
 add_header X-Frame-Options &amp;quot;SAMEORIGIN&amp;quot;; &lt;br /&gt;
 add_header Strict-Transport-Security &amp;quot;max-age=631138519&amp;quot;; &lt;br /&gt;
 add_header Content-Security-Policy-Report-Only &amp;lt;whatever the policy&lt;br /&gt;
 ends up being&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors =&lt;br /&gt;
&lt;br /&gt;
Neil Mattatall - neil[at]owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
Denis Mello - ddtaxe&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
{{Cheatsheet_Navigation}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Denis Vinicius de Mello</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=User:Denis_Vinicius_de_Mello&amp;diff=182700</id>
		<title>User:Denis Vinicius de Mello</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=User:Denis_Vinicius_de_Mello&amp;diff=182700"/>
				<updated>2014-09-22T17:47:17Z</updated>
		
		<summary type="html">&lt;p&gt;Denis Vinicius de Mello: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;•	A multi-skilled solution/technology architect, security expert accomplished 10+ years leading the design, development and implementation of high-performance technology and security solutions. Plus, several areas of Information Security, Project Management, Governance and Cloud Computing.&lt;br /&gt;
•	Proven consulting, leadership and ability to bring the benefits of IT to solve business issues while delivering projects, applications and infrastructure to large corporations. Contributed in successful projects, team leadership and presentation skills at executive management level.&lt;br /&gt;
•	Solid experience in analyzing, documenting customer requirements and providing technology planning, strategy, direction and design choices within solutions used to meet the business requirements.&lt;br /&gt;
•	Infrastructure knowledge concentrated around next generation data center, Infrastructure as a Service (IaaS), Platform as a Service (Paas)&lt;br /&gt;
•	Complete software development lifecycle experience on multiple projects utilizing waterfall and Agile methodologies.  &lt;br /&gt;
&lt;br /&gt;
Technical Skills:&lt;br /&gt;
- SalesForce.com Administration and Development (triggers, classes);&lt;br /&gt;
- SOA, Webservices and Cloud Solutions;&lt;br /&gt;
- TCP Protocol and OSI Model;&lt;br /&gt;
- Network Topology;&lt;br /&gt;
- Linux/Windows Penetration Tester and Management (DHCP, LDAP, DNS.)&lt;br /&gt;
- DBMS solutions;&lt;br /&gt;
- Debugging Tools, Reverse Engineering and Malware's behavior;&lt;br /&gt;
- Windows Server Platform and Linux 2.6 kernel knowledge ;&lt;br /&gt;
- Security hacking: stack and buffer overflow and analysis in C (starting Java and Python), SQL Injection, XSS and shellcode, &lt;br /&gt;
- Security Forensic Analysis knowledge; &lt;br /&gt;
- VMware vSphere;&lt;br /&gt;
&lt;br /&gt;
Business Skills:&lt;br /&gt;
- Project and IT Management;&lt;br /&gt;
- Process Mapping/BPM;&lt;br /&gt;
- IT Strategy;&lt;br /&gt;
- Pre-sales&lt;br /&gt;
- Workshops and Education;&lt;br /&gt;
- Team Leadership.&lt;br /&gt;
- Business and Technical Writer;&lt;br /&gt;
- IT and Security Evangelist.&lt;br /&gt;
- SDLC and Agile&lt;/div&gt;</summary>
		<author><name>Denis Vinicius de Mello</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Content_Security_Policy_Cheat_Sheet&amp;diff=182699</id>
		<title>Content Security Policy Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Content_Security_Policy_Cheat_Sheet&amp;diff=182699"/>
				<updated>2014-09-22T17:44:27Z</updated>
		
		<summary type="html">&lt;p&gt;Denis Vinicius de Mello: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= DRAFT CHEAT SHEET - WORK IN PROGRESS =&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Introduction to CSP here.&lt;br /&gt;
&lt;br /&gt;
= 80% Solution Policy =&lt;br /&gt;
&lt;br /&gt;
This allows inline javascript and styles while ensuring flash and mixed content can't happen.&lt;br /&gt;
&lt;br /&gt;
 default-src 'self'; font-src data: 'self'; img-src data: https:&lt;br /&gt;
 'self'; media-src *; object-src 'none'; script-src 'self'&lt;br /&gt;
 'unsafe-inline'; style-src 'self' 'unsafe-inline'; report-uri ???&lt;br /&gt;
&lt;br /&gt;
[todo] adding eval&lt;br /&gt;
[todo] adding a CDN, for example&lt;br /&gt;
[todo] Add instructions for google analytics/translation&lt;br /&gt;
&lt;br /&gt;
= Configurations =&lt;br /&gt;
&lt;br /&gt;
[todo] add context around these examples and where they would go in a&lt;br /&gt;
config file.&lt;br /&gt;
&lt;br /&gt;
== Apache ==&lt;br /&gt;
&lt;br /&gt;
 Header set X-Content-Type-Options &amp;quot;nosniff&amp;quot;&lt;br /&gt;
 Header set X-XSS-Protection &amp;quot;1; mode=block&amp;quot;&lt;br /&gt;
 Header set X-Frame-Options &amp;quot;SAMEORIGIN&amp;quot;&lt;br /&gt;
 Header set Strict-Transport-Security &amp;quot;max-age=631138519&amp;quot;&lt;br /&gt;
 Header unset Content-Security-Policy&lt;br /&gt;
 Header add Content-Security-Policy-Report-Only &amp;lt;whatever the policy ends up being&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== nginx ==&lt;br /&gt;
 &lt;br /&gt;
 add_header X-Content-Type-Options &amp;quot;nosniff&amp;quot;;&lt;br /&gt;
 add_header X-XSS-Protection &amp;quot;1; mode=block&amp;quot;;&lt;br /&gt;
 add_header X-Frame-Options &amp;quot;SAMEORIGIN&amp;quot;; &lt;br /&gt;
 add_header Strict-Transport-Security &amp;quot;max-age=631138519&amp;quot;; &lt;br /&gt;
 add_header Content-Security-Policy-Report-Only &amp;lt;whatever the policy&lt;br /&gt;
 ends up being&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors =&lt;br /&gt;
&lt;br /&gt;
Neil Mattatall - neil[at]owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
Denis Mello - ddtaxe&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
{{Cheatsheet_Navigation}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Denis Vinicius de Mello</name></author>	</entry>

	</feed>