feat: auto-whitelist SSH IP in Fail2Ban and deduplicate entries#79
feat: auto-whitelist SSH IP in Fail2Ban and deduplicate entries#79buildplan merged 6 commits intobuildplan:mainfrom
Conversation
|
If you would like, I can update the version number (77.1?) and sha256 as well. |
|
I will spin up 2 VMs Detain and Ubuntu to test everything is ok and then I will merge. Is that ok? |
|
FYI - A quick test shows this ... script exited after I added list of ip addresses to ignore. Whitelist your current IP (xxxxxxxx) in Fail2Ban? [y/N]: y
✓ Added your current IP to whitelist.
Add additional IP addresses or CIDR ranges to Fail2Ban ignore list (e.g., Tailscale)? [y/N]: y
Enter IP addresses or CIDR ranges to whitelist, separated by spaces.
Examples:
Single IP: 192.168.1.100
CIDR Range: 10.0.0.0/8
IPv6 Address: 2606:4700::1111
> fe80::/10 172.80.0.0/16 172.16.0.0/12 10.0.0.0/8 100.64.0.0/10 fd7a:115c:a1e0::/48
./du_setup.sh: line 3712: seen[$ip]: unbound variable |
|
Forgot to test with |
|
Sorry for the wait. Should be good now to do a full test. |
|
Thanks for doing this. Edit: Updated checksum. |
|
After looking into it a bit I found the checksums did not match due to a difference in line endings. I was editing on Windows and vscode at some point threw in CRLF line terminators onto every line. I'm guessing when you checked the file it had been converted back to unix line endings. EDIT: Looks like git was the real culprit: It converted the line endings on push locally, then I generated the checksum after it touched it. Never again shall it mistouch my files. |
|
I just tested this on a DigitalOcean VPS and worked perfectly. Going to check on a Ubuntu as well just to be sure everything is ok. I updated the checksum already by the way in your repo. Edit: I haven't used Windows for quite sometime but on Linux I just double checked the script file and it seems fine. but if you need to push any change go ahead. If you have any issues I can generate checksum locally and push it again. I have your repo checked out. |
|
No push should be needed, the repo does have the right line endings. Should be ready to go! |
|
Worked perfectly on Ubuntu as well. Thanks a lot for doing this. Please feel free to improve any other parts if you find time. Again thanks. |
This PR adds a prompt to auto-whitelist the user's SSH IP in Fail2Ban and adds a deduplication feature to the custom Fail2Ban whitelist.
Closes #78