mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 16:35:02 +01:00

My main user account is managed by systemd-homed. When I enable AppArmor and have nscd running, I get inconsistent behavior with my user account - sometimes I can't log in, sometimes I can log in but not use sudo, etc. This is the output of getent passwd: $ getent passwd root❌0:0::/root:/usr/bin/zsh bin❌1:1::/:/sbin/nologin daemon❌2:2::/:/sbin/nologin mail❌8:12::/var/spool/mail:/sbin/nologin ftp❌14:11::/srv/ftp:/sbin/nologin http❌33:33::/srv/http:/sbin/nologin nobody❌65534:65534:Nobody:/:/sbin/nologin dbus❌81:81:System Message Bus:/:/sbin/nologin [...] rose❌1000:1000:Rose Kunkel:/home/rose:/usr/bin/zsh But getent passwd rose and getent passwd 1000 both return no output. Stopping nscd.service fixes these problems. Checking the apparmor logs, I noticed that nscd was denied access to /etc/machine-id. Allowing access to that file seems to have fixed the issue. MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/707 Fixes: https://gitlab.com/apparmor/apparmor/-/issues/145 Signed-off-by: John Johansen <john.johansen@canonical.com>
46 lines
1.3 KiB
Text
46 lines
1.3 KiB
Text
# ------------------------------------------------------------------
|
|
#
|
|
# Copyright (C) 2002-2005 Novell/SUSE
|
|
# Copyright (C) 2009-2010 Canonical Ltd.
|
|
#
|
|
# This program is free software; you can redistribute it and/or
|
|
# modify it under the terms of version 2 of the GNU General Public
|
|
# License published by the Free Software Foundation.
|
|
#
|
|
# ------------------------------------------------------------------
|
|
|
|
abi <abi/3.0>,
|
|
|
|
include <tunables/global>
|
|
profile nscd /usr/{bin,sbin}/nscd {
|
|
include <abstractions/base>
|
|
include <abstractions/consoles>
|
|
include <abstractions/nameservice>
|
|
include <abstractions/ssl_certs>
|
|
|
|
deny capability block_suspend,
|
|
capability net_bind_service,
|
|
capability setgid,
|
|
capability setuid,
|
|
|
|
/etc/machine-id r,
|
|
/etc/netgroup r,
|
|
/etc/nscd.conf r,
|
|
/usr/{bin,sbin}/nscd rmix,
|
|
@{run}/.nscd_socket wl,
|
|
@{run}/nscd/ rw,
|
|
@{run}/nscd/db* rwl,
|
|
@{run}/nscd/socket wl,
|
|
/{var/cache,var/db,var/lib,var/run,run}/nscd/{passwd,group,services,hosts,netgroup} rw,
|
|
@{run}/{nscd/,}nscd.pid rwl,
|
|
/var/lib/libvirt/dnsmasq/ r,
|
|
/var/lib/libvirt/dnsmasq/*.status r,
|
|
/var/log/nscd.log rw,
|
|
@{PROC}/@{pid}/cmdline r,
|
|
@{PROC}/@{pid}/fd/ r,
|
|
@{PROC}/@{pid}/fd/* r,
|
|
@{PROC}/@{pid}/mounts r,
|
|
|
|
# Site-specific additions and overrides. See local/README for details.
|
|
include if exists <local/usr.sbin.nscd>
|
|
}
|