打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
网站安全响应头缺失和php配置漏洞
最近给学校做网站,被查出各种响应头缺失的 低危漏洞  和 一些配置漏洞,还有一些需要https的配置。。。。。

php.ini 中修改

expose_php off    //  php彩蛋信息泄露
session.cookie_httponly=true  //  cookie没有设置httponly属性

PHP 配置

header("X-Frame-Options:SAMEORIGIN;");  // X-Frame-Options 响应头缺失
header("Referer-Policy:origin;");//Referer-Policy 响应头缺失
header("Content-Security-Policy:frame-ancestors 'self';");//Content-Security-Policy 响应头缺失
header("X-Permitted-Cross-Domain-Policies:'master-only';");//X-Permitted-Cross-Domain-Policies 响应头缺失
header("X-XSS-Protection:1; mode=block;");//X-XSS-Protection 响应头缺失
header("X-Download-Options: SAMEORIGIN;");//X-Download-Options 响应头缺失
header("X-Content-Type-Options:nosniff;");//X-Content-Type-Options 响应头缺失
header("Strict-Transport-Security:max-age=31536000;");//Strict-Transport-Security 响应头缺失
Nginx 配置

    add_header X-Frame-Options SAMEORIGIN;
    add_header Referer-Policy origin;
    add_header Content-Security-Policy "frame-ancestors 'self'";
    add_header X-Permitted-Cross-Domain-Policies  "master-only";
    add_header X-XSS-Protection "1; mode=block;";
    add_header X-Download-Options SAMEORIGIN;
    add_header X-Content-Type-Options nosniff;
    add_header Strict-Transport-Security max-age=31536000;
————————————————
版权声明:本文为CSDN博主「武道七修_意琦行」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/u014157384/article/details/100701740
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
http响应头安全策略
利用httponly提升应用程序安全性
测试开发必备技能:Web安全测试漏洞靶场实战
PHP简单导出Excel表格
web前端安全机制问题全解析
RESTful架构风格下的4大常见安全问题|洞见
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服