geoip-attack-map: Cyber security geoip attack map
Cyber Security GeoIP Attack Map Visualization
This geoip attack map visualizer was developed to display network attacks on your organization in real time. The data server follows a syslog file, and parses out source IP, destination IP, source port, and destination port. Protocols are determined via common ports, and the visualizations vary in color based on protocol type. CLICK HERE for a demo video. This project would not be possible if it weren’t for Sam Cappella, who created a cyber defense competition network traffic visualizer for the 2015 Palmetto Cyber Defense Competition. I mainly used his code as a reference, but I did borrow a few functions while creating the display server, and visual aspects of the webapp. I would also like to give special thanks to Dylan Madisetti as well for giving me advice about certain aspects of my implementation.
Important
This program relies entirely on syslog, and because all appliances format logs differently, you will need to customize the log parsing function(s). If your organization uses a security information and event management system (SIEM), it can probably normalize logs to save you a ton of time writing regex.
- Send all syslog to SIEM.
- Use SIEM to normalize logs.
- Send normalized logs to the box (any Linux machine running syslog-ng will work) running this software so the data server can parse them.
Configs
- Make sure in /etc/redis/redis.conf to change bind 127.0.0.1 to bind 0.0.0.0 if you plan on running the DataServer on a different machine than the AttackMapServer.
- Make sure that the WebSocket address in /AttackMapServer/index.html points back to the IP address of the AttackMapServer so the browser knows the address of the WebSocket.
- Download the MaxMind GeoLite2 database, and change the db_path variable in DataServer.py to the wherever you store the database.
- ./db-dl.sh
- Add headquarters latitude/longitude to hqLatLng variable in index.html
- Use syslog-gen.py, or syslog-gen.sh to simulate dummy traffic “out of the box.”
- IMPORTANT: Remember, this code will only run correctly in a production environment after personalizing the parsing functions. The default parsing function is only written to parse ./syslog-gen.sh traffic.
Deploy example
Tested on Ubuntu 16.04 LTS.
- Clone the application:
- Install system dependencies:
- Install python requirements:
- Start Redis Server:
- Configure the Data Server DB:
- Start the Data Server:
- Start the Syslog Gen Script, inside DataServer directory:
- Open a new terminal tab (Ctrl+Shift+T, on Ubuntu).
- Configure the Attack Map Server, extract the flags to the right place:
- Open a new terminal tab (Ctrl+Shift+T, on Ubuntu).
- Start the Attack Map Server:
- Access the Attack Map Server from browser:
- http://localhost:8888/ or http://127.0.0.1:8888/
- To access via browser on another computer, use the external IP of the machine running the AttackMapServer.
- Edit the IP Address in the file “/static/map.js” at “AttackMapServer” directory. From:
To, for example:
Restart the Attack Map Server:
On the other computer, points the browser to: