Implement a systemd timer and Python script to periodically detect and automatically block malicious IP addresses based on risk scores, improving the application's security posture. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 7a657272-55ba-4a79-9a2e-f1ed9bc7a528 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 05ab2f73-e195-4de9-a183-cd4729713b92 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/449cf7c4-c97a-45ae-8234-e5c5b8d6a84f/7a657272-55ba-4a79-9a2e-f1ed9bc7a528/31VdIyL
21 lines
457 B
SYSTEMD
21 lines
457 B
SYSTEMD
[Unit]
|
|
Description=IDS Auto-Blocking Timer - Run every 5 minutes
|
|
Documentation=https://github.com/yourusername/ids
|
|
Requires=ids-auto-block.service
|
|
|
|
[Timer]
|
|
# Esegui 2 minuti dopo boot (per dare tempo a ML backend di avviarsi)
|
|
OnBootSec=2min
|
|
|
|
# Poi esegui ogni 5 minuti
|
|
OnUnitActiveSec=5min
|
|
|
|
# Precisione: ±1 secondo
|
|
AccuracySec=1s
|
|
|
|
# Esegui subito se il sistema era spento durante l'esecuzione programmata
|
|
Persistent=true
|
|
|
|
[Install]
|
|
WantedBy=timers.target
|