Skip to content

Commit

Permalink
Feat: get ASN data from MaxMind GeoLite2 ASN CSV instead of ripe.net
Browse files Browse the repository at this point in the history
  • Loading branch information
Loyalsoldier committed Aug 9, 2024
1 parent cdc2a64 commit f3030d6
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 38 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,9 @@ jobs:
echo "RELEASE_NAME=$(date +%Y%m%d%H%M)" >> $GITHUB_ENV
shell: bash

- name: Fetch lists from ripe.net
run: |
chmod +x asn.sh
./asn.sh
- name: Append more CIDRs
run: |
mkdir -p data
curl -sSL https://www.gstatic.com/ipranges/goog.json | jq --raw-output '.prefixes[].ipv4Prefix,.prefixes[].ipv6Prefix | select(. != null)' >> data/google
curl -sSL https://www.gstatic.com/ipranges/cloud.json | jq --raw-output '.prefixes[].ipv4Prefix,.prefixes[].ipv6Prefix | select(. != null)' >> data/google
curl -sSL https://api.fastly.com/public-ip-list | jq --raw-output '.addresses[],.ipv6_addresses[]' >> data/fastly
Expand All @@ -50,9 +46,11 @@ jobs:
LICENSE_KEY: ${{ secrets.MAXMIND_GEOLITE2_LICENSE }}
run: |
curl -L "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-Country-CSV&license_key=${LICENSE_KEY}&suffix=zip" -o GeoLite2-Country-CSV.zip
unzip GeoLite2-Country-CSV.zip
rm -f GeoLite2-Country-CSV.zip
mv GeoLite2* geolite2
curl -L "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-ASN-CSV&license_key=${LICENSE_KEY}&suffix=zip" -o GeoLite2-ASN-CSV.zip
mkdir -p geolite2
unzip *.zip
cp GeoLite2-Country-CSV_*/*.csv geolite2/
cp GeoLite2-ASN-CSV_*/*.csv geolite2/
- name: Build geoip files
run: |
Expand Down
7 changes: 0 additions & 7 deletions asn.csv

This file was deleted.

23 changes: 0 additions & 23 deletions asn.sh

This file was deleted.

59 changes: 59 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,65 @@
"inputDir": "./data"
}
},
{
"type": "maxmindGeoLite2ASNCSV",
"action": "add",
"args": {
"ipv4": "./geolite2/GeoLite2-ASN-Blocks-IPv4.csv",
"ipv6": "./geolite2/GeoLite2-ASN-Blocks-IPv6.csv",
"wantedList": {
"cloudflare": [
"AS395747",
"AS394536",
"AS209242",
"AS203898",
"AS202623",
"AS14789",
"AS139242",
"AS133877",
"AS13335",
"AS132892"
],
"facebook": ["AS63293", "AS54115", "AS32934"],
"fastly": ["AS54113", "AS394192"],
"google": [
"AS6432",
"AS55023",
"AS45566",
"AS43515",
"AS41264",
"AS40873",
"AS396982",
"AS395973",
"AS394699",
"AS394639",
"AS394507",
"AS36987",
"AS36492",
"AS36385",
"AS36384",
"AS36040",
"AS36039",
"AS26910",
"AS26684",
"AS22859",
"AS22577",
"AS19527",
"AS19448",
"AS19425",
"AS16591",
"AS16550",
"AS15169",
"AS13949",
"AS139190",
"AS139070"
],
"netflix": ["AS55095", "AS40027", "AS394406", "AS2906"],
"telegram": ["AS62041", "AS62014", "AS59930", "AS44907", "AS211157"],
"twitter": ["AS8945", "AS63179", "AS54888", "AS35995", "AS13414"]
}
}
},
{
"type": "private",
"action": "add"
Expand Down

0 comments on commit f3030d6

Please sign in to comment.