how to set security headers correctly?
-
I keep getting warning in wordpress about security headers. I have performed all the necessary actions from the web server side, but I still see this error. My server settings:
NGINX conf# SSL PCI compliance ssl_session_cache shared:SSL:20m; ssl_session_timeout 60m; ssl_buffer_size 1400; ssl_protocols TLSv1.2 TLSv1.3; ssl_prefer_server_ciphers on; ssl_ciphers "ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS"; ssl_dhparam /etc/ssl/dhparam.pem; ssl_ecdh_curve secp384r1; ssl_session_tickets off; resolver 8.8.8.8 8.8.4.4 valid=300s ipv6=off; resolver_timeout 5s; add_header X-Frame-Options SAMEORIGIN; add_header X-Content-Type-Options nosniff; add_header Referrer-Policy no-referrer-when-downgrade; add_header X-XSS-Protection "1; mode=block"; add_header Expect-CT "max-age=7776000, enforce"; add_header X-Permitted-Cross-Domain-Policies master-only; add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"; add_header Content-Security-Policy "upgrade-insecure-requests"; add_header Content-Security-Policy-Report-Only "default-src ‘self’"; add_header Feature-Policy "geolocation ‘none’; camera ‘none’; speaker ‘none’;";
Aapache2 conf:
Include /etc/apache2/conf-enabled/security.conf
@security.conf
<IfModule mod_headers.c> Header always set Strict-Transport-Security: "max-age=31536000" env=HTTPS Header always set X-Content-Type-Options "nosniff" Header always set X-XSS-Protection "1; mode=block" Header always set Expect-CT "max-age=7776000, enforce" Header always set Referrer-Policy: "no-referrer-when-downgrade" Header always set Content-Security-Policy "upgrade-insecure-requests" </IfModule>
P.S. mod_headers activated for apache2
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘how to set security headers correctly?’ is closed to new replies.