Skip to content

Commit 09d03ee

Browse files
committed
feat(security): ajouter scan des ports, Sudoers, version dynamique et automatisation Cron
1 parent 3e89564 commit 09d03ee

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

Vagrantfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,7 @@ Vagrant.configure("2") do |config|
66
apt-get install -y python3 python3-pip nano tree
77
chmod +x /vagrant/lsit.py
88
ln -s /vagrant/lsit.py /usr/local/bin/lsit
9+
# Création de la tâche planifiée (Tous les jours à minuit, en format JSON)
10+
echo "0 0 * * * root /usr/local/bin/lsit --format json" > /etc/cron.d/lsit_audit
911
SHELL
1012
end

lsit.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,25 @@
22
import subprocess
33
import argparse
44
import json
5+
import os
56
from datetime import datetime
67

8+
dossier_script = os.path.dirname(os.path.realpath(__file__))
9+
chemin_changelog = os.path.join(dossier_script, "CHANGELOG.md")
10+
11+
version_lsit = "LSIT (version inconnue)"
12+
try:
13+
with open(chemin_changelog, "r", encoding="utf-8") as f:
14+
for ligne in f:
15+
if ligne.startswith("## v"):
16+
version_brute = ligne.replace("##", "").strip()
17+
version_lsit = f"LSIT {version_brute}"
18+
break
19+
except FileNotFoundError:
20+
pass
21+
722
parser = argparse.ArgumentParser(description="LSIT - Linux System Inventory Tool : Cartographie l'infrastructure locale.")
8-
parser.add_argument("-v", "--version", action="version", version="LSIT v1.0")
23+
parser.add_argument("-v", "--version", action="version", version=version_lsit)
924
parser.add_argument("--format", choices=["txt", "json"], default="txt", help="Format de sortie du rapport")
1025
args = parser.parse_args()
1126

0 commit comments

Comments
 (0)