Просмотр исходного кода

matrix_nginx_proxy_xss_protection

pull/1024/head
sakkiii 4 лет назад
Родитель
Сommit
df2d91970d
9 измененных файлов: 33 добавлений и 7 удалений
  1. +4
    -0
      roles/matrix-nginx-proxy/defaults/main.yml
  2. +8
    -0
      roles/matrix-nginx-proxy/templates/nginx/conf.d/matrix-base-domain.conf.j2
  3. +1
    -1
      roles/matrix-nginx-proxy/templates/nginx/conf.d/matrix-bot-go-neb.conf.j2
  4. +1
    -3
      roles/matrix-nginx-proxy/templates/nginx/conf.d/matrix-client-element.conf.j2
  5. +1
    -1
      roles/matrix-nginx-proxy/templates/nginx/conf.d/matrix-dimension.conf.j2
  6. +8
    -0
      roles/matrix-nginx-proxy/templates/nginx/conf.d/matrix-domain.conf.j2
  7. +1
    -1
      roles/matrix-nginx-proxy/templates/nginx/conf.d/matrix-jitsi.conf.j2
  8. +8
    -0
      roles/matrix-nginx-proxy/templates/nginx/conf.d/matrix-riot-web.conf.j2
  9. +1
    -1
      roles/matrix-nginx-proxy/templates/nginx/conf.d/matrix-sygnal.conf.j2

+ 4
- 0
roles/matrix-nginx-proxy/defaults/main.yml Просмотреть файл

@@ -290,6 +290,10 @@ matrix_nginx_proxy_floc_optout_enabled: true
# - https://hstspreload.org/#opt-in
matrix_nginx_proxy_hsts_preload_enable: false

#
#
matrix_nginx_proxy_xss_protection: "1; mode=block"

# Specifies the SSL configuration that should be used for the SSL protocols and ciphers
# This is based on the Mozilla Server Side TLS Recommended configurations.
#


+ 8
- 0
roles/matrix-nginx-proxy/templates/nginx/conf.d/matrix-base-domain.conf.j2 Просмотреть файл

@@ -9,6 +9,14 @@
{% if matrix_nginx_proxy_floc_optout_enabled %}
add_header Permissions-Policy interest-cohort=() always;
{% endif %}
{% if matrix_nginx_proxy_hsts_preload_enable %}
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
{% else %}
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
{% endif %}
add_header X-XSS-Protection "{{ matrix_nginx_proxy_xss_protection }}";

{% for configuration_block in matrix_nginx_proxy_proxy_domain_additional_server_configuration_blocks %}
{{- configuration_block }}


+ 1
- 1
roles/matrix-nginx-proxy/templates/nginx/conf.d/matrix-bot-go-neb.conf.j2 Просмотреть файл

@@ -8,7 +8,7 @@
{% else %}
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
{% endif %}
add_header X-XSS-Protection "1; mode=block";;
add_header X-XSS-Protection "{{ matrix_nginx_proxy_xss_protection }}";
add_header X-Content-Type-Options nosniff;

{% for configuration_block in matrix_nginx_proxy_proxy_bot_go_neb_additional_server_configuration_blocks %}


+ 1
- 3
roles/matrix-nginx-proxy/templates/nginx/conf.d/matrix-client-element.conf.j2 Просмотреть файл

@@ -10,10 +10,8 @@
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
{% endif %}
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header X-XSS-Protection "{{ matrix_nginx_proxy_xss_protection }}";
add_header X-Frame-Options SAMEORIGIN;
add_header Content-Security-Policy "frame-ancestors 'none'; require-trusted-types-for 'script'; base-uri 'self'";
add_header Referrer-Policy "strict-origin-when-cross-origin";

{% if matrix_nginx_proxy_floc_optout_enabled %}
add_header Permissions-Policy interest-cohort=() always;


+ 1
- 1
roles/matrix-nginx-proxy/templates/nginx/conf.d/matrix-dimension.conf.j2 Просмотреть файл

@@ -8,7 +8,7 @@
{% else %}
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
{% endif %}
add_header X-XSS-Protection "1; mode=block";
add_header X-XSS-Protection "{{ matrix_nginx_proxy_xss_protection }}";
add_header X-Content-Type-Options nosniff;
{% if matrix_nginx_proxy_floc_optout_enabled %}
add_header Permissions-Policy interest-cohort=() always;


+ 8
- 0
roles/matrix-nginx-proxy/templates/nginx/conf.d/matrix-domain.conf.j2 Просмотреть файл

@@ -20,6 +20,14 @@
{% if matrix_nginx_proxy_floc_optout_enabled %}
add_header Permissions-Policy interest-cohort=() always;
{% endif %}
{% if matrix_nginx_proxy_hsts_preload_enable %}
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
{% else %}
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
{% endif %}
add_header X-XSS-Protection "{{ matrix_nginx_proxy_xss_protection }}";

location /.well-known/matrix {
root {{ matrix_static_files_base_path }};


+ 1
- 1
roles/matrix-nginx-proxy/templates/nginx/conf.d/matrix-jitsi.conf.j2 Просмотреть файл

@@ -8,7 +8,7 @@
{% else %}
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
{% endif %}
add_header X-XSS-Protection "1; mode=block";
add_header X-XSS-Protection "{{ matrix_nginx_proxy_xss_protection }}";
add_header X-Content-Type-Options nosniff;
{% if matrix_nginx_proxy_floc_optout_enabled %}
add_header Permissions-Policy interest-cohort=() always;


+ 8
- 0
roles/matrix-nginx-proxy/templates/nginx/conf.d/matrix-riot-web.conf.j2 Просмотреть файл

@@ -4,6 +4,14 @@
{% if matrix_nginx_proxy_floc_optout_enabled %}
add_header Permissions-Policy interest-cohort=() always;
{% endif %}
{% if matrix_nginx_proxy_hsts_preload_enable %}
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
{% else %}
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
{% endif
add_header X-XSS-Protection "{{ matrix_nginx_proxy_xss_protection }}";

{% for configuration_block in matrix_nginx_proxy_proxy_riot_additional_server_configuration_blocks %}
{{- configuration_block }}


+ 1
- 1
roles/matrix-nginx-proxy/templates/nginx/conf.d/matrix-sygnal.conf.j2 Просмотреть файл

@@ -8,7 +8,7 @@
{% else %}
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
{% endif %}
add_header X-XSS-Protection "1; mode=block";
add_header X-XSS-Protection "{{ matrix_nginx_proxy_xss_protection }}";
add_header X-Content-Type-Options nosniff;
add_header X-Frame-Options DENY;



Загрузка…
Отмена
Сохранить