No entries found for ASN zone – change in data source
Posted: 29 Aug 2019, 00:41
Today I was delighted to realize that one can enter ASNs in the firewall and the respective ranges will be looked up and added. I had been looking up and adding ranges manually which is quite time consuming. But I was disappointed when it didn't work:
Looking in lfd.pl on line 5193 in the countrycode subroutine (highlighted below), the letters "AS" are prefixed to the search term.
I removed the letters "AS" and restarted CSF. Consequently, the ASNs were found and the zones were appropriately created.
Feel free to let me know if you have any other questions or concerns. Thanks for the great product!
I happened to have a copy of the GeoLite2 ASN CSV open and noticed that the ASNs are listed as digits only – no "AS" prefix.Aug 28 15:43:28 server lfd[31789]: CC: Retrieving GeoLite2 CSV ASN database [http://geolite.maxmind.com/download/geo ... SN-CSV.zip]
Aug 28 15:43:29 server lfd[31789]: CC: Processing GeoLite2 CSV Country/ASN database
Aug 28 15:43:33 server lfd[31789]: CC: Extracting zone from GeoLite2 CSV Country/ASN database for [205727]
Aug 28 15:43:33 server lfd[31789]: CC: No entries found for [205727] in /var/lib/csf/Geo/GeoLite2-ASN-Blocks-IPv4.csv
Aug 28 15:43:33 server lfd[31789]: CC: Extracting zone from GeoLite2 CSV Country/ASN database for [397086]
Aug 28 15:43:33 server lfd[31789]: CC: No entries found for [397086] in /var/lib/csf/Geo/GeoLite2-ASN-Blocks-IPv4.csv
Aug 28 15:43:33 server lfd[31789]: CC: Extracting zone from GeoLite2 CSV Country/ASN database for [46573]
Aug 28 15:43:33 server lfd[31789]: CC: No entries found for [46573] in /var/lib/csf/Geo/GeoLite2-ASN-Blocks-IPv4.csv
Aug 28 15:43:33 server lfd[31789]: CC: Extracting zone from GeoLite2 CSV Country/ASN database for [31034]
Aug 28 15:43:33 server lfd[31789]: CC: No entries found for [31034] in /var/lib/csf/Geo/GeoLite2-ASN-Blocks-IPv4.csv
Aug 28 15:43:33 server lfd[31789]: CC: Extracting zone from GeoLite2 CSV Country/ASN database for [199653]
Aug 28 15:43:33 server lfd[31789]: CC: No entries found for [199653] in /var/lib/csf/Geo/GeoLite2-ASN-Blocks-IPv4.csv
Aug 28 15:43:33 server lfd[31789]: CC: Extracting zone from GeoLite2 CSV Country/ASN database for [199883]
Aug 28 15:43:33 server lfd[31789]: CC: No entries found for [199883] in /var/lib/csf/Geo/GeoLite2-ASN-Blocks-IPv4.csv
Aug 28 15:43:33 server lfd[31789]: CC: Extracting zone from GeoLite2 CSV Country/ASN database for [TR]
Aug 28 15:43:33 server lfd[31789]: CC: Extracting zone from GeoLite2 CSV Country/ASN database for [202242]
Aug 28 15:43:33 server lfd[31789]: CC: No entries found for [202242] in /var/lib/csf/Geo/GeoLite2-ASN-Blocks-IPv4.csv
Aug 28 15:43:33 server lfd[31789]: CC: Extracting zone from GeoLite2 CSV Country/ASN database for [PA]
Aug 28 15:43:33 server lfd[31789]: CC: Extracting zone from GeoLite2 CSV Country/ASN database for [200185]
Aug 28 15:43:33 server lfd[31789]: CC: No entries found for [200185] in /var/lib/csf/Geo/GeoLite2-ASN-Blocks-IPv4.csv
Aug 28 15:43:33 server lfd[31789]: CC: Extracting zone from GeoLite2 CSV Country/ASN database for [BR]
Aug 28 15:43:33 server lfd[31789]: CC: Extracting zone from GeoLite2 CSV Country/ASN database for [30548]
Aug 28 15:43:33 server lfd[31789]: CC: No entries found for [30548] in /var/lib/csf/Geo/GeoLite2-ASN-Blocks-IPv4.csv
Aug 28 15:43:33 server lfd[31789]: CC: Extracting zone from GeoLite2 CSV Country/ASN database for [54290]
Aug 28 15:43:33 server lfd[31789]: CC: No entries found for [54290] in /var/lib/csf/Geo/GeoLite2-ASN-Blocks-IPv4.csv
Aug 28 15:43:33 server lfd[31789]: CC: Extracting zone from GeoLite2 CSV Country/ASN database for [BG]
Aug 28 15:43:34 server lfd[31790]: CCL: Retrieving GeoLite2 ASN database [http://geolite.maxmind.com/download/geo ... SN-CSV.zip]
Aug 28 15:43:34 server lfd[31790]: CCL: Retrieving GeoLite2 City database [http://geolite.maxmind.com/download/geo ... ty-CSV.zip]
Aug 28 15:43:40 server lfd[31790]: CCL: Retrieved GeoLite2 IP database
Looking in lfd.pl on line 5193 in the countrycode subroutine (highlighted below), the letters "AS" are prefixed to the search term.
Code: Select all
open ($IN, "<", "/var/lib/csf/Geo/GeoLite2-ASN-Blocks-IPv4.csv");
flock ($IN, LOCK_SH);
while (my $record = <$IN>) {
chomp $record;
$record =~ s/\"//g;
my ($range,$asn,undef) = split (/\,/,$record);
foreach my $cc (keys %cclist) {
>>line 5193 if (uc($cc) =~ /AS(\d+)/) {
if ($1 eq $asn) {
$dcidr{$cc}{$range} = 1;
}
}
}
}
I am guessing that the MaxMind GeoLite2 Country database listed ASNs with the AS prefix until sometime recently.Aug 28 16:14:25 server lfd[3305]: CC: Processing GeoLite2 CSV Country/ASN database
Aug 28 16:14:30 server lfd[3305]: CC: Extracting zone from GeoLite2 CSV Country/ASN database for [205727]
Aug 28 16:14:30 server lfd[3305]: CC: Extracting zone from GeoLite2 CSV Country/ASN database for [46573]
Aug 28 16:14:30 server lfd[3305]: CC: Extracting zone from GeoLite2 CSV Country/ASN database for [199653]
Aug 28 16:14:30 server lfd[3305]: CC: Extracting zone from GeoLite2 CSV Country/ASN database for [397086]
Aug 28 16:14:30 server lfd[3305]: CC: Extracting zone from GeoLite2 CSV Country/ASN database for [54290]
Aug 28 16:14:30 server lfd[3305]: CC: Extracting zone from GeoLite2 CSV Country/ASN database for [199883]
Aug 28 16:14:30 server lfd[3305]: CC: Extracting zone from GeoLite2 CSV Country/ASN database for [31034]
Aug 28 16:14:30 server lfd[3305]: CC: Extracting zone from GeoLite2 CSV Country/ASN database for [200185]
Aug 28 16:14:30 server lfd[3305]: CC: Extracting zone from GeoLite2 CSV Country/ASN database for [202242]
Aug 28 16:14:30 server lfd[3305]: CC: Extracting zone from GeoLite2 CSV Country/ASN database for [30548]
Feel free to let me know if you have any other questions or concerns. Thanks for the great product!