-
-
Notifications
You must be signed in to change notification settings - Fork 254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fail2ban breaks as there is no longer a unauthorized.log
#282
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I don't think this should be auto closed, hence this reply |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I need to review this. Sorry for not getting to it sooner. I understand the issue, but I want to determine what the best fix is. |
Sorry if I'm wrong but I think you missed that the unauthorized jail has been updated to use error.log. For me fail2ban works like a charm. |
It looks like out of the box we actually have the conf shipping with: [nginx-unauthorized]
enabled = true
port = http,https
filter = nginx-unauthorized
logpath = /config/log/nginx/access.log This may make more sense to use the |
Ohh, right I seem to have looked in the wrong line. Error.log would probably make more sense but the jail works nevertheless.
|
I've just checked and 401s are logged in the access.log |
I thought that is clear since my jail has entries |
closing this as we cannot reproduce. |
Why does swag no longer log 401-s into |
401 is one of many errors that nginx can put in the access.log file. As far as f2b is concerned there's two scenarios:
There isn't a real big concern with either, but if we're separating out 401 why not also 400, 403, 405, 418, 429, or heck maybe even 404 or some of the 5xx series? I will admit 401 is probably the most common concern among the ones above, but the only benefit to separating 401 is for a human to look at the file without needing to The main reason the separation was removed from swag specifically was to align swag with our base image's nginx confs which defines access logging here All of our nginx based images use the same top level nginx.conf. A large number of those images are for apps where we suspect it's highly unlikely that the average user would bother checking logs at all, and none of them include fail2ban except swag. We also have a standalone fail2ban image that has its own confs that looks for 401 in the access.log file Technically it would be possible to use the standalone fail2ban confs in swag, we just never made it around to bringing them over officially. Anyway, I hope this context helps as to why we made the change in question. |
First of all, many thanks for this tool and all the effort everyone is putting into this!
Expected Behavior
I generally tend to update my containers often and in the case of swag I do check the logs to see which config files have changed.
With the changes to
nginx.conf
(nginx.conf.sample
) I noticed the config forunauthorized.log
has been removed.Earlier this week I was investigating an issue and noticed I still had these unauthorized log files so I removed them.
After running
fail2ban-client status
today I got an issue saying that it couldn't connect to the server. After checking the logs I noticed these 2 lines:That made me realise that this could be a problem, so I restored the following config from the history:
and it seems
fail2ban-client status
is OK again.I guess that the above config shouldn't have been taken out? As the jail is still there: https://github.com/linuxserver/docker-swag/blob/master/root/defaults/fail2ban/jail.local#L55-L59
I also had some warnings after the change (a while ago), and had restored these 2 lines to make them go away
Current Behavior
See above
Steps to Reproduce
N/A
Environment
OS: Ubuntu 22.04.1 LTS
CPU architecture: x86_64
How docker service was installed: official docker repo
Command used to create docker container (run/create/compose/screenshot)
Docker logs
The text was updated successfully, but these errors were encountered: