mirror of
https://github.com/buildplan/du_setup.git
synced 2026-04-26 10:35:51 +03:00
[GH-ISSUE #76] Fail2Ban Whitelist Step #1
Labels
No labels
bug
enhancement
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/du_setup#1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Kuuchuu on GitHub (Nov 16, 2025).
Original GitHub issue: https://github.com/buildplan/du_setup/issues/76
Fail2Ban was banning my IP address after the post-du_setup reboot, likely due to some automation I had set up before my server rebuild. A step to whitelist IPs (or suggest whitelisting your current connection) might be nice. I can submit a PR later if desired.
@buildplan commented on GitHub (Nov 16, 2025):
Good idea. I think it happened with me once in testing just checked my notes and I had thought of sorting this but of course forgot. You're more than welcome to PR.
Thanks.
@buildplan commented on GitHub (Nov 16, 2025):
Actually maybe it would be good to add tailscale or any other ip address in white list and give user an option to whitelist what they want... what you think?
@buildplan commented on GitHub (Nov 17, 2025):
I had a little bit of free time today so added this configurable ignoreip functionality for configure_fail2ban function. I will test it before I merge but if you want check the code and test it. thanks.
@buildplan commented on GitHub (Nov 17, 2025):
After testing v0.77 and confirming it all works - now user can add ignoreip and it also shows a little help on how to add more later. hope this will work for you.
@Kuuchuu commented on GitHub (Nov 17, 2025):
Just finished my version. Made most of it last night, was going to send my PR but my computer decided to freeze so I called it a night. Didn't see you pushed your version until now.
Here is my branch with the whitelist functionality if you are interested: https://github.com/Kuuchuu/du_setup/tree/fail2ban-whitelist
I added a very simple but fully functional IP validator, the whitelisting functionality, and another function to append new IPs (Tailscale) to the ignoreip list.
EDIT: Added support for CIDR notation after seeing yours. Also, IP validation method I am using that I found somewhere on Stack *Exchange should be very reliable in rejecting syntactically invalid inputs:
EDIT 2: I don't personally use Tailscale, so I am unsure if I am adding the correct IP address with my
fail2ban_append_ignoreip "$TS_IPV4"function call in theinstall_tailscalefunction@buildplan commented on GitHub (Nov 18, 2025):
Thanks a lot for taking time to do this. I should have waited for you to do it. I think we could create a hybrid approach maybe...
I like that your implementation automatically offers to whitelist the IP you're connecting from - very user-friendly.
but some of the things are little complex maybe dependency on ip command may fail in restricted environments.
Would you mid creating a new PR based on latest version to do somehing like ...
Would it be ok? I am not sure how to merge this one so a new issue and a new PR would be great if you get some time to do it.
Thanks again.
Edit: I wouldnt worry about tailscale I think by giving user an option to add the ip ranges they can choose to add tailscale ip ranges....