本文摘要至 HTTP 安全最佳实践 (很不错的一篇文章 建议细看)以下是对 GitHub HTTP安全简单罗列~1、全站https2、HSTS(HTTP Strict Transport Security) hsts 扩展阅读:HTTP Strict Transport Security | MDN 3、HPKP(HTTP Public-Key Pinning) HPKP 扩展阅读:HTTP Public Key Pinning 介绍 4、CSP(Content Security Policy) csp 扩展阅读: Content Security Policy 介绍 Content Security Policy Level 2 介绍 5、X-Frame-Options X-Frame-Options 扩展阅读:X-Frame-Options 响应头 6、浏览器都内建XSS 保护 X-XSS-Protection 扩展阅读:X-XSS-Protection 7、Content Type Options X-Content-Type-Options 扩展阅读:X-Content-Type-Options 8、SRI(Subresource Integrity) SRI 扩展阅读:Subresource Integrity 介绍 9、消除 Server Banner Server Banner 10、Cookie 安全 (secure 和 httponly) cookie 结语 对于网站的安全不是只开启https 就可以了,对https还需要根据业务的需求选择不同的措施,比如:HSHS,HPKP等都需要根据网站实际情况选择。除了传输上的安全还需要考虑比如网站信息泄露,cookie等。