diff options
author | Robert Kowalski <rok@kowalski.gd> | 2014-05-17 18:37:30 +0200 |
---|---|---|
committer | Robert Kowalski <rok@kowalski.gd> | 2014-06-09 19:09:06 +0200 |
commit | 3bcf664b2f46750bf64bf970da07f9b133f98047 (patch) | |
tree | 428f3688e8dadedf0dd9f70507bb02347ec9b309 /share | |
parent | 698f55b1bd72d2ab3585cf9be239095f2c38a2d3 (diff) | |
download | couchdb-3bcf664b2f46750bf64bf970da07f9b133f98047.tar.gz |
Add Experimental Content-Security-Policy-Support (CSP) for Fauxton
Like every web application, Fauxton is vulnerable against XSS and
CSP is a technology that tries to help against that.
The patch makes it possible to enable CSP for the /_utils path and
allows configuration of the sent header.
The default setting for the value of the header breaks the old
Futon, when CSP is enabled there. The old Futon has alot of
inline-JavaScript which is not allowed in the setting I have
chosen as default.
For development, the header is also sent from the Node server
which launches Fauxton in dev-mode.
People can enable the feature by setting enable = true in the
section [csp] of their configs
Diffstat (limited to 'share')
-rw-r--r-- | share/doc/src/config/misc.rst | 24 | ||||
-rw-r--r-- | share/doc/src/experimental.rst | 15 |
2 files changed, 39 insertions, 0 deletions
diff --git a/share/doc/src/config/misc.rst b/share/doc/src/config/misc.rst index 58d079c7f..e97575a6a 100644 --- a/share/doc/src/config/misc.rst +++ b/share/doc/src/config/misc.rst @@ -232,3 +232,27 @@ Vendor information [vendor] name = The Apache Software Foundation version = 1.5.0 + +.. _config/csp: + +Content-Security-Policy +======================= + +.. config:section:: csp :: Content-Security-Policy + + Experimental support of CSP Headers for ``/_utils`` (Fauxton). + + .. config:option:: enable + + Enable the sending of the Header ``Content-Security-Policy``:: + + [csp] + enable = true + + + .. config:option:: header_value + + You can change the default value for the Header which is sent:: + + [csp] + header_value = default-src 'self'; img-src *; font-src *; diff --git a/share/doc/src/experimental.rst b/share/doc/src/experimental.rst index 3157f534d..fae925c15 100644 --- a/share/doc/src/experimental.rst +++ b/share/doc/src/experimental.rst @@ -81,3 +81,18 @@ Plugins See `src/couch_plugins/README.md`. +Content-Security-Policy (CSP) Header Support for /_utils (Fauxton) +================================================================== + +This will just work with Fauxton, and not Futon. You can enable it +in your config: you can enable the feature in general and change +the default header that is sent for everything in /_utils. + + .. code-block:: ini + + [csp] + enable = true + +Then restart CouchDB. + +Have fun! |