news.volyx.in

HTTP Security Headers – A Complete Guide (nullsweep.com)

709 points by BCharlie · 2651 days ago · 78 comments on HN

Article summary

The article discusses the importance of setting HTTP security headers to improve website security and comply with company security ratings. It provides a guide on how to set various security headers, including Content-Security-Policy, Strict-Transport-Security, and X-Frame-Options. The article also includes sample configurations for Apache and Nginx web servers. Setting these headers can help prevent cross-site scripting, clickjacking, and other security vulnerabilities.

Main themes

  • HTTP security headers
  • website security
  • company security ratings
  • web server configuration
  • security best practices

What commenters say

  • Enabling HSTS can be dangerous if a website is later unable to serve HTTPS traffic, as it can prevent users from accessing the site. Some commenters argue that the inability to serve HTTPS traffic should be considered a breaking issue and that reduced security is not a valid fallback option. Others believe that HSTS is a necessary security feature that protects against real threats, and that the potential risks are outweighed by the benefits. The importance of properly handling user data, such as automatically saving progress in local storage, is also highlighted as a way to mitigate potential losses in case of HSTS-related issues. Some argue that the problem with HSTS is not the feature itself, but rather how applications handle storing in-progress work. Others believe that HSTS can cause an effectively immediate and irreversible domain-wide DoS if not properly managed. The trade-off between security and usability is a common theme, with some arguing that security should always take precedence, while others believe that there are situations where reduced security may be necessary.