-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create new config section for web security settings (#2815)
* Document the new config section * Add a link to the correct config-file from settings.py
- Loading branch information
Showing
6 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,4 @@ Howtos | |
setting-up-logging | ||
using_the_api | ||
api_parameters | ||
securing-nav-in-production |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
========================== | ||
Securing NAV in production | ||
========================== | ||
|
||
Overview | ||
======== | ||
|
||
The default configuration of NAV is set up to work well during development, but | ||
needs to be tightened when running in production. | ||
|
||
NAV consists of pages controlled by NAV itself, and pages served directly by | ||
the web server. Security features for NAV's own pages are controlled via the | ||
``[security]``-section in the file :file:`webfront/webfront.conf`, while | ||
security for the other pages are controlled directly by the web server. | ||
|
||
|
||
SSL/TLS | ||
======= | ||
|
||
This needs to be turned on in the webserver itself. While there is no reason to | ||
serve any of NAV without SSL/TLS turned off, it is especially important for the | ||
pages controlled by NAV. | ||
|
||
When the server serves NAV with SSL/TLS, ensure that the ``needs_tls``-flag in | ||
the ``[security]``-section is set to ``yes``. This explicitly turns on secure | ||
cookies, which is dependent on SSL being in use. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from pathlib import Path | ||
|
||
from nav.config import NAVConfigParser | ||
|
||
|
||
class WebSecurityConfigParser(NAVConfigParser): | ||
DEFAULT_CONFIG_FILES = [str(Path('webfront') / 'webfront.conf')] | ||
DEFAULT_CONFIG = u""" | ||
[security] | ||
needs_tls=no | ||
""" |