This is a script to import Snort's Sample IP Blocklist into a Tag (Host Group) within Stealthwatch Enterprise. This will also optionally create a Custom Security Event (CSE) to alert on traffic to the blocklisted IPs.
You can find more information on Stealthwatch's APIs on Cisco DevNet.
The config.json file contains the following variables:
cp config.example.json config.json
pip install -r requirements.txt
python snort_blocklist_importer.py
If you didn't manually enter configuration data, you'll get prompted for the Stealthwatch IP/FQDN, Username, and Password. The script will store these credentials in the config.json file for future use. This means you probably want to make the config.json file read-only. You probably will also want to create unique credentials for scripting/API purposes.
The script will automatically try to determine your Stealthwatch Tenant ID, and store that in the config.json file as well.
By default, the script will cache downloaded blocklist data from Snort for one hour to prevent creating too many requests. (You'll get greylisted if you make too many requests for the URL)
This script is Docker friendly, and can be deployed as a container.
To build the container, run the script once to populate the config.json file, or manually populate the configuration variables.
Once the config.json file is populated, run the following command to build the container:
docker build -t snort-blocklist-importer .
You can then run the container as a daemon with the following command:
docker run -d --name snort-blocklist-importer snort-blocklist-importer
Owner
Contributors
Categories
Programming Languages
PythonLicense
Code Exchange Community
Get help, share code, and collaborate with other developers in the Code Exchange community.View Community