« Linux : Securiser un serveur Linux » : différence entre les versions
(Page créée avec « === Liens === https://jay75chauhan.medium.com/%EF%B8%8Fsecure-linux-server-1bbbaaa465d6 Catégorie:Linux ») |
Aucun résumé des modifications |
||
(30 versions intermédiaires par le même utilisateur non affichées) | |||
Ligne 1 : | Ligne 1 : | ||
== Désactiver l'accès SSH Root == | |||
=== Editer le fichier de configuration SSH === | |||
<code>sudo nano /etc/ssh/sshd_config</code> | |||
* Vérifier la présence ou non de cette ligne : | |||
** PermitRootLogin yes | |||
* La remplacer par : | |||
** PermitRootLogin no | |||
*Paramétrer le protocol SSH ''(Imposer le protocol 2 uniquement)'' | |||
**Protocol 2 | |||
Enregistrer le fichier et redémarrer le service SSHD | |||
<code>sudo systemctl restart sshd</code> | |||
== Utilisation d'une clé SSH pour l'authentification == | |||
=== Générer la clé SSH sur la station locale pour créer une paire de clé Privée/Publique === | |||
<code>ssh-keygen -t rsa -b 4096</code> | |||
=== Copier la clé publique sur le serveur distant === | |||
<code>ssh-copy-id username@server_ip</code> | |||
=== Désactiver l'authentification SSH par mot de passe === | |||
==== Editer le fichier de configuration SSH ==== | |||
<code>sudo nano /etc/ssh/sshd_config</code><syntaxhighlight lang="bash"> | |||
PubkeyAuthentication yes | |||
PasswordAuthentication no | |||
</syntaxhighlight> | |||
==== Redémarrer le service SSH ==== | |||
* <code>sudo systemctl restart sshd</code> | |||
== Configurer une politique de mots de passe complexe == | |||
=== Editer une fichier de configuration de la politique de mot de passe === | |||
<code>sudo nano /etc/security/pwquality.conf</code> | |||
==== Exemple de paramètres ==== | |||
<code>minlen = 12 minclass = 3</code> | |||
* '''minlen :''' 12 caractères | |||
* '''minclass :''' 3 types de caractères différents<br /> | |||
== Activer les mises à jours automatiques sur Ubuntu == | |||
<code>sudo apt install unattended-upgrades</code> | |||
== Configurer le Firewall == | |||
=== Exemple === | |||
<syntaxhighlight lang="bash"> | |||
sudo apt install ufw | |||
sudo ufw allow 22 # Allow SSH | |||
sudo ufw allow 80 # Allow HTTP | |||
sudo ufw allow 443 # Allow HTTPS | |||
sudo ufw enable | |||
</syntaxhighlight> | |||
== Configurer Fail2ban ''(Détection d'intrusion)'' == | |||
=== Installation de Fail2ban === | |||
<code>sudo apt install fail2ban</code> | |||
=== Edition de la configuration === | |||
<code>sudo nano /etc/fail2ban/jail.conf</code> | |||
==== Exemple pour la surveillance du service SSH ==== | |||
<syntaxhighlight lang="bash"> | |||
[sshd] | |||
enabled = true | |||
maxretry = 5 | |||
bantime = 3600 | |||
</syntaxhighlight> | |||
* Block l'IP pendant 1 heure après 5 échecs d'authentification | |||
=== Liens === | === Liens === | ||
[[Installation de Fail2ban]] | |||
== Désactiver les services non nécessaires == | |||
=== Listing des services actifs === | |||
<code>sudo systemctl list-unit-files --type=service --state=enabled</code> | |||
=== Désactiver les services non nécessaires === | |||
<code>sudo systemctl disable service_name</code> | |||
== Vérifier les droits d'accès aux fichiers de configuration importants == | |||
=== Exemple === | |||
<syntaxhighlight lang="bash"> | |||
sudo chmod 600 /etc/ssh/sshd_config | |||
sudo chmod 640 /var/log/auth.log | |||
</syntaxhighlight> | |||
=== chattr / lsattr === | |||
* '''chattr''' modifie les attributs étendus | |||
* '''lsattr''' liste les attributs étendus de sécurité des répertoires/fichiers | |||
==== Liens ==== | |||
[[Linux : Commande chattr / lsattr]] | |||
== Activer le monitoring & les logs == | |||
''(Sera l'objet d'une page dédiée plus tard)'' | |||
* Utiliser des outils comme Rsyslog ou (plus centralisé) Elasticsearch, Logstash, Kibana | |||
=== Configurer Auditd === | |||
<code>sudo apt install auditd</code> | |||
==== Ajout des règles dans le fichier ''/etc/audit/audit.rules'' pour surveiller les fichiers importants ==== | |||
<code>-w /etc/passwd -p wa -k passwd_changes</code> | |||
==== Redémarrage du service auditd ==== | |||
<code>sudo systemctl restart auditd</code> | |||
== Paramètres du Kernel == | |||
=== Edition du fichier ''/etc/sysctl.conf'' === | |||
<syntaxhighlight lang="bash"> | |||
net.ipv4.tcp_syncookies = 1 | |||
net.ipv4.conf.all.rp_filter = 1 | |||
net.ipv4.conf.default.accept_source_route = 0 | |||
</syntaxhighlight> | |||
=== Application des paramètres === | |||
<code>sudo sysctl -p</code> | |||
== Limitation des ressources systèmes == | |||
=== Edition du fichier ''/etc/security/limits.conf'' === | |||
<code>sudo nano /etc/security/limits.conf</code> | |||
==== Paramètres ==== | |||
<syntaxhighlight lang="bash"> | |||
* soft nproc 4096 | |||
* hard nproc 8192 | |||
</syntaxhighlight> | |||
== Outils de détection de failles de sécurité == | |||
=== Lynis === | |||
<code>sudo apt install lynis</code> | |||
==== Scan du système ==== | |||
<code>sudo lynis audit system</code> | |||
== Antivirus == | |||
=== Clamav === | |||
<code>sudo apt install clamav</code> | |||
==== Mise à jour & scan ==== | |||
<syntaxhighlight lang="bash"> | |||
sudo freshclam | |||
sudo clamscan -r /directory_to_scan | |||
</syntaxhighlight> | |||
== Authentification multi-facteurs MFA == | |||
=== Google Authenticator === | |||
<code>sudo apt install libpam-google-authenticator</code> | |||
==== Paramétrage ==== | |||
<code>google-authenticator</code> | |||
==== Activation de l'authentification par mot de passe + MFA obligatoires dans la configuration PAM ==== | |||
<code>sudo nano /etc/pam.d/sshd</code> | |||
* Ajouter | |||
<code>auth required pam_google_authenticator.so</code> | |||
==== Activation du MFA dans la configuration SSH ==== | |||
<code>sudo nano /etc/ssh/sshd_config</code> | |||
* Ajouter | |||
<syntaxhighlight lang="bash"> | |||
UsePAM yes | |||
PubkeyAuthentication yes | |||
PasswordAuthentication no | |||
ChallengeResponseAuthentication yes | |||
AuthenticationMethods publickey,keyboard-interactive | |||
</syntaxhighlight> | |||
* Redémarrage du service | |||
<code>sudo systemctl restart sshd</code> | |||
Ces paramétrages activeront à la fois l'authentification par mot de passe + MFA même si l'authentification par partage de clé est activé. | |||
==== Paramétrages Clé SSH + MFA ==== | |||
===== Activation du MFA dans la configuration PAM ===== | |||
<code>sudo nano /etc/pam.d/sshd</code> | |||
* Ajouter | |||
<code>auth required pam_google_authenticator.so</code> | |||
===== Activation du MFA dans la configuration SSH ===== | |||
<code>sudo nano /etc/ssh/sshd_config</code> | |||
* Ajouter | |||
<syntaxhighlight lang="bash"> | |||
UsePAM yes | |||
PubkeyAuthentication yes | |||
PasswordAuthentication no | |||
ChallengeResponseAuthentication yes | |||
AuthenticationMethods publickey,keyboard-interactive | |||
</syntaxhighlight><code>sudo nano /etc/pam.d/sshd</code> | |||
* Commenter | |||
<syntaxhighlight lang="bash"> | |||
# Standard Un*x authentication. | |||
# @include common-auth | |||
</syntaxhighlight> | |||
*Redémarrage du service SSHD | |||
<code>sudo systemctl restart sshd</code> | |||
=== Liens === | |||
https://www.it-connect.fr/linux-comment-activer-le-mfa-sur-un-acces-ssh/ | |||
https://www.tech2tech.fr/configurer-la-double-authentification-ssh-sur-ubuntu-server/ | |||
==== Observations ==== | |||
* https://www.it-connect.fr/linux-comment-activer-le-mfa-sur-un-acces-ssh/#comment-240279 | |||
<syntaxhighlight lang="bash"> | |||
Albator | |||
16/03/2024 à 14:32 | |||
Bonjour | |||
il faut mettre à jour votre tuto pour préciser deux choses : | |||
– à partir de Debian 12, dans sshd_config c’est l’option « KbdInteractiveAuthentication » qu’il faut définir sur « yes » (à la place de « ChallengeResponseAuthentication » qui n’apparaît plus) | |||
– quand on utilise l’authentification par clé, il faut commenter dans le fichier /etc/pam.d/sshd l’option « @include common-auth » du paragraphe « # Standard Un*x authentication. » Sans quoi le mot de passe est demandé. | |||
</syntaxhighlight> | |||
== Limitation des accès Sudo == | |||
=== Edition du fichier ''sudoers'' === | |||
<code>sudo visudo</code> | |||
==== Définition des droits spécifiques en fonction des utilisateurs ==== | |||
<code>username ALL=(ALL) NOPASSWD: /path/to/specific_command</code> | |||
== File Integrity Monitoring ''(FIM)'' == | |||
* Détecte les modifications non autorisées sur les fichiers critiques | |||
=== Installation de AIDE === | |||
<code>sudo apt install aide</code> | |||
==== Initialisation de la base AIDE ==== | |||
<code>sudo aideinit</code> | |||
==== Planification des contrôles ==== | |||
<code>sudo crontab -e</code> | |||
* <code>0 3 * * * /usr/bin/aide --check</code> | |||
==== Liens ==== | |||
https://help.ubuntu.com/community/FileIntegrityAIDE | |||
== DNS Security Extensions ''(DNSSEC)'' == | |||
=== Activation de DNSSEC dans ''named.conf'' === | |||
<code>dnssec-enable yes; dnssec-validation auto;</code> | |||
=== Sur Ubuntu client DNS === | |||
<code>sudo nano /etc/systemd/resolved.conf</code> | |||
==== Exemple de configuration ==== | |||
<syntaxhighlight lang="bash"> | |||
[Resolve] | |||
# Some examples of DNS servers which may be used for DNS= and FallbackDNS=: | |||
# Cloudflare: 1.1.1.1#cloudflare-dns.com 1.0.0.1#cloudflare-dns.com 2606:4700:4700::1111#cloudflare-dns.com 2606:4700:4700::1001#cloudflare-dns.com | |||
# Google: 8.8.8.8#dns.google 8.8.4.4#dns.google 2001:4860:4860::8888#dns.google 2001:4860:4860::8844#dns.google | |||
DNS=9.9.9.9 149.112.112.112 | |||
FallbackDNS=192.168.1.1 | |||
LLMNR=no | |||
MulticastDNS=no | |||
DNSSEC=allow-downgrade | |||
DNSOverTLS=opportunistic | |||
Cache=no-negative | |||
DNSStubListener=yes | |||
ReadEtcHosts=yes | |||
</syntaxhighlight>Si vous êtes sûrs de votre serveur DNS, vous pouvez passer l'option '''DNSSEC=true''' & '''DNSOverTLS=true''' | |||
* Recharger la configuration DNS | |||
<code>sudo systemctl restart systemd-resolved</code> | |||
* Test | |||
<code>sudo resolvectl status</code><syntaxhighlight lang="bash"> | |||
root@linux:~# resolvectl status | |||
Global | |||
Protocols: -LLMNR -mDNS DNSOverTLS=opportunistic DNSSEC=allow-downgrade/unsupported | |||
resolv.conf mode: stub | |||
Current DNS Server: 9.9.9.9 | |||
DNS Servers: 9.9.9.9 149.112.112.112 | |||
Fallback DNS Servers: 192.168.1.1 | |||
Link 2 (ens18) | |||
Current Scopes: DNS | |||
Protocols: +DefaultRoute +LLMNR -mDNS DNSOverTLS=opportunistic DNSSEC=allow-downgrade/supported | |||
Current DNS Server: 192.168.1.1 | |||
DNS Servers: 192.168.1.1 | |||
root@linux:~# | |||
</syntaxhighlight><code>resolvectl query www.yakakliker.org</code><syntaxhighlight lang="bash"> | |||
root@linux:~# resolvectl query www.yakakliker.org | |||
www.yakakliker.org: 194.164.204.65 -- link: ens18 | |||
-- Information acquired via protocol DNS in 478.4ms. | |||
-- Data is authenticated: no; Data was acquired via local or encrypted transport: yes | |||
-- Data from: network | |||
root@linux:~# | |||
</syntaxhighlight> | |||
==== Liens ==== | |||
https://wiki.archlinux.org/title/Systemd-resolved_(Fran%C3%A7ais) | |||
== Host-Based Intrusion Detection System ''(HIDS)'' == | |||
=== Installation de OSSEC === | |||
<code>sudo apt install ossec-hids</code> | |||
=== Liens === | |||
https://bobcares.com/blog/install-ossec-ubuntu-like-a-pro/ | |||
https://www.ossec.net/docs/docs/manual/installation/installation-requirements.html | |||
== Rkhunter ''(Analyseur de rootkits)'' == | |||
=== Installation === | |||
<code>sudo apt-get install rkhunter</code> | |||
==== Configuration ''/etc/default/rkhunter'' ==== | |||
<syntaxhighlight lang="bash"> | |||
# Defaults for rkhunter automatic tasks | |||
# sourced by /etc/cron.*/rkhunter and /etc/apt/apt.conf.d/90rkhunter | |||
# | |||
# This is a POSIX shell fragment | |||
# | |||
# Set this to yes to enable rkhunter daily runs | |||
# (default: false) | |||
CRON_DAILY_RUN="yes" | |||
# Set this to yes to enable rkhunter weekly database updates | |||
# (default: false) | |||
CRON_DB_UPDATE="yes" | |||
# Set this to yes to enable reports of weekly database updates | |||
# (default: false) | |||
DB_UPDATE_EMAIL="false" | |||
# Set this to the email address where reports and run output should be sent | |||
# (default: root) | |||
REPORT_EMAIL="webmaster@yakakliker.org" | |||
# Set this to yes to enable automatic database updates | |||
# (default: false) | |||
APT_AUTOGEN="yes" | |||
# Nicenesses range from -20 (most favorable scheduling) to 19 (least favorable) | |||
# (default: 0) | |||
NICE="0" | |||
# Should daily check be run when running on battery | |||
# powermgmt-base is required to detect if running on battery or on AC power | |||
# (default: false) | |||
RUN_CHECK_ON_BATTERY="false" | |||
</syntaxhighlight> | |||
=== Liens === | |||
[[Linux : Sécuriser avec Rkhunter]] | |||
== Liens == | |||
https://jay75chauhan.medium.com/%EF%B8%8Fsecure-linux-server-1bbbaaa465d6 | https://jay75chauhan.medium.com/%EF%B8%8Fsecure-linux-server-1bbbaaa465d6 | ||
[[Catégorie:Linux]] | [[Catégorie:Linux]] | ||
[[Catégorie:Securite]] | |||
<html> | |||
<script src='https://storage.ko-fi.com/cdn/scripts/overlay-widget.js'></script> | |||
<script> | |||
kofiWidgetOverlay.draw('yakakliker', { | |||
'type': 'floating-chat', | |||
'floating-chat.donateButton.text': 'Café', | |||
'floating-chat.donateButton.background-color': '#00b9fe', | |||
'floating-chat.donateButton.text-color': '#fff' | |||
}); | |||
</script> | |||
</html> | |||
<html> | |||
<a href="https://www.compteurdevisite.com" title="compteur web gratuit sans pub"><img src="https://counter6.optistats.ovh/private/compteurdevisite.php?c=b4epghealnwlf7wuq7gn3ygll9aywrfx" border="0" title="compteur web gratuit sans pub" alt="compteur web gratuit sans pub"></a> | |||
</html> |
Dernière version du 17 février 2025 à 14:35
Désactiver l'accès SSH Root
Editer le fichier de configuration SSH
sudo nano /etc/ssh/sshd_config
- Vérifier la présence ou non de cette ligne :
- PermitRootLogin yes
- La remplacer par :
- PermitRootLogin no
- Paramétrer le protocol SSH (Imposer le protocol 2 uniquement)
- Protocol 2
Enregistrer le fichier et redémarrer le service SSHD
sudo systemctl restart sshd
Utilisation d'une clé SSH pour l'authentification
Générer la clé SSH sur la station locale pour créer une paire de clé Privée/Publique
ssh-keygen -t rsa -b 4096
Copier la clé publique sur le serveur distant
ssh-copy-id username@server_ip
Désactiver l'authentification SSH par mot de passe
Editer le fichier de configuration SSH
sudo nano /etc/ssh/sshd_config
PubkeyAuthentication yes
PasswordAuthentication no
Redémarrer le service SSH
sudo systemctl restart sshd
Configurer une politique de mots de passe complexe
Editer une fichier de configuration de la politique de mot de passe
sudo nano /etc/security/pwquality.conf
Exemple de paramètres
minlen = 12 minclass = 3
- minlen : 12 caractères
- minclass : 3 types de caractères différents
Activer les mises à jours automatiques sur Ubuntu
sudo apt install unattended-upgrades
Configurer le Firewall
Exemple
sudo apt install ufw
sudo ufw allow 22 # Allow SSH
sudo ufw allow 80 # Allow HTTP
sudo ufw allow 443 # Allow HTTPS
sudo ufw enable
Configurer Fail2ban (Détection d'intrusion)
Installation de Fail2ban
sudo apt install fail2ban
Edition de la configuration
sudo nano /etc/fail2ban/jail.conf
Exemple pour la surveillance du service SSH
[sshd]
enabled = true
maxretry = 5
bantime = 3600
- Block l'IP pendant 1 heure après 5 échecs d'authentification
Liens
Désactiver les services non nécessaires
Listing des services actifs
sudo systemctl list-unit-files --type=service --state=enabled
Désactiver les services non nécessaires
sudo systemctl disable service_name
Vérifier les droits d'accès aux fichiers de configuration importants
Exemple
sudo chmod 600 /etc/ssh/sshd_config
sudo chmod 640 /var/log/auth.log
chattr / lsattr
- chattr modifie les attributs étendus
- lsattr liste les attributs étendus de sécurité des répertoires/fichiers
Liens
Linux : Commande chattr / lsattr
Activer le monitoring & les logs
(Sera l'objet d'une page dédiée plus tard)
- Utiliser des outils comme Rsyslog ou (plus centralisé) Elasticsearch, Logstash, Kibana
Configurer Auditd
sudo apt install auditd
Ajout des règles dans le fichier /etc/audit/audit.rules pour surveiller les fichiers importants
-w /etc/passwd -p wa -k passwd_changes
Redémarrage du service auditd
sudo systemctl restart auditd
Paramètres du Kernel
Edition du fichier /etc/sysctl.conf
net.ipv4.tcp_syncookies = 1
net.ipv4.conf.all.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
Application des paramètres
sudo sysctl -p
Limitation des ressources systèmes
Edition du fichier /etc/security/limits.conf
sudo nano /etc/security/limits.conf
Paramètres
* soft nproc 4096
* hard nproc 8192
Outils de détection de failles de sécurité
Lynis
sudo apt install lynis
Scan du système
sudo lynis audit system
Antivirus
Clamav
sudo apt install clamav
Mise à jour & scan
sudo freshclam
sudo clamscan -r /directory_to_scan
Authentification multi-facteurs MFA
Google Authenticator
sudo apt install libpam-google-authenticator
Paramétrage
google-authenticator
Activation de l'authentification par mot de passe + MFA obligatoires dans la configuration PAM
sudo nano /etc/pam.d/sshd
- Ajouter
auth required pam_google_authenticator.so
Activation du MFA dans la configuration SSH
sudo nano /etc/ssh/sshd_config
- Ajouter
UsePAM yes
PubkeyAuthentication yes
PasswordAuthentication no
ChallengeResponseAuthentication yes
AuthenticationMethods publickey,keyboard-interactive
- Redémarrage du service
sudo systemctl restart sshd
Ces paramétrages activeront à la fois l'authentification par mot de passe + MFA même si l'authentification par partage de clé est activé.
Paramétrages Clé SSH + MFA
Activation du MFA dans la configuration PAM
sudo nano /etc/pam.d/sshd
- Ajouter
auth required pam_google_authenticator.so
Activation du MFA dans la configuration SSH
sudo nano /etc/ssh/sshd_config
- Ajouter
UsePAM yes
PubkeyAuthentication yes
PasswordAuthentication no
ChallengeResponseAuthentication yes
AuthenticationMethods publickey,keyboard-interactive
sudo nano /etc/pam.d/sshd
- Commenter
# Standard Un*x authentication.
# @include common-auth
- Redémarrage du service SSHD
sudo systemctl restart sshd
Liens
https://www.it-connect.fr/linux-comment-activer-le-mfa-sur-un-acces-ssh/
https://www.tech2tech.fr/configurer-la-double-authentification-ssh-sur-ubuntu-server/
Observations
Albator
16/03/2024 à 14:32
Bonjour
il faut mettre à jour votre tuto pour préciser deux choses :
– à partir de Debian 12, dans sshd_config c’est l’option « KbdInteractiveAuthentication » qu’il faut définir sur « yes » (à la place de « ChallengeResponseAuthentication » qui n’apparaît plus)
– quand on utilise l’authentification par clé, il faut commenter dans le fichier /etc/pam.d/sshd l’option « @include common-auth » du paragraphe « # Standard Un*x authentication. » Sans quoi le mot de passe est demandé.
Limitation des accès Sudo
Edition du fichier sudoers
sudo visudo
Définition des droits spécifiques en fonction des utilisateurs
username ALL=(ALL) NOPASSWD: /path/to/specific_command
File Integrity Monitoring (FIM)
- Détecte les modifications non autorisées sur les fichiers critiques
Installation de AIDE
sudo apt install aide
Initialisation de la base AIDE
sudo aideinit
Planification des contrôles
sudo crontab -e
0 3 * * * /usr/bin/aide --check
Liens
https://help.ubuntu.com/community/FileIntegrityAIDE
DNS Security Extensions (DNSSEC)
Activation de DNSSEC dans named.conf
dnssec-enable yes; dnssec-validation auto;
Sur Ubuntu client DNS
sudo nano /etc/systemd/resolved.conf
Exemple de configuration
[Resolve]
# Some examples of DNS servers which may be used for DNS= and FallbackDNS=:
# Cloudflare: 1.1.1.1#cloudflare-dns.com 1.0.0.1#cloudflare-dns.com 2606:4700:4700::1111#cloudflare-dns.com 2606:4700:4700::1001#cloudflare-dns.com
# Google: 8.8.8.8#dns.google 8.8.4.4#dns.google 2001:4860:4860::8888#dns.google 2001:4860:4860::8844#dns.google
DNS=9.9.9.9 149.112.112.112
FallbackDNS=192.168.1.1
LLMNR=no
MulticastDNS=no
DNSSEC=allow-downgrade
DNSOverTLS=opportunistic
Cache=no-negative
DNSStubListener=yes
ReadEtcHosts=yes
Si vous êtes sûrs de votre serveur DNS, vous pouvez passer l'option DNSSEC=true & DNSOverTLS=true
- Recharger la configuration DNS
sudo systemctl restart systemd-resolved
- Test
sudo resolvectl status
root@linux:~# resolvectl status
Global
Protocols: -LLMNR -mDNS DNSOverTLS=opportunistic DNSSEC=allow-downgrade/unsupported
resolv.conf mode: stub
Current DNS Server: 9.9.9.9
DNS Servers: 9.9.9.9 149.112.112.112
Fallback DNS Servers: 192.168.1.1
Link 2 (ens18)
Current Scopes: DNS
Protocols: +DefaultRoute +LLMNR -mDNS DNSOverTLS=opportunistic DNSSEC=allow-downgrade/supported
Current DNS Server: 192.168.1.1
DNS Servers: 192.168.1.1
root@linux:~#
resolvectl query www.yakakliker.org
root@linux:~# resolvectl query www.yakakliker.org
www.yakakliker.org: 194.164.204.65 -- link: ens18
-- Information acquired via protocol DNS in 478.4ms.
-- Data is authenticated: no; Data was acquired via local or encrypted transport: yes
-- Data from: network
root@linux:~#
Liens
https://wiki.archlinux.org/title/Systemd-resolved_(Fran%C3%A7ais)
Host-Based Intrusion Detection System (HIDS)
Installation de OSSEC
sudo apt install ossec-hids
Liens
https://bobcares.com/blog/install-ossec-ubuntu-like-a-pro/
https://www.ossec.net/docs/docs/manual/installation/installation-requirements.html
Rkhunter (Analyseur de rootkits)
Installation
sudo apt-get install rkhunter
Configuration /etc/default/rkhunter
# Defaults for rkhunter automatic tasks
# sourced by /etc/cron.*/rkhunter and /etc/apt/apt.conf.d/90rkhunter
#
# This is a POSIX shell fragment
#
# Set this to yes to enable rkhunter daily runs
# (default: false)
CRON_DAILY_RUN="yes"
# Set this to yes to enable rkhunter weekly database updates
# (default: false)
CRON_DB_UPDATE="yes"
# Set this to yes to enable reports of weekly database updates
# (default: false)
DB_UPDATE_EMAIL="false"
# Set this to the email address where reports and run output should be sent
# (default: root)
REPORT_EMAIL="webmaster@yakakliker.org"
# Set this to yes to enable automatic database updates
# (default: false)
APT_AUTOGEN="yes"
# Nicenesses range from -20 (most favorable scheduling) to 19 (least favorable)
# (default: 0)
NICE="0"
# Should daily check be run when running on battery
# powermgmt-base is required to detect if running on battery or on AC power
# (default: false)
RUN_CHECK_ON_BATTERY="false"
Liens
Linux : Sécuriser avec Rkhunter
Liens
https://jay75chauhan.medium.com/%EF%B8%8Fsecure-linux-server-1bbbaaa465d6