diff --git a/README.md b/README.md index b6e7373..0e68c13 100644 --- a/README.md +++ b/README.md @@ -123,6 +123,10 @@ docker compose logs --tail=200 runtime caddy docker compose exec runtime pnpm --filter @sammo-ts/release-controller status ``` +Caddy의 runtime logger는 reverse proxy 오류에도 요청 정보를 남길 수 있으므로 +`X-Session-Token` 값을 encoder 단계에서 삭제합니다. 장애 로그를 수집할 때도 +인증 헤더, cookie, token과 secret을 보고서나 채팅에 복사하지 않습니다. + ## 개발 bind 모드 로컬 Core2026 checkout을 container에 bind하고 DB/Redis/Caddy는 같은 구성으로 diff --git a/caddy/Caddyfile b/caddy/Caddyfile index b4ba1a9..3cb2a9d 100644 --- a/caddy/Caddyfile +++ b/caddy/Caddyfile @@ -1,5 +1,10 @@ { email {$ACME_EMAIL} + log { + format filter { + request>headers>X-Session-Token delete + } + } } {$SITE_ADDRESS} { diff --git a/test/runtime-secret-boundary.test.mjs b/test/runtime-secret-boundary.test.mjs index 5d51bd8..156004c 100644 --- a/test/runtime-secret-boundary.test.mjs +++ b/test/runtime-secret-boundary.test.mjs @@ -38,3 +38,9 @@ test('runtime entrypoint removes raw repository secrets before launching PM2', a assert.ok(httpsUnset > 0 && httpsUnset < pm2Start); assert.ok(sshUnset > 0 && sshUnset < pm2Start); }); + +test('Caddy runtime logs remove the custom Gateway session header', async () => { + const caddyfile = await fs.readFile(new URL('../caddy/Caddyfile', import.meta.url), 'utf8'); + + assert.match(caddyfile, /log\s*\{[\s\S]*format filter\s*\{[\s\S]*request>headers>X-Session-Token delete/); +});