Project

General

Profile

Actions

Feature #35787

closed

add IP address to "401 Unauthorized" log messages

Added by Dietrich Streifert over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Category:
REST API
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Wont fix

Description

Hi all,

I'm in need to add a fail2ban filter/jail which allows blocking of IPs trying to use the REST api unauthorized.

Currently redmine logs this attempts like this:

2021-08-20 13:18:43 +0200 (185) Completed 401 Unauthorized in 4ms (ActiveRecord: 1.5ms)

which is not sufficient for fail2ban filters, because the IP address is missing.

It would be nice to additionally display the requesting IP in that log line, e.g.:

2021-08-20 13:18:43 +0200 (185) Completed 401 Unauthorized in 4ms (ActiveRecord: 1.5ms) from 1.2.3.4

This way it would be possible to write a filter usable for fail2ban.

Actions

Also available in: Atom PDF