Public bug reported:
Starting wg-quick@<iface>.service triggers AppArmor audit events for the
wg-quick profile reading /etc/nsswitch.conf and /etc/passwd. The events
are logged as ALLOWED with denied_mask="r", which indicates the profile
does not grant these accesses and the profile is in complain mode
(confirm: <aa-status output>). If the profile were enforcing, wg-quick
would be denied these reads.
Steps to reproduce:
- Configure a WireGuard interface in /etc/wireguard/wgserver0.conf
- sudo systemctl start wg-quick@wgserver0
- journalctl -k | grep 'profile="wg-quick"'
Actual result:
apparmor="ALLOWED" operation="open" class="file" profile="wg-quick"
name="/etc/nsswitch.conf" comm="wg-quick" requested_mask="r" denied_mask="r"
apparmor="ALLOWED" operation="file_perm" class="file" profile="wg-quick"
name="/etc/nsswitch.conf" ...
apparmor="ALLOWED" operation="open" class="file" profile="wg-quick"
name="/etc/passwd" ...
apparmor="ALLOWED" operation="file_perm" class="file" profile="wg-quick"
name="/etc/passwd" ...
Expected result: No audit events for normal operation. The profile
should permit these reads, for example via #include
<abstractions/nameservice> or explicit /etc/nsswitch.conf r, and
/etc/passwd r, rules, so it works correctly when switched to enforce
mode.
Notes: The accesses likely come from name or user lookups (NSS) during
wg-quick up, for example hostname resolution of an endpoint or a user
lookup. The proposed fix is untested.
ProblemType: Bug
DistroRelease: Ubuntu 26.04
Package: apparmor 5.0.2-0ubuntu1~26.04.1
ProcVersionSignature: Ubuntu 7.0.0-44.44-generic 7.0.14
Uname: Linux 7.0.0-44-generic x86_64
ApportVersion: 2.34.1-0ubuntu0.1
Architecture: amd64
CasperMD5CheckResult: unknown
CurrentDesktop: KDE
Date: Mon Nov 30 12:55:07 2026
InstallationDate: Installed on 2024-12-16 (714 days ago)
InstallationMedia: Ubuntu-Server 24.04.1 LTS "Noble Numbat" - Release amd64
(20240827)
ProcKernelCmdline: BOOT_IMAGE=/vmlinuz-7.0.0-44-generic
root=/dev/mapper/MainVG-root ro systemd.unified_cgroup_hierarchy=0 quiet
nosplash
crashkernel=2G-4G:320M,4G-32G:512M,32G-64G:1024M,64G-128G:2048M,128G-:4096M
SourcePackage: apparmor
Syslog:
2026-11-29T03:24:29.040253+11:00 timserver dbus-daemon[2643917]: [session
uid=1005 pid=2643917 pidfd=5] AppArmor D-Bus mediation is enabled
2026-11-29T18:02:21.777338+11:00 timserver dbus-daemon[3136614]: [session
uid=1005 pid=3136614 pidfd=5] AppArmor D-Bus mediation is enabled
UpgradeStatus: Upgraded to resolute on 2026-10-26 (35 days ago)
modified.conffile..etc.apparmor.d.local.README: [deleted]
mtime.conffile..etc.apparmor.d.wg-quick: 2026-11-20T21:59:14.031628
** Affects: apparmor (Ubuntu)
Importance: Undecided
Status: New
** Tags: amd64 apport-bug resolute
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2178392
Title:
wg-quick AppArmor profile missing read access to /etc/nsswitch.conf
and /etc/passwd
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/2178392/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs