Is there a way to make caddy emit a log something like “authentification failed” (similar to ngnix or apache) when the user types incorrect login credentials?
What would be the synthax to catch incorrect login attempts when user enters wrong credentials when using basic auth?
Using this filter in fail2ban failregex = ^<HOST>.+\s(400|401)\s.+ is not a good idea as it bans users even without them trying to authenticate.
What would be an alternative approach to count incorrect authentication attempts?
Unfortunately, not currently. See these issues on github:
If you want to help champion this by re-implementing and testing this, it could make it in, but the people who were previously interested in this failed to help us bring it to completion.
Thanks very much Francis. Yes, sure, I’d like to help. We are currently using caddy for the staging environment and it would be a shame to make a switch back to the “classic” ngnix, etc due to a lack of this particular feature. Please tell me how can I help?
Please read the discussion in both links, then rebase or reapply the changes in the PR on the master branch, build and test, and show proof that the changes do what you were asking.