Bonjour, je ne suis pas du tout expert en code, ou en sécurité web malgré tout je cherche à améliorer la sécurité de mon auto-hébergement Yunohost.
J’ai fait pas mal de recherche sur NGINX afin d’y apporter les réglages les plus justes possibles.
J’aimerai savoir ce que vous en pensez ?
S’il y a des améliorations car à mon test SSL je suis en grade B et j’avoue être perdu pour obtenir le résultat A+.
Ma 2eme question est comment implémenter dans Yunohost cet article : https://www.nginx.com/blog/thread-pools-boost-performance-9x/
It’s time to put our thread pools in play. For this we just add the aio threads directive to the location
location / {
root /storage;
aio threads;
}
Mes sources : buzut.fr/optimiser-nginx/ merci de lire entièrement il est très complet !
raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html#The_Cipher_Suite un excellent site sur la sécurité.
J’ai utilisé https://www.ssllabs.com/ssltest/ qui permet d’évaluer la sécurité.
Et voilà mon nginx.conf actuel
user www-data;
worker_processes 2;
pid /run/nginx.pid;
events {
worker_connections 65536;
# multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
# HSTS (ngx_http_headers_module is required)
add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; ";
add_header X-Frame-Options "DENY";
types_hash_max_size 2048;
# server_tokens off;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
client_body_buffer_size 16K;
client_header_buffer_size 1k;
client_max_body_size 20m;
large_client_header_buffers 4 16k;
client_body_timeout 30;
client_header_timeout 10;
keepalive_timeout 30;
keepalive_requests 100;
send_timeout 60;
##
# Proxy
##
proxy_buffering on;
proxy_buffer_size 1k;
proxy_buffers 12 4k;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESG$
ssl_prefer_server_ciphers on;
# ssl_session_cache shared:SSL:10m;
# OCSP Stapling ---
# fetch OCSP records from URL in ssl_certificate and cache them
ssl_stapling on;
ssl_stapling_verify on;
resolver 8.8.8.8 8.8.4.4 valid=300s;
resolver_timeout 5s;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 9;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
##
#Open Cache
##
open_file_cache max=2000 inactive=5m;
open_file_cache_valid 2m;
open_file_cache_min_uses 2;
open_file_cache_errors on;
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}