Skip to content
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

Whitelisting IP address #72

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Whitelisting IP address #72

wants to merge 3 commits into from

Conversation

drzraf
Copy link
Contributor

@drzraf drzraf commented Mar 22, 2018

In the hope to finally close #16, #38 and #69

@PaulGuijt
Copy link

When e.g. blocklist.de has blacklisted an IP, it is not a good idea to disregard that locally.
If it is falsely blacklisted, that blacklisting should be corrected at blocklist.

@drzraf
Copy link
Contributor Author

drzraf commented Apr 2, 2018 via email

@trick77
Copy link
Owner

trick77 commented Apr 2, 2018

@drzraf I get the need for whitelisting but your proposal won't work in most cases. For example if your public IP address you want to whitelist is 1.2.3.4 and a blacklist submits 1.2.2.0/23, your IP address will still be blacklisted. This can't be regex matched. We would have to calculate CIDR ranges or deaggregate every IP range in order to make this work - which is a rather long and CPU intense operation.

@drzraf
Copy link
Contributor Author

drzraf commented Apr 2, 2018 via email

@drzraf
Copy link
Contributor Author

drzraf commented Feb 12, 2019

Since iprange has been merge, I think whitelisting can now be reconsidered.

@nenominal
Copy link

nenominal commented Jan 29, 2020

Hi @drzraf & @trick77 .
First of all, thanks guys for this script, very handy and it makes a sysadmin life a bit easy.

I'm using it and I needed to implement a white-list and I patched the master branch using the commits of @drzraf and it works pretty well.

Unfortunately from time to time I bump in some cases that @trick77 have figured out, when I have an IP that I need to whitelist but it's a part of a blacklisted CIDR.

Do you guys figured out a way to deaggregate the IP and then rebuild the larger CIDR into small ones without the IP that we want to whitelist?

@drzraf
Copy link
Contributor Author

drzraf commented Jan 30, 2020

The issue of expanding/collapsing CIDR is a pandora box.
There are some ways to deal with it, but I think none seem compatible with ipset-blacklist characteristics (simple, small footprint, one-file, bash-based script with few external dependencies)

@giannisantoua
Copy link

Hello. I use your script and I have the following two problems. First of all, how can I add apiv6 besides ipv4? When I go to crontab to do this process it sends me this error
line 35: ipset: command not found
line 41: ipset: command not found
Error: while creating the initial ipset

And the process is not complete. But if I go to the folder and run it manually it works fine.
Thanks very much

@drzraf
Copy link
Contributor Author

drzraf commented Sep 30, 2024

Could it be reconsidered?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants