stratosphereips / AIP

The Attacker IP Prioritizer(AIP) dynamically generates resource-friendly IPv4 blocklists from Zeek network flows.
https://www.stratosphereips.org
GNU General Public License v3.0
32 stars 9 forks source link

Hardcoded start on 2020 for building historical data #10

Open verovaleros opened 1 year ago

verovaleros commented 1 year ago

Describe the bug When running AIP (development branch), it starts searching and attempting to find data from 2020:

DEBUG: PROCESSING DATE 2020-07-04
2023-07-26 14:59:15,647 - aip.data.access - DEBUG - Creating attacks for dates ['2020-07-04']
2023-07-26 14:59:15,647 - aip.data.access - DEBUG - Making  dataset from raw data for dates ['2020-07-04']
2023-07-26 14:59:15,776 - root - DEBUG - Downloading data for 2020-07-04

To Reproduce Steps to reproduce the behavior:

  1. Git clone: git clone https://github.com/stratosphereips/AIP.git
  2. Docker build: 'docker build --build-arg uid=1000 --file etc/docker/Dockerfile --tag aip:latest .'
  3. Docker run: docker run -ti -v /root/AIP/:/home/aip/AIP -v /opt/zeek/logs/:/home/aip/AIP/data/raw:ro -v /root/AIP/data/:/home/aip/AIP/data/:rw --name aip aip:latest bin/aip
  4. See error: image

Looking at the code, it seems the starting date is hardcoded in the code:

https://github.com/stratosphereips/AIP/blob/a81a85b0a9ac2642b7e3f7f9fe0d4095e1ecd9a4/lib/aip/models/all.py#L43

https://github.com/stratosphereips/AIP/blob/a81a85b0a9ac2642b7e3f7f9fe0d4095e1ecd9a4/lib/aip/models/prioritize.py#L113

https://github.com/stratosphereips/AIP/blob/a81a85b0a9ac2642b7e3f7f9fe0d4095e1ecd9a4/lib/aip/utils/generate_historical_blocklists.py#L45

Expected behavior The starting date should be read from the earliest date seen on honeypots_public_ips.csv or from a parameter or variable.

verovaleros commented 1 year ago

The hardcoded date on models/prioritize.py is fixed in #23. Not closing the issue as the others remain to be fixed.