コンテンツにスキップ

2026-05 Storefront 公開面 hardening 要件

背景

  • Storefront の production 公開前に、非本番用の auth bypass / debug / client log 導線を production 公開面から外す必要がある。
  • あわせて、公開 endpoint の診断情報を最小化し、response security headers と non-production の noindex 方針を固定する必要がある。

合意事項

  1. auth bypass は local request に限定する
  2. browser 側の auth bypass は localhost / *.localhost を前提にのみ有効化する。
  3. Worker 側の protected navigation bypass も local request でのみ有効化する。
  4. production / staging / preview / mock の公開 URL では auth bypass を開かない。

  5. production では debug / client log 導線を閉じる

  6. login failure 時の x-debug-* header は production で返さない。
  7. POST /api/client-logs は production で 404 とする。
  8. non-production でも POST /api/client-logs/monitoring は same-origin request を必須とする。

  9. diagnostic endpoint は production で詳細を返しすぎない

  10. GET /api/version は Safe Probe と deploy verification のため引き続き公開可とする。
  11. GET /api/health/cms は production では status だけを返し、詳細な message は返さない。

  12. Storefront response security headers を付与する

  13. 全レスポンスに少なくとも以下を付与する。
    • Strict-Transport-Security: max-age=31536000(HTTPS 応答のみ)
    • X-Content-Type-Options: nosniff
    • Referrer-Policy: strict-origin-when-cross-origin
    • X-Frame-Options: SAMEORIGIN
    • Permissions-Policy: camera=(), microphone=(), geolocation=()
  14. document response には Content-Security-Policy を付与する。

  15. non-production は index させない

  16. staging / preview / mock / local は X-Robots-Tag: noindex, nofollow, noarchive を返す。
  17. /robots.txt は production で Allow: /、non-production で Disallow: / を返す。

完了条件

  • production の browser / Worker 公開面で auth bypass / debug header / client logs が残っていないこと。
  • /monitoring が same-origin request を必須にしていること。
  • production の /api/health/cms が status-only であること。
  • document response に security headers が付与されていること。
  • staging / preview / mock / local が noindex と Disallow: / の両方で保護されていること。