As a Cybersecurity Analyst, utilizing Python to parse data and automate tasks are necessary skills to have in regard to network log analysis. In many cases, a Cybersecurity Analyst will need access to a variety of files. In this simple script, I have written an algorithm that retrieves, opens, reads, and writes to files that contain a list of IP addresses. This script will:
- Retrieve files
- Open and read files
- Clean data from files
- Convert string data into list data in order to loop through IP address lists and determine which IP addresses are allowed into the network
- Convert list data back into string data
- Updating the original file with the new list of allowable IP addresses.