當使用針對 LDAP 設定的 SSSD 登入時,系統日誌中的 apparmor 訊息變得非常吵雜。在掃描日誌以獲取有價值的資訊時,這有點煩人。
也許有人已經解決了這個問題並且可以讓生活更輕鬆地分享他們的解決方案。
謝謝。
答案1
最近配置網域成員資格後,我還收到了幾條與dmesg
相關的訊息sssd
。
儘管這些訊息與安裝/配置有關sssd
,但我很確定這些訊息實際上來自apparmor
,因為我嘗試debug_level
在 中進行調整,這僅對和/etc/sssd/sssd.conf
產生影響/var/log/sssd/sssd.conf
systemctl status sssd.service
例子:
# journalctl --reverse | grep sssd
. . .
Jan 27 13:50:04 chubbychipmunk.webtool.space audit[39674]:
AVC apparmor="ALLOWED" operation="open"
profile="/usr/sbin/sssd//null-/usr/libexec/sssd/sssd_be//null-/usr/bin/nsupdate"
name="/usr/lib/x86_64-linux-gnu/libirs.so.1601.0.0"
pid=39674
comm="nsupdate"
requested_mask="r"
denied_mask="r"
fsuid=0 ouid=0
. . .
我不是apparmor
專家,但透過這個過程,我了解到一些似乎有助於dmesg
減少噪音的實用程式。
首先,我安裝了apparmor-utils
,它具有以下aa-logprof
實用程式:
來自 aa-logprof(8):
執行 aa-logprof 將掃描日誌文件,如果存在現有設定檔集未涵蓋的新 AppArmor 事件,系統將提示使用者提供建議的修改以增強設定檔。
% sudo apt install -y apparmor-utils
然後,我aa-logprof
以 root 身份運行並獲得如下資訊:
% sudo aa-logprof
Updating AppArmor profiles in /etc/apparmor.d.
Reading log entries from /var/log/audit/audit.log.
WARNING: Ignoring exec event in /usr/sbin/sssd//null-/usr/libexec/sssd/sssd_be, nested profiles are not supported yet.
Profile: /usr/sbin/sssd
Execute: /usr/libexec/sssd/ldap_child
Severity: unknown
(I)nherit / (C)hild / (P)rofile / (N)amed / (U)nconfined / (X) ix On / (D)eny / Abo(r)t / (F)inish
我(I)nherit
在這裡使用與 相同的設定檔sssd
。然後我得到了這樣的東西:
Complain-mode changes:
Enforce-mode changes:
= Changed Local Profiles =
The following local profiles were changed. Would you like to save them?
[1 - /usr/sbin/sssd]
(S)ave Changes / Save Selec(t)ed Profile / [(V)iew Changes] / View Changes b/w (C)lean profiles / Abo(r)t
我點擊s
儲存設定文件,然後退出,這應該會給你這樣的結果:
Writing updated profile for /usr/sbin/sssd.
我第一次更新設定檔時,有幾個進程尚未包含在sssd
設定檔中。我基本上只是選擇了(A)llow
所有這些,因為就我而言,所有抱怨的進程apparmor
都與sssd
.
過了一會兒檢查它是否有效,我跑了:
% sudo dmesg -T | tail -n 100
並發現apparmor
我最後一條相關訊息sssd
是兩個多小時前的。
答案2
我可以通過運行來禁用它:
sudo ln -s /etc/apparmor.d/usr.sbin.sssd /etc/apparmor.d/disable/
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.sssd
來源:https://bgstack15.wordpress.com/2020/12/03/disable-apparmor-for-sssd/