-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
33 lines (28 loc) · 815 Bytes
/
main.py
File metadata and controls
33 lines (28 loc) · 815 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from parser import parse_log_file
from detector import (
count_requests_per_ip,
detect_failed_logins,
sensitive_endpoint_access,
high_requests_volume,
detect_404,
detect_server_errors,
suspicious_methods
)
from report import generate_report
parsed_logs = parse_log_file("sample_log.txt")
ip_counts = count_requests_per_ip(parsed_logs)
failed_logins = detect_failed_logins(parsed_logs)
sensitive_access = sensitive_endpoint_access(parsed_logs)
suspicious_ips = high_requests_volume(ip_counts)
scans = detect_404(parsed_logs)
errors = detect_server_errors(parsed_logs)
suspicious = suspicious_methods(parsed_logs)
generate_report(
ip_counts,
failed_logins,
sensitive_access,
suspicious_ips,
scans,
errors,
suspicious
)