Discover Centmin Mod today
Register Now

Beta Branch update censys block IP range list in 123.09beta01

Discussion in 'Centmin Mod Github Commits' started by eva2000, Nov 24, 2019.

  1. eva2000

    eva2000 Administrator Staff Member

    59,284
    12,509
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,141
    Local Time:
    1:55 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    update censys block IP range list in 123.09beta01

    For fresh installs only. For existing installs, you can manually add the IP ranges to CSF Firewall deny block list via commands
    Code (Text):
    csf -d 198.108.66.0/23 censys
    csf -d 198.108.204.216/29 censys


    Continue reading...


    123.09beta01 branch
     
  2. MaximilianKohler

    MaximilianKohler Member

    216
    9
    18
    Jun 23, 2023
    Ratings:
    +39
    Local Time:
    8:55 PM
    I was watching this video again https://www.youtube.com/watch?t=1214&v=hcmxz0w7Td8 and I noticed there are a bunch of censys IPs in the /etc/csf/csf.deny file. However, I installed centmin mod a mere few months ago, and looking in that file I don't see that list of blocked IPs. All I see are a bunch of:
    Code:
    (sshd) Failed SSH login from IP (CN/China/-): 5 in the last 3600 secs
    5 distributed sshd attacks on account [ubuntu] in the last 3600 secs
     
  3. eva2000

    eva2000 Administrator Staff Member

    59,284
    12,509
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,141
    Local Time:
    1:55 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    Yeah unfortunately CSF Firewall needs to set limits of number of IPs you can block permanently or temporarily for memory and system resource usage reasons. So older entries do get removed eventually. If you have the resources you can set the limits higher in /etc/csf/csf.conf and restart CSF Firewall = csf -ra command

    Centmin Mod also conditionally sets limits based on detected resource usage too - but done conservatively
    Code (Text):
    egrep '^DENY_IP_LIMIT|^DENY_TEMP_IP_LIMIT' /etc/csf/csf.conf
    

    example checking limits on my dedicated server I set them higher
    Code (Text):
    egrep '^DENY_IP_LIMIT|^DENY_TEMP_IP_LIMIT' /etc/csf/csf.conf
    DENY_IP_LIMIT = "60000"
    DENY_TEMP_IP_LIMIT = "80000"
    


    Thanks for reminder that I should have another look at this routine :)
     
  4. MaximilianKohler

    MaximilianKohler Member

    216
    9
    18
    Jun 23, 2023
    Ratings:
    +39
    Local Time:
    8:55 PM
    I'm not sure the importance of having some IPs (censys) permanently blocked, nor what limit my server could handle without issue. It sounds like there's already a permanent block list and a temporary one. I guess the censys IPs aren't important enough to be permanently blocked?

    It looks like the default of 1500 only lasts ~2 weeks.
     
  5. eva2000

    eva2000 Administrator Staff Member

    59,284
    12,509
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,141
    Local Time:
    1:55 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    Permanent blocks still end up in /etc/csf/csf.deny and need purging once reaching the preset limits in above variables. I'm going to write a tool to run as a cronjob which can check how many IPs in /etc/csf/csf.deny and when it gets close to preset limits in above variables, re-run a script to re-apply these CSF Firewall IP bans again - so as to keep them in CSF Firewall deny.
     
  6. eva2000

    eva2000 Administrator Staff Member

    59,284
    12,509
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,141
    Local Time:
    1:55 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+