A lightweight Python security utility designed for Security Operations Center (SOC) analysts to parse, analyze, and generate structured incident reports from Linux authentication logs (auth.log).
├── .gitignore
├── README.md
├── parser.py
├── sample_logs/
│ └── auth.log
└── output/ (created automatically when you run the script)
- Brute-Force Detection: Flags IP addresses exceeding a configurable threshold of failed authentication attempts.
- Failed Login Tracking: Analyzes targeted usernames and IP sources.
- Successful Login Auditing: Summarizes successful SSH logins (password & publickey authentication).
- Privilege Escalation Monitoring: Tracks
sudocommand executions and the users executing them. - Automatic Reporting: Formats security findings into a clean, text-based SOC summary report in
output/report.txt.
- Python 3.x installed (no external dependencies required).
To execute the parser with default settings:
python parser.pyThis will read sample_logs/auth.log and automatically create the output/ folder containing output/report.txt.
| Parameter | Description | Default |
|---|---|---|
--log |
Path to input log file | sample_logs/auth.log |
--output |
Path to save output report | output/report.txt |
--threshold |
Failed login attempt limit for brute-force alerting | 3 |
python parser.py --log sample_logs/auth.log --output output/custom_report.txt --threshold 5=== SOC Security Log Parser Report ===
Total lines read: 15
Lines matched: 15
Lines skipped: 0
Flagged IPs (3+ failed attempts):
------------------------------------------------------------
IP: 192.168.1.105 | Failed Count: 7 | Usernames tried: admin, administrator, root, test, ubuntu