Skip to content

About

generates a plain text IP Address blacklist using abuseipdb api

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

AbuseIPDB Blacklist Generator

A Python script that queries the AbuseIPDB v2 API to generate a firewall-ready IP address blacklist. Supports plain-text and JSON output, country filtering, and confidence score thresholds.


Features

  • Fetches a plain-text or JSON IP blacklist from AbuseIPDB
  • Configurable IP limit (up to your subscription tier's hard cap)
  • Subscriber options: filter by country (onlyCountries / exceptCountries) and confidence score (confidenceMinimum)
  • API key managed securely via .env file (never hardcoded)
  • Graceful degradation — if your limit exceeds your subscription cap, the list is silently truncated with no error thrown

Skills Demonstrated

  • REST API integration using the requests library
  • Secure credential management with python-dotenv
  • Query parameter construction for flexible, configurable API calls
  • Understanding of HTTP response formats (text/plain vs application/json)
  • GRC-aligned design: built with audit trails, tiered risk tolerance, and firewall pipeline ingestion in mind
  • Awareness of API rate limiting, subscription tiers, and graceful degradation behavior

Requirements

requests
python-dotenv

Install with:

pip install requests python-dotenv

Setup

  1. Clone the repository
git clone https://github.com/aarondutton-grc/abuseipdb-blacklist-generator.git
cd abuseipdb-blacklist-generator
  1. Install dependencies
pip install requests python-dotenv
  1. Create a .env file in the project root:
ABUSEIPDB_API_KEY=your_api_key_here

Register for a free API key at abuseipdb.com/register.
Manage your keys at abuseipdb.com/account/api/keys.

  1. Run the script
python abuseipdb_blacklist.py

Configuration

Edit the querystring and headers dictionaries in the script to customize behavior.

Query Parameters

Parameter Default Tier Required Description
limit 10000 Free Max number of IPs to return. Hard-capped by subscription.
confidenceMinimum 100 Subscriber Minimum abuse confidence score (range: 25–100). Lower values increase coverage but may include false positives.
onlyCountries (disabled) Subscriber Return IPs only from specified countries. Comma-delimited ISO 3166 alpha-2 codes (e.g. 'US,MX,CA').
exceptCountries (disabled) Subscriber Return all IPs except those from specified countries. Same format as above.

Output Format

Accept Header Output Use Case
text/plain Newline-delimited IP list Direct firewall / SIEM ingestion
application/json Structured JSON with metadata per IP Logging, auditing, downstream processing

Subscription Tiers & Limits

Tier Blacklist Downloads/Day IP Hard Cap
Free 5 10,000
Basic — 100,000
Premium — 500,000
  • If your limit value exceeds your tier's cap, the list is silently truncated — no error is thrown.
  • HTTP 429 Too Many Requests = daily download limit reached.
  • Check current usage: abuseipdb.com/account/api/usage

GRC / Security Ops Use Cases

Firewall blocklist
Plain-text output feeds directly into most firewall and SIEM ingestion pipelines with no transformation required.

Regional threat blocking
Combine onlyCountries + confidenceMinimum to build a targeted blocklist aligned to your org's threat model. For example, an organization with no international user base can block all foreign high-confidence IPs in a single API call.

Audit trail
Switch to JSON output to capture per-IP metadata (confidence score, country, last reported date). This supports evidence collection for SOC 2, HIPAA, or internal security reviews.

Tiered confidence tuning
Adjust confidenceMinimum based on risk tolerance:

  • 100 → High precision: fewer blocks, minimal false positives
  • 75–90 → Broader coverage: more blocks, periodic review recommended

Security Notes

  • AbuseIPDB support will never ask for your API key or account password. They may ask for your user ID or email in support tickets.
  • Download your API request logs (CSV format, gzipped if large) at: abuseipdb.com/account/api/logs
  • Never commit your .env file. Add it to .gitignore:
.env

License

MIT — see LICENSE for details.


Author

Aaron Dutton
GitHub · LinkedIn

About

generates a plain text IP Address blacklist using abuseipdb api

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages