From 1904a6b194b3e5fc86228c9e3c3182358f03ae58 Mon Sep 17 00:00:00 2001 From: alhassco Date: Sun, 17 Sep 2023 21:03:32 +0200 Subject: [PATCH] TP AIDE et autres IDS --- sio2/CYBER/IDS/aide | 8 ++ sio2/CYBER/IDS/aide.conf | 189 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 197 insertions(+) create mode 100755 sio2/CYBER/IDS/aide create mode 100644 sio2/CYBER/IDS/aide.conf diff --git a/sio2/CYBER/IDS/aide b/sio2/CYBER/IDS/aide new file mode 100755 index 0000000..31eb8e5 --- /dev/null +++ b/sio2/CYBER/IDS/aide @@ -0,0 +1,8 @@ +#!/bin/bash +aideinit #initialisation +/etc/cron.daily/aide # on lance aide pour vérifier +more /var/log/aide/aide.log # on affiche le compte-rendu : pas de changements +touch /etc/truc # on créée un fichier +echo "#########" >> /etc/hosts # on en modifie un autre +/etc/cron.daily/aide # on vérifie à nouveau +more /var/log/aide/aide.log # on constate les changements survenus ... diff --git a/sio2/CYBER/IDS/aide.conf b/sio2/CYBER/IDS/aide.conf new file mode 100644 index 0000000..e46c98f --- /dev/null +++ b/sio2/CYBER/IDS/aide.conf @@ -0,0 +1,189 @@ +# AIDE conf + +# set environment for executable config files included by x_include +@@x_include_setenv UPAC_settingsd /etc/aide/aide.settings.d + +# The daily cron job depends on these paths +database_in=file:/var/lib/aide/aide.db +database_out=file:/var/lib/aide/aide.db.new +database_new=file:/var/lib/aide/aide.db.new +gzip_dbout=yes + +# Set to no to disable report_summarize_changes option. +report_summarize_changes=yes + +# Set to no to disable grouping of files in report. +report_grouped=yes + +# Set verbosity of aide run and reports +log_level=warning +report_level=changed_attributes + +# Set to yes to print the checksums in the report in hex format +report_base16 = no + +# if you want to sacrifice security for speed, remove some of these +# checksums. +Checksums = sha256+sha512+haval + +# The checksums of the databases to be printed in the report +# Set to 'E' to disable. +database_attrs = Checksums + +# check permissions, owner, group and file type +OwnerMode = p+u+g+ftype + +# Check size and block count +Size = s+b + +# Files that stay static +InodeData = OwnerMode+n+i+Size+l+X +StaticFile = m+c+Checksums + +# Files that stay static but are copied to a ram disk on startup +# (causing different inode) +RamdiskData = InodeData-i + +# Check everything +Full = InodeData+StaticFile + +# Files that change their mtimes or ctimes but not their contents +VarTime = InodeData+Checksums + +# Files that are recreated regularly but do not change their contents +VarInode = VarTime-i + +# Files that change their contents during system operation +VarFile = OwnerMode+n+l+X + +# Directories that change their contents during system operation +VarDir = OwnerMode+n+i+X + +# Directories that are recreated regularly and change their contents +VarDirInode = OwnerMode+n+X + +# Directories that change their mtimes or ctimes but not their contents +VarDirTime = InodeData + +# Logs are special: they are continously written to, may be compressed +# have their file name changed in different, mutually incompatibly ways +# and apprear and vanish at will. Handling this is a a complex and error- +# prone issue. +# +# This is best broken down in a number of small tasks: +# +# +# (A) +# While a live log is being written to, it doesn't change its mode and +# inode and its size only increases. +# +# (B) +# When a live log is rotated for the first time, it should not change +# its mode, may change its inode, and its size decreases. The size +# decrease may not be noticed by aide if the file had size x at the last +# aide run, was rotated in the mean time and was written to so that it +# had a size > x at the next aide run. +# +# (C) +# When a log is compressed, this looks to aide like the uncompressed +# file vanished (or was replaced by another file) and the compressed +# file appeared out of the blue. There is (currently) no way to +# associate the (gone) uncompressed file's contents with the (new) +# compressed file's contents +# +# (D) +# The actual log rotation may rename foo.{x}.bar to foo.{x+1}.bar without +# changing the other properties of the file +# +# (E) +# If only a given number of log generations is to be kept, foo.{y}.bar may +# vanish, but usually only when no foo.{z}.bar exists for z>y. +# +# (F) +# The set of files foo.{x}.bar to foo.{y}.bar is called a "log series" +# in aide terms, with the lowest x being called the "LoSerMember" element +# and the highest y being called the "HiSerMember" element, and the z +# with x