17750: Update nginx/ssl example pillars and states
[arvados-formula.git] / test / salt / pillar / examples / nginx_passenger.sls
1 ---
2 # Copyright (C) The Arvados Authors. All rights reserved.
3 #
4 # SPDX-License-Identifier: Apache-2.0
5
6 {%- if grains.os_family in ('RedHat',) %}
7   {%- set passenger_pkg = 'nginx-mod-http-passenger' %}
8   {%- set passenger_mod = '/usr/lib64/nginx/modules/ngx_http_passenger_module.so' %}
9 {%- else %}
10   {%- set passenger_pkg = 'libnginx-mod-http-passenger' %}
11   {%- set passenger_mod = '/usr/lib/nginx/modules/ngx_http_passenger_module.so' %}
12 {%- endif %}
13
14 ### NGINX
15 nginx:
16   install_from_phusionpassenger: true
17   lookup:
18     passenger_package: {{ passenger_pkg }}
19   ### PASSENGER
20   passenger:
21     passenger_ruby: /usr/local/rvm/rubies/ruby-2.5.8/bin/ruby
22
23   ### SERVER
24   server:
25     config:
26       # This is required to get the passenger module loaded
27       # In Debian it can be done with this
28       # include: 'modules-enabled/*.conf'
29       load_module: {{ passenger_mod }}
30
31       worker_processes: 4
32
33   ### SNIPPETS
34   snippets:
35     # Based on https://ssl-config.mozilla.org/#server=nginx&version=1.14.2&config=intermediate&openssl=1.1.1d&guideline=5.4
36     ssl_hardening_default.conf:
37       - ssl_session_timeout: 1d
38       - ssl_session_cache: 'shared:curiiSSL:10m'
39       - ssl_session_tickets: 'off'
40
41       # intermediate configuration
42       - ssl_protocols: TLSv1.2 TLSv1.3
43       - ssl_ciphers: ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384
44       - ssl_prefer_server_ciphers: 'off'
45
46       # HSTS (ngx_http_headers_module is required) (63072000 seconds)
47       - add_header: 'Strict-Transport-Security "max-age=63072000" always'
48
49       # OCSP stapling
50       # FIXME! Stapling does not work with self-signed certificates, so disabling for tests
51       # - ssl_stapling: 'on'
52       # - ssl_stapling_verify: 'on'
53
54       # verify chain of trust of OCSP response using Root CA and Intermediate certs
55       # - ssl_trusted_certificate /path/to/root_CA_cert_plus_intermediates
56
57       # curl https://ssl-config.mozilla.org/ffdhe2048.txt > /path/to/dhparam
58       # - ssl_dhparam: /path/to/dhparam
59
60       # replace with the IP address of your resolver
61       # - resolver: 127.0.0.1
62
63     arvados-snakeoil.conf:
64       - ssl_certificate: /etc/ssl/private/arvados-snakeoil-cert.pem
65       - ssl_certificate_key: /etc/ssl/private/arvados-snakeoil-cert.key
66
67   ### SITES
68   servers:
69     managed:
70       # Remove default webserver
71       default:
72         enabled: false