檢查安全回應標頭
檢查回應標頭與 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 頁面在首個 production 回應後送出 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'可複製輸出
輸出會顯示在這裡。