security: waf 边缘统一注入安全响应头
外部扫描发现站点缺少安全响应头。在 waf 反代/403/502 三个出站路径统一注入 XFO/nosniff/Referrer-Policy/Permissions-Policy/HSTS/CSP,下游同名头一律覆盖避免重复;static 补上漏调用的 apply_security_headers 做纵深防御。
This commit is contained in:
1 parent
e89578fa82
commit
b2ddd9e7e3
2 files changed
+25
No files matched your search
@@ -13,6 +13,7 @@ import sys
|
||||
# pymsg 日志客户端(集中式日志 → dbv2 Logs 表)
|
||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
|
||||
from log_client import logs # noqa: E402
|
||||
from security_middleware import apply_security_headers # noqa: E402
|
||||
|
||||
# 基准目录:编译后取可执行文件所在目录,开发时取脚本所在目录
|
||||
# 解决 Nuitka onefile 解压到 /tmp 后相对路径失效的问题
|
||||
@@ -38,6 +39,7 @@ args = parser.parse_args()
|
||||
|
||||
app = Flask(__name__)
|
||||
CORS(app, origins=["https://qsont.me", "https://yhdet.top", "http://localhost:9200"])
|
||||
apply_security_headers(app)
|
||||
|
||||
# ==================== 配置文件加载 ====================
|
||||
CONFIG_FILE = args.config
|
||||
|
||||
Reference in new issue
Block a user