apparmor:start
Apparmor
Autoriser un processus à lire un fichier particulier
Par exemple si freshclam n'arrive pas à mettre à jour sa base de données avec l'erreur suivante :
Trying to retrieve CVD header from https://database.clamav.net/daily.cvd ^remote_cvdhead: Download failed (6) Wed Jan 5 10:38:49 2022 -> ^ Message: Couldn't resolve host name ^Failed to get daily database version information from server: https://database.clamav.net !check_for_new_database_version: Failed to find daily database using server https://database.clamav.net.
vérifier si l'erreur suivante apparait elle aussi :
localhost kernel: [ 426.710664] audit: type=1400 audit(1641375563.751:41): apparmor="DENIED" operation="open" profile="/usr/bin/freshclam" name="/etc/resolv.conf.pro" pid=3657 comm="freshclam" requested_mask="r" denied_mask="r" fsuid=127 ouid=0
Le fichier “/etc/resolv.conf.pro” est la cible du lien symbolique “/etc/resolv.conf”, pour ne pas qu'il soit supprimé par NetworkManager.
Il faut donc ajouter, dans ce cas, la règle suivante :
[11:18:20 welmoc@tentacruel ~]# cat /etc/apparmor.d/usr.bin.freshclam
# vim:syntax=apparmor
# Author: Jamie Strandboge <jamie@ubuntu.com>
# Last Modified: Sun Aug 3 09:39:03 2008
#include <tunables/global>
/usr/bin/freshclam flags=(attach_disconnected) {
[...]
allow /etc/resolv.conf.pro r,
[...]
}
Et recharger la configuraiton de apparmor :
sudo systemctl reload apparmor.service
apparmor/start.txt · Dernière modification : de jonathan
