2026-05 Storefront 公開面 hardening 要件¶
背景¶
- Storefront の production 公開前に、非本番用の auth bypass / debug / client log 導線を production 公開面から外す必要がある。
- あわせて、公開 endpoint の診断情報を最小化し、response security headers と non-production の noindex 方針を固定する必要がある。
合意事項¶
- auth bypass は local request に限定する
- browser 側の auth bypass は
localhost/*.localhostを前提にのみ有効化する。 - Worker 側の protected navigation bypass も local request でのみ有効化する。
-
production / staging / preview / mock の公開 URL では auth bypass を開かない。
-
production では debug / client log 導線を閉じる
- login failure 時の
x-debug-*header は production で返さない。 POST /api/client-logsは production で 404 とする。-
non-production でも
POST /api/client-logsと/monitoringは same-origin request を必須とする。 -
diagnostic endpoint は production で詳細を返しすぎない
GET /api/versionは Safe Probe と deploy verification のため引き続き公開可とする。-
GET /api/health/cmsは production ではstatusだけを返し、詳細なmessageは返さない。 -
Storefront response security headers を付与する
- 全レスポンスに少なくとも以下を付与する。
Strict-Transport-Security: max-age=31536000(HTTPS 応答のみ)X-Content-Type-Options: nosniffReferrer-Policy: strict-origin-when-cross-originX-Frame-Options: SAMEORIGINPermissions-Policy: camera=(), microphone=(), geolocation=()
-
document response には
Content-Security-Policyを付与する。 -
non-production は index させない
- staging / preview / mock / local は
X-Robots-Tag: noindex, nofollow, noarchiveを返す。 /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: /の両方で保護されていること。