A dark-mode Python desktop app for defensive security-log triage. It analyzes SSH/auth logs and Apache/Nginx-style web access logs, detects suspicious behavior, scores the threat level, saves scan history, and exports clean reports.
- Dark
ttkbootstrapGUI with Dashboard, Events, Rules, History, and Report tabs. - Background analysis with progress updates, so large logs do not freeze the app.
- Dashboard cards for total events, threat level, unique IPs, top attack type, and time range.
- Embedded charts for attack types, top source IPs, and event timeline.
- Sortable and filterable event table with raw-line detail view.
- SQLite scan history that persists between app launches.
- Custom regex rules with severity, category, log type, and enabled/disabled state.
- JSON, CSV, and HTML report exports.
The analyzer includes built-in rules for:
- SSH brute-force attempts
- Invalid SSH users
- Sudo/authentication failures
- SQL injection probes
- XSS payloads
- Path traversal attempts
- Directory and sensitive-file scans
- Suspicious user agents such as scanners and scripted clients
- Repeated HTTP error activity from the same source IP
From the project folder:
cd C:\Users\Ayaa\Downloads\Security-Log-Analyzer-main\Security-Log-Analyzer-main
python -m pip install -r requirements.txtRequirements:
- Python 3.10 or newer
ttkbootstrapmatplotlib
python main.pyThe app opens in dark mode by default.
- Launch the app with
python main.py. - Click Open Log.
- Choose
sample_logs/mixed_security.log. - Click Analyze.
- Check the Dashboard tab for charts and threat score.
- Open the Events tab and try searching for
script,admin, or203.0.113. - Open the History tab to confirm the scan was saved.
- Try Export JSON, Export CSV, or Export HTML.
Run:
python -m unittestExpected result:
Ran 8 tests
OK
The tests cover parsing, built-in detections, custom rule validation, threat scoring, SQLite scan history, custom rules, and JSON/CSV/HTML export.
main.pystarts the desktop app.security_log_analyzer/analyzer.pyparses logs, applies rules, and scores risk.security_log_analyzer/ui.pycontains the dark-mode desktop interface.security_log_analyzer/models.pydefines normalized event, rule, summary, and result objects.security_log_analyzer/rules.pycontains default detection rules and rule validation.security_log_analyzer/storage.pysaves scan history and custom rules in SQLite.security_log_analyzer/exporters.pywrites JSON, CSV, and HTML reports.sample_logs/mixed_security.logprovides a demo file for manual testing.tests/contains the automated test suite.
- Scan history is stored in SQLite at
%USERPROFILE%\.security_log_analyzer\history.db. - The tool reads text-based logs and ignores undecodable characters.
- This is a local desktop app; it does not upload logs anywhere.
This tool is intended for educational and defensive cybersecurity use. Analyze only logs you are authorized to inspect.