Liste des commandes pour récupérer rapidement des infos pour auditer un système


Linux

System

echo "# $(hostname -f) - $(hostname -i)"
echo "\n\n"

echo "## Release:"
lsb_release -a
echo "\n\n"

echo "## Kernel: "
uname -a
echo "\n\n"

echo "## Sysctl:"
sysctl -a
echo "\n\n"

Matériel

echo "# DMI Decode - System:"
dmidecode -t system
echo "\n\n"

echo "# DMI Decode - Processor:"
dmidecode -t processorecho
echo "\n\n"

echo "# DMI Decode - Memory:"
dmidecode -t memory
echo "\n\n"

echo "# Materiel:"
lshw -short
echo "\n\n"

Disques et FS

echo "Block devices:"
lsblk -a
lsblk -aO
echo "\n\n"

echo "File systems:"
fdisk -l
echo "\n\n"

Processes and services

echo "Listening sockets:"
ss -lnptu || netstat -lnptu
echo "\n\n"

echo "Running processes:"
ps fauxww
echo "\n\n"

Mysql

mysqltuner
mysql -Be 'SHOW GLOBAL VARIABLES' | sed "s/'/\'/;s/\t/\",\"/g;s/^/\"/;s/$/\"/;s/\n//g"
mysql -Be 'SHOW GLOBAL STATUS' | sed "s/'/\'/;s/\t/\",\"/g;s/^/\"/;s/$/\"/;s/\n//g"