## Python for Security Automation

You don't need to be a Developer, but you must know how to Script. **Python** is the language of Security.

### Why Python?
*   **Libraries**: `requests` (HTTP), `pandas` (Data), `boto3` (AWS).
*   **Readability**: Easy to read code.
*   **APIs**: Almost every security tool has a REST API, and Python is great at talking to APIs.

### Key Concepts for SOC
1.  **JSON Parsing**: Every API returns JSON. You need to know how to dig into dictionaries within lists. `data['alerts'][0]['source_ip']`.
2.  **Requests**: `response = requests.get(url, headers=api_key)`.
3.  **Regex**: Extracting IPs from text blobs.

### Example Script Idea
*   Input: `suspicious_ips.txt`.
*   Loop: For each IP...
*   Action: Check AbuseIPDB API.
*   Logic: If confidence > 90...
*   Output: Write to `firewall_blocklist.csv`.

**Lab Tip**: In this module's lab, you will write a simple script to parse a log file. Do not fear the code; it is just logic written in text.