From d6a126cfdf554071459902e65fc7f4bcf79ab825 Mon Sep 17 00:00:00 2001 From: kim Date: Tue, 27 Oct 2026 11:06:59 +0900 Subject: [PATCH] =?UTF-8?q?wol-gate:=20=EB=A1=9C=EA=B7=B8=EC=97=90=20?= =?UTF-8?q?=EC=B0=8D=ED=9E=88=EB=8A=94=20=EC=9A=94=EC=B2=AD=20=EC=A3=BC?= =?UTF-8?q?=EC=86=8C=EC=97=90=EC=84=9C=20token=C2=B7key=C2=B7secret=C2=B7p?= =?UTF-8?q?assword=20=EB=A5=98=20=EC=BF=BC=EB=A6=AC=20=EA=B0=92=EC=9D=84?= =?UTF-8?q?=20***=EB=A1=9C=20=EA=B0=80=EB=A6=BC=20=E2=80=94=2010-25=20/ws?= =?UTF-8?q?=3Ftoken=3D=E2=80=A6=20=EC=9D=B4=20=EA=B9=A8=EC=9A=B0=EA=B8=B0?= =?UTF-8?q?=20=EB=A1=9C=EA=B7=B8=EC=97=90=20=EA=B7=B8=EB=8C=80=EB=A1=9C=20?= =?UTF-8?q?=EB=82=A8=EC=95=84=20=EC=9E=88=EC=97=88=EC=9D=8C(=EB=B0=B0?= =?UTF-8?q?=ED=8F=AC=20=EC=A0=84:=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20?= =?UTF-8?q?=EC=9E=AC=EB=B9=8C=EB=93=9C+=EC=95=B1=20=EC=9E=AC=EB=B0=B0?= =?UTF-8?q?=ED=8F=AC=20=ED=95=84=EC=9A=94)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 5.5 --- wol-gate/server.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wol-gate/server.js b/wol-gate/server.js index 107fb00..69253c7 100644 --- a/wol-gate/server.js +++ b/wol-gate/server.js @@ -238,7 +238,12 @@ function describeRequester(req) { const ip = extractClientIp(req) || '-'; const ua = req.headers['user-agent'] || '-'; const host = req.headers['host'] || '-'; - return `${ip} "${req.method} ${host}${req.url}" UA="${ua}"`; + return `${ip} "${req.method} ${host}${maskSecrets(req.url)}" UA="${ua}"`; +} + +// 로그에 인증 토큰이 그대로 남지 않게 쿼리의 token·key·secret·password 류 값을 가린다 +function maskSecrets(url) { + return String(url || '').replace(/([?&](?:token|access_token|auth|auth_token|api_key|apikey|key|secret|password|pw|sid|session)=)[^&#\s]*/gi, '$1***'); } function maybeWake(req) {