TMAegisБета
Другие правила для linux

Linux distributions

TMA-UBUNTU2004-6.3.3.14

Ensure events that modify the system's Mandatory Access Controls are collected

НизкийУровень 2Автоматическаяlinux

Описание

Monitor AppArmor, an implementation of mandatory access controls. The parameters below monitor any write access (potential additional, deletion or modification of files in the directory) or attribute changes to the /etc/apparmor/ and /etc/apparmor.d/ directories. Note: If a different Mandatory Access Control method is used, changes to the corresponding directories should be audited.

Как проверяется

Метод проверки: Команда оболочки

shell
alt0() { o=$(bash -c 'awk '"'"'/^ *-w/ &&(/\/etc\/apparmor/ ||/\/etc\/apparmor.d/) &&/ +-p *wa/ &&(/ key= *[!-~]* *$/||/ -k *[!-~]* *$/)'"'"' /etc/audit/rules.d/*.rules' 2>&1); printf '%s\n' "$o" | tr -s ' \t' '  ' | sed 's/^ //;s/ $//' | grep -Fxq -- '-w /etc/apparmor/ -p wa -k MAC-policy' || { echo step1: missing '-w /etc/apparmor/ -p wa -k MAC-policy'; return 1; }; printf '%s\n' "$o" | tr -s ' \t' '  ' | sed 's/^ //;s/ $//' | grep -Fxq -- '-w /etc/apparmor.d/ -p wa -k MAC-policy' || { echo step1: missing '-w /etc/apparmor.d/ -p wa -k MAC-policy'; return 1; }; o=$(bash -c 'auditctl -l | awk '"'"'/^ *-w/ &&(/\/etc\/apparmor/ ||/\/etc\/apparmor.d/) &&/ +-p *wa/ &&(/ key= *[!-~]* *$/||/ -k *[!-~]* *$/)'"'"'' 2>&1); printf '%s\n' "$o" | tr -s ' \t' '  ' | sed 's/^ //;s/ $//' | grep -Fxq -- '-w /etc/apparmor/ -p wa -k MAC-policy' || { echo step2: missing '-w /etc/apparmor/ -p wa -k MAC-policy'; return 1; }; printf '%s\n' "$o" | tr -s ' \t' '  ' | sed 's/^ //;s/ $//' | grep -Fxq -- '-w /etc/apparmor.d/ -p wa -k MAC-policy' || { echo step2: missing '-w /etc/apparmor.d/ -p wa -k MAC-policy'; return 1; }; }; if alt0; then echo compliant; fi
Ожидаемый вывод
compliant

Как исправляется

Метод исправления: Рекомендация или патч инфраструктуры

Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor events that modify the system's Mandatory Access Controls. Example: # printf " -w /etc/apparmor/ -p wa -k MAC-policy -w /etc/apparmor.d/ -p wa -k MAC-policy " >> /etc/audit/rules.d/50-MAC-policy.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep "enabled") =~ "2" ]]; then printf "Reboot required to load rules\n"; fi

Свойства

Операционные системы
ubuntu-20.04
Теги
cis-convertedlinux
Источник
CIS Ubuntu Linux 20.04 LTS Benchmark v3.0.0 - 6.3.3.14

Проверить этот хост

Выполните команду на компьютере, аудит которого вам разрешён. Сканирование работает только на чтение.

shell
tmaegis scan --target linux --level 2