You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: CHANGELOG.rst
+17
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,23 @@
2
2
Change history
3
3
==============
4
4
5
+
6
+
2.2.0
7
+
=====
8
+
9
+
**New features**
10
+
11
+
* updated open-api-framework to 0.8.0, which includes adding CSRF, CSP and HSTS settings (#438).
12
+
All new environment variables are added to the `documentation <https://objects-and-objecttypes-api.readthedocs.io/en/latest/installation/config.html>`_
13
+
14
+
.. warning::
15
+
16
+
``SECURE_HSTS_SECONDS`` has been added with a default of 31536000 seconds, ensure that
17
+
before upgrading to this version of open-api-framework, your entire application is served
18
+
over HTTPS, otherwise this setting can break parts of your application (see https://docs.djangoproject.com/en/4.2/ref/middleware/#http-strict-transport-security)
Copy file name to clipboardexpand all lines: docs/installation/config.rst
+15-3
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,9 @@ Required
19
19
20
20
* ``SECRET_KEY``: Secret key that's used for certain cryptographic utilities. You should generate one via `miniwebtool <https://www.miniwebtool.com/django-secret-key-generator>`_.
21
21
* ``ALLOWED_HOSTS``: a comma separated (without spaces!) list of domains that serve the installation. Used to protect against Host header attacks. Defaults to: ``(empty string)``.
22
+
* ``CACHE_DEFAULT``: redis cache address for the default cache (this **MUST** be set when using Docker). Defaults to: ``localhost:6379/0``.
23
+
* ``CACHE_AXES``: redis cache address for the brute force login protection cache (this **MUST** be set when using Docker). Defaults to: ``localhost:6379/0``.
24
+
* ``EMAIL_HOST``: hostname for the outgoing e-mail server (this **MUST** be set when using Docker). Defaults to: ``localhost``.
22
25
23
26
24
27
Database
@@ -49,16 +52,25 @@ Elastic APM
49
52
* ``ELASTIC_APM_TRANSACTION_SAMPLE_RATE``: By default, the agent will sample every transaction (e.g. request to your service). To reduce overhead and storage requirements, set the sample rate to a value between 0.0 and 1.0. Defaults to: ``0.1``.
50
53
51
54
55
+
Content Security Policy
56
+
-----------------------
57
+
58
+
* ``CSP_EXTRA_DEFAULT_SRC``: Extra default source URLs for CSP other than ``self``. Used for ``img-src``, ``style-src`` and ``script-src``. Defaults to: ``[]``.
59
+
* ``CSP_REPORT_URI``: URI of the``report-uri`` directive. Defaults to: ``None``.
60
+
* ``CSP_REPORT_PERCENTAGE``: Percentage of requests that get the ``report-uri`` directive. Defaults to: ``0``.
61
+
* ``CSP_EXTRA_FORM_ACTION``: Add additional ``form-action`` source to the default . Defaults to: ``[]``.
62
+
* ``CSP_FORM_ACTION``: Override the default ``form-action`` source. Defaults to: ``['"\'self\'"']``.
63
+
* ``CSP_EXTRA_IMG_SRC``: Extra ``img-src`` sources for CSP other than ``CSP_DEFAULT_SRC``. Defaults to: ``[]``.
64
+
* ``CSP_OBJECT_SRC``: ``object-src`` urls. Defaults to: ``['"\'none\'"']``.
65
+
66
+
52
67
Optional
53
68
--------
54
69
55
70
* ``SITE_ID``: The database ID of the site object. You usually won't have to touch this. Defaults to: ``1``.
56
71
* ``DEBUG``: Only set this to ``True`` on a local development environment. Various other security settings are derived from this setting!. Defaults to: ``False``.
57
72
* ``USE_X_FORWARDED_HOST``: whether to grab the domain/host from the X-Forwarded-Host header or not. This header is typically set by reverse proxies (such as nginx, traefik, Apache...). Note: this is a header that can be spoofed and you need to ensure you control it before enabling this. Defaults to: ``False``.
58
73
* ``IS_HTTPS``: Used to construct absolute URLs and controls a variety of security settings. Defaults to the inverse of ``DEBUG``.
59
-
* ``CACHE_DEFAULT``: redis cache address for the default cache. Defaults to: ``localhost:6379/0``.
60
-
* ``CACHE_AXES``: redis cache address for the brute force login protection cache. Defaults to: ``localhost:6379/0``.
61
-
* ``EMAIL_HOST``: hostname for the outgoing e-mail server. Defaults to: ``localhost``.
62
74
* ``EMAIL_PORT``: port number of the outgoing e-mail server. Note that if you're on Google Cloud, sending e-mail via port 25 is completely blocked and you should use 487 for TLS. Defaults to: ``25``.
63
75
* ``EMAIL_HOST_USER``: username to connect to the mail server. Defaults to: ``(empty string)``.
64
76
* ``EMAIL_HOST_PASSWORD``: password to connect to the mail server. Defaults to: ``(empty string)``.
0 commit comments