Clark's Home page

Tecnicismi vari di un Sysadmin Linux ma anche qualcosa della sua vita

Tripwire —

Tripwire è un IDS o meglio un HIDS (host-based intrusion detection system) che sostanzialmente raccoglie in suo DataBase i dettagli su filesystem e configurazione  dell’host su cui è installato per fare riferimento e convalidare lo stato corrente del sistema. Se vengono trovate modifiche tra lo stato noto e lo stato corrente, potrebbe essere un segno che la sicurezza è stata compromessa.
Durante l’installazione viene chiesto di inserire 2 chiavi:
chiave del sito: questa chiave viene utilizzata per proteggere i file di configurazione. Dobbiamo assicurarci che i file di configurazione non vengano modificati, altrimenti il nostro intero sistema di rilevamento non può essere considerato affidabile. Poiché gli stessi file di configurazione possono essere utilizzati per più server, questa chiave può essere utilizzata su tutti i server.
chiave locale: questa chiave viene utilizzata su ogni macchina per eseguire i file binari. Questo è necessario per garantire che i nostri file binari non vengano eseguiti senza il nostro consenso.
Dato che durante l’installazione lui genera il suo DB sulla scorta del suo file di configurazione nativo che contiene molti controlli che sono da evitare, nella directory /etc/tripwire editiamo il file twpol.txt e commentiamo queste voci:
# /etc/rc.boot -> $(SEC_BIN) ;
# /root/mail -> $(SEC_CONFIG) ;
# /root/Mail -> $(SEC_CONFIG) ;
# /root/.xsession-errors -> $(SEC_CONFIG) ;
# /root/.xauth -> $(SEC_CONFIG) ;
# /root/.tcshrc -> $(SEC_CONFIG) ;
# /root/.sawfish -> $(SEC_CONFIG) ;
# /root/.pinerc -> $(SEC_CONFIG) ;
# /root/.mc -> $(SEC_CONFIG) ;
# /root/.gnome_private -> $(SEC_CONFIG) ;
# /root/.gnome-desktop -> $(SEC_CONFIG) ;
# /root/.gnome -> $(SEC_CONFIG) ;
# /root/.esd_auth -> $(SEC_CONFIG) ;
# /root/.elm -> $(SEC_CONFIG) ;
# /root/.cshrc -> $(SEC_CONFIG) ;
# /root/.bash_profile -> $(SEC_CONFIG) ;
# /root/.bash_logout -> $(SEC_CONFIG) ;
# /root/.amandahosts -> $(SEC_CONFIG) ;
# /root/.addressbook.lu -> $(SEC_CONFIG) ;
# /root/.addressbook -> $(SEC_CONFIG) ;
# /root/.Xresources -> $(SEC_CONFIG) ;
# /root/.Xauthority -> $(SEC_CONFIG) -i ; # Changes Inode number on login
# /root/.ICEauthority -> $(SEC_CONFIG) ;

# /proc -> $(Device) ;

Quindi aggiorniamo il file di lettura per ricreare il DB con questo comando:

#twadmin -m P /etc/tripwire/twpol.txt ci chiederà la site passphrase

e successivamente ricostruiamo il DB con:
#tripwire –(sono 2 -)init
e qui ci chiederà a local passphrase.
controlliamo che tutto sia a posto con un:

# tripwire –(sono 2 -)check
Parsing policy file: /etc/tripwire/tw.pol
*** Processing Unix File System ***
Performing integrity check…
The object: “/dev/pts” is on a different file system…ignoring.
Wrote report file: /var/lib/tripwire/report/sangiorgio-20181016-121022.twr

Open Source Tripwire(R) 2.4.2.2 Integrity Check Report

Report generated by: root
Report created on: mar 16 ott 2018 12:10:22 CEST
Database last updated on: Never

===============================================================================
Report Summary:
===============================================================================

Host name: sangiorgio
Host IP address: 213.215.236.130
Host ID: None
Policy file used: /etc/tripwire/tw.pol
Configuration file used: /etc/tripwire/tw.cfg
Database file used: /var/lib/tripwire/sangiorgio.twd
Command line used: tripwire –check

===============================================================================
Rule Summary:
===============================================================================

——————————————————————————-
Section: Unix File System
——————————————————————————-

Rule Name Severity Level Added Removed Modified
——— ————– —– ——- ——–
Other binaries 66 0 0 0
Tripwire Binaries 100 0 0 0
Other libraries 66 0 0 0
Root file-system executables 100 0 0 0
Tripwire Data Files 100 0 0 0
System boot changes 100 0 0 0
Root file-system libraries 100 0 0 0
(/lib)
Critical system boot files 100 0 0 0
Other configuration files 66 0 0 0
(/etc)
Boot Scripts 100 0 0 0
Security Control 66 0 0 0
Root config files 100 0 0 0
Devices & Kernel information 100 0 0 0
(/dev)
Invariant Directories 66 0 0 0

Total objects scanned: 17548
Total violations found: 0

===============================================================================
Object Summary:
===============================================================================

——————————————————————————-
# Section: Unix File System
——————————————————————————-

No violations.

===============================================================================
Error Report:
===============================================================================

No Errors

——————————————————————————-
*** End of report ***

Open Source Tripwire 2.4 Portions copyright 2000 Tripwire, Inc. Tripwire is a registered
trademark of Tripwire, Inc. This software comes with ABSOLUTELY NO WARRANTY;
for details use –version. This is free software which may be redistributed
or modified only under certain conditions; see COPYING for details.
All rights reserved.
Integrity check complete.
e da questo momento in poi tripwire controllerà che non ci siano variazioni.

 


Categorised as: IDS | Linux | Networking | Work

Comments are disabled on this post


Comments are closed.


Hide picture