Skip to content

Commit 4019e25

Browse files
committed
add warning logs for unauthorized proxy IP access
1 parent ba470a9 commit 4019e25

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

web/server.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ app.use(async (req, res, next) => {
6969
if (containsCidr(config.management.trustedProxies, req.ip)) {
7070
ip = req.headers['x-forwarded-for'] || req.ip;
7171
} else {
72+
console.warn("Proxy IP not in list");
7273
return res.sendStatus(403);
7374
}
7475
} else if ("cf-connecting-ip" in req.headers){
@@ -82,6 +83,7 @@ app.use(async (req, res, next) => {
8283
if (containsCidr([...cfcidrList.result.ipv4_cidrs, ...cfcidrList.result.ipv6_cidrs], req.ip)) {
8384
ip = req.headers['cf-connecting-ip'] || req.ip;
8485
} else {
86+
console.warn("CF IP not in list");
8587
return res.sendStatus(403);
8688
}
8789
} else {

0 commit comments

Comments
 (0)