检查安全响应头
检查响应头和 CSP 草稿,再确认 URL 与 DNS 目标就是要保护的站点。
- 1. HTTP
在同一界面检查 status、redirect、粘贴的 header 和 CSP 警告。
- 2. URL Parse
编写策略前拆分 origin、path、query 和跟踪参数。
- 3. DNS
确认 hostname 解析到正在检查的部署。
检查公开 URL 的状态码、重定向链和关键响应标头,用于部署与 SEO 验证。
输入 / 输出
输入、输出和复制操作集中在这个主区域。示例和检查内容放在下方。
本地会话
输入状态只保存在此浏览器中,可在无账号时恢复上次工作区。
完成主要输入/输出流程后,再打开需要的示例、检查清单和相关工具。
检查安全响应头
检查响应头和 CSP 草稿,再确认 URL 与 DNS 目标就是要保护的站点。
在同一界面检查 status、redirect、粘贴的 header 和 CSP 警告。
编写策略前拆分 origin、path、query 和跟踪参数。
确认 hostname 解析到正在检查的部署。
检查搜索发现准备
提交 Search Console 或站长工具前,一起检查最终 status、sitemap URL、robots 规则、canonical/meta 信号和 URL 结构。
确认提交 URL 在目标 canonical host 上最终返回 200。
清理提交 URL 列表,移除重复项,并复制搜索发现报告。
确认 crawler 规则和 sitemap 指令没有阻止公开页面,然后复制抓取报告。
一起检查 title、description、canonical、robots 和社交预览信号,然后复制抓取报告。
预览分享卡片,检查 image 与 robots 信号,然后复制社交爬虫报告。
移除跟踪参数,比较干净的 canonical 候选,然后复制 URL canonical 报告。
诊断未收录 URL
当 Search Console 显示已抓取或已发现但未收录时,先检查最终响应、sitemap 证据、robots 规则、metadata 和 canonical 形态,再等待下一次报告刷新。
证明被检查 URL 在 canonical host 上最终为 200,并保留 redirect/header 证据。
核对 URL 是否在提交的 sitemap 集合中,并复制带数量和警告的 discovery report。
检查 crawler 规则或 sitemap 指令是否与被检查页面冲突。
检查 title、description、canonical 和 robots metadata,避免内容过薄或误设 noindex。
记录后续前,移除 tracking 和重复 path,并将 clean canonical URL 与检查 URL 对比。
复制前检查
常见失败情况
相关工具
指南
完成主要输入/输出流程后,再打开需要的示例、检查清单和相关工具。
https://www.google.comhttp://bobob.apphttps://example.comCrawler 预设只会改变此服务器端检查的安全请求头;真实抓取和索引证据请以 Search Console 或服务器日志为准。
粘贴响应头,检查缓存、安全、Cookie 和 CORS 信号,再写入调试记录。
头数量
5
重复名称
0
安全头
3
Cookie 头
0
在发布或调试公开页面前,快速扫描开发者常检查的安全响应头。
安全头得分
3/6
缺少必需项
1
Strict-Transport-Security
必需
首次访问后保护 HTTPS 用户免受协议降级影响。
存在Content-Security-Policy
必需
限制 script、style、image、connection 和 frame source。
存在X-Content-Type-Options
必需
nosniff 帮助浏览器避免 MIME type 混淆。
缺失X-Frame-Options / frame-ancestors
建议
控制其他站点是否能在 frame 中嵌入页面。
存在Referrer-Policy
建议
限制发送到其他 origin 的 URL 信息量。
缺失Permissions-Policy
建议
限制 camera、geolocation、fullscreen 等浏览器能力访问。
缺失先检查 Access-Control 响应头,再把浏览器 preflight 错误当作应用 bug。
Origin 策略
缺失
—
Credential 策略
不允许 credential
允许 method
—
允许 header
—
Vary Origin
否
—
Preflight status
200
OPTIONS signal
—
头名称会规范化,便于扫描重复项和检查分类。
复制包含安全得分、必需项缺失、cookie/CORS 备注和部署检查的安全报告。
头数量
5
安全头得分
3/6
缺少必需项
1
Cookie 头
0
CORS
0
Origin 策略
缺失
—
OPTIONS signal
—
包含原始头
否
不包含,仅包含指标、准备度检查和备注。
部署检查清单
# 安全头报告
- 检查时间: 浏览器复制时间
- 头数量: 5
- 重复名称: 0
- 安全头得分: 3/6
- 缺少必需项: 1
- Cookie 头: 0
- CORS: 0
- Origin 策略: 缺失 (—)
- Credential 策略: 不允许 credential
- 允许 method: —
- 允许 header: —
- Vary Origin: 否
- OPTIONS signal: —
- Preflight status: 200
- 包含原始头: 不包含,仅包含指标、准备度检查和备注。
## 检查备注
- 未发现明显安全头警告。发布前仍需确认目标应用策略。
## CORS preflight 备注
- 未发现 CORS 响应头。普通页面可以接受,但跨 origin 浏览器 API 调用仍会失败。
## 安全头检查
- Strict-Transport-Security: 存在 (必需)
- Content-Security-Policy: 存在 (必需)
- X-Content-Type-Options: 缺失 (必需)
- X-Frame-Options / frame-ancestors: 存在 (建议)
- Referrer-Policy: 缺失 (建议)
- Permissions-Policy: 缺失 (建议)
## 部署检查清单
- 确认 HTTPS 页面在首个生产响应后发送 Strict-Transport-Security。
- 将 report-only 策略改为 enforcement 前检查 Content-Security-Policy source。
- 检查 Set-Cookie 的 Secure、HttpOnly、SameSite 和缓存交互。
- 核对 CORS origin 与 credentials 是否匹配目标公开 API client。
- CDN、proxy 或部署变更后重新执行 public URL check。{
"entries": [
{
"name": "content-type",
"value": "text/html; charset=utf-8",
"categoryKey": "contentHeaderCategory",
"categoryFallback": "Content"
},
{
"name": "cache-control",
"value": "public, max-age=3600",
"categoryKey": "cacheHeaderCategory",
"categoryFallback": "Cache"
},
{
"name": "strict-transport-security",
"value": "max-age=31536000; includeSubDomains",
"categoryKey": "securityHeaderCategory",
"categoryFallback": "Security"
},
{
"name": "content-security-policy",
"value": "default-src 'self'; img-src 'self' https:",
"categoryKey": "securityHeaderCategory",
"categoryFallback": "Security"
},
{
"name": "x-frame-options",
"value": "DENY",
"categoryKey": "securityHeaderCategory",
"categoryFallback": "Security"
}
],
"malformedLines": 0,
"metrics": {
"headerCount": 5,
"duplicateHeaderNames": 0,
"securityHeaders": 3,
"corsHeaders": 0,
"cookieHeaders": 0,
"presentSecurityHeaders": 3,
"securityCheckCount": 6,
"missingRequiredSecurityHeaders": 1
},
"securityChecks": [
{
"key": "hsts",
"label": "Strict-Transport-Security",
"present": true,
"required": true,
"detail": "首次访问后保护 HTTPS 用户免受协议降级影响。"
},
{
"key": "csp",
"label": "Content-Security-Policy",
"present": true,
"required": true,
"detail": "限制 script、style、image、connection 和 frame source。"
},
{
"key": "x-content-type-options",
"label": "X-Content-Type-Options",
"present": false,
"required": true,
"detail": "nosniff 帮助浏览器避免 MIME type 混淆。"
},
{
"key": "frame-protection",
"label": "X-Frame-Options / frame-ancestors",
"present": true,
"required": false,
"detail": "控制其他站点是否能在 frame 中嵌入页面。"
},
{
"key": "referrer-policy",
"label": "Referrer-Policy",
"present": false,
"required": false,
"detail": "限制发送到其他 origin 的 URL 信息量。"
},
{
"key": "permissions-policy",
"label": "Permissions-Policy",
"present": false,
"required": false,
"detail": "限制 camera、geolocation、fullscreen 等浏览器能力访问。"
}
],
"corsPreflight": {
"hasCorsHeaders": false,
"warnings": [
"未发现 CORS 响应头。普通页面可以接受,但跨 origin 浏览器 API 调用仍会失败。"
],
"reviewWarnings": [],
"originPolicy": "缺失",
"originValue": "—",
"credentialsPolicy": "不允许 credential",
"methodsDisplay": "—",
"headersDisplay": "—",
"optionsPolicy": "—",
"varyOriginLabel": "否",
"statusDisplay": "200",
"metrics": [
{
"label": "Origin 策略",
"value": "缺失",
"description": "—"
},
{
"label": "Credential 策略",
"value": "不允许 credential"
},
{
"label": "允许 method",
"value": "—"
},
{
"label": "允许 header",
"value": "—"
},
{
"label": "Vary Origin",
"value": "否",
"description": "—"
},
{
"label": "Preflight status",
"value": "200"
},
{
"label": "OPTIONS signal",
"value": "—"
}
]
},
"warnings": []
}生成 Content-Security-Policy 头,检查高风险 source,再送入头解析器。
指令
7
头模式
Enforce
Content-Security-Policy: default-src 'self'; script-src 'self'; style-src 'self'; img-src 'self' data:; connect-src 'self'; font-src 'self'; frame-ancestors 'none'可复制输出
输出会显示在这里。