English
Purpose
The Daily AbuseIP Collector is a .NET 9.0 console application designed to run as a background service within a Docker container. Its primary purpose is to automatically fetch, filter, and store a list of abusive IP addresses from a public blocklist into a MongoDB database. This ensures that you have an up-to-date local copy of potentially malicious IP addresses for analysis or blocking purposes.
How It Works
- Data Fetching: Every 24 hours, the application connects to the borestad/blocklist-abuseipdb repository and downloads the
abuseipdb-s100-1d.ipv4list. - Data Cleaning: It parses the downloaded content, filtering out comments and extracting valid IPv4 addresses.
- Database Update:
- It connects to a local MongoDB instance.
- It clears the existing
AbuseIPDB_DailyInfocollection to remove old data. - It inserts the newly fetched IP addresses along with a
lastUpdatedtimestamp.
- Cycle: The process repeats indefinitely with a 1-day interval.
Prerequisites
- Docker
- Docker Compose
Installation & Usage
- Clone this repository.
- Navigate to the project root directory.
- Run the following command to start both the application and the MongoDB database:
docker-compose up -d --build - The application will start fetching data immediately and then sleep for 24 hours.
Configuration
- Database Credentials: The application is configured to connect to MongoDB with the username
adminand passwordStrong_Password_1881. These credentials are synchronized between the application and the MongoDB Docker container viadocker-compose.yml.
Türkçe
Amaç
Daily AbuseIP Collector (Günlük AbuseIP Toplayıcı), bir Docker konteyneri içinde arka plan servisi olarak çalışmak üzere tasarlanmış bir .NET 9.0 konsol uygulamasıdır. Temel amacı, halka açık bir kara listeden (blocklist) zararlı IP adreslerini otomatik olarak çekmek, filtrelemek ve bir MongoDB veritabanında saklamaktır. Bu sayede, analiz veya engelleme işlemleri için potansiyel olarak kötü niyetli IP adreslerinin güncel bir yerel kopyasına sahip olursunuz.
Nasıl Çalışır?
- Veri Çekme: Uygulama her 24 saatte bir borestad/blocklist-abuseipdb deposuna bağlanır ve
abuseipdb-s100-1d.ipv4listesini indirir. - Veri Temizleme: İndirilen içeriği ayrıştırır, yorum satırlarını filtreler ve geçerli IPv4 adreslerini ayıklar.
- Veritabanı Güncelleme:
- Yerel bir MongoDB örneğine bağlanır.
- Eski verileri kaldırmak için mevcut
AbuseIPDB_DailyInfokoleksiyonunu temizler. - Yeni çekilen IP adreslerini
lastUpdated(son güncelleme) zaman damgasıyla birlikte veritabanına ekler.
- Döngü: Bu işlem 1 günlük aralıklarla süresiz olarak tekrarlanır.
Gereksinimler
- Docker
- Docker Compose
Kurulum ve Kullanım
- Bu depoyu klonlayın.
- Proje ana dizinine gidin.
- Hem uygulamayı hem de MongoDB veritabanını başlatmak için aşağıdaki komutu çalıştırın:
docker-compose up -d --build - Uygulama hemen veri çekmeye başlayacak ve ardından 24 saat boyunca uyku moduna geçecektir.
Yapılandırma
- Veritabanı Kimlik Bilgileri: Uygulama, MongoDB'ye
adminkullanıcı adı veStrong_Password_1881şifresi ile bağlanacak şekilde yapılandırılmıştır. Bu kimlik bilgileri,docker-compose.ymldosyası aracılığıyla uygulama ve MongoDB Docker konteyneri arasında senkronize edilmiştir.