Skip to content

Commit ee02363

Browse files
committed
Updates following #557 PR review
1 parent 7424613 commit ee02363

File tree

2 files changed

+29
-12
lines changed

2 files changed

+29
-12
lines changed

scripts/wordlist.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ spatialindex
254254
spatialite
255255
sqlite
256256
ssl
257+
SSL
257258
subfolder
258259
subfolders
259260
subproject

src/server/security/index.md

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Secure Mergin Maps installation
22

33
::: warning
4-
This sections aims to provide some guidelines and a minimalistic example on how to secure a Mergin Maps deployment.
4+
This sections aims to provide some guidelines and a minimalistic example on how to secure a <MainPlatformName /> deployment.
55

66
Further security enhancements should be implemented by experts in accordance to cybersecurity policies in place.
77

88
:::
9-
For security and privacy reasons Mergin Maps deployments should enable HTTPS secured connection via certificate file.
9+
For security and privacy reasons <MainPlatformName /> deployments should enable HTTPS secured connection via certificate file.
1010

1111
We provide a template configuration file <GitHubRepo id="MerginMaps/server/blob/master/ssl-proxy.conf" desc="ssl-proxy.conf" />as base for your configuration.
1212

@@ -35,15 +35,31 @@ Next, you need to point your certificate files to NGINX configuration. This is d
3535
3636
The above example uses automated keys generated by CertBot. For more information, visit [CertBot](https://certbot.eff.org/instructions) website and check how you can generate your own keys.
3737
38-
Lastly, adjust the provided NGINX `docker compose` deployment file on the <GitHubRepo id="MerginMaps/server/blob/master/docker-compose.yml" desc="proxy service section" />
38+
Some extra security settings for HTTP headers are provided. Please review them and update in accordance to your requirements.
3939
40-
``` shell
41-
- "8080:8080"
42-
volumes:
43-
- ./projects:/data # map data dir to host
44-
- - ./nginx.conf:/etc/nginx/conf.d/default.conf
45-
+ - ./ssl-proxy.conf:/etc/nginx/conf.d/default.conf
46-
- ./logs:/var/log/nginx/
47-
networks:
48-
- merginmaps
40+
```shell
41+
# Prevent crawlers from indexing and following links for all content served from the mergin app
42+
add_header X-Robots-Tag "none";
43+
44+
# Protect against clickjacking iframe
45+
add_header Content-Security-Policy "frame-ancestors 'self';" always;
46+
47+
# Add a HSTS policy to prevent plain http from browser
48+
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
49+
50+
# Set cookies security flags
51+
proxy_cookie_flags ~ secure httponly samesite=strict;
52+
53+
location / {
54+
root /var/www/html;
55+
56+
# The lines below were copied from application proxy
57+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
58+
proxy_set_header X-Forwarded-Proto $scheme;
59+
proxy_set_header Host $http_host;
60+
# we don't want nginx trying to do something clever with
61+
# redirects, we set the Host: header above already.
62+
proxy_redirect off;
63+
proxy_pass http://app_server;
64+
}
4965
```

0 commit comments

Comments
 (0)