Subject: AppArmor profile does not confine squid due to update-alternatives 
symlink (/usr/sbin/squid-gnutls)
Package: squid
Version: 6.13-2+deb13u4,7.8-1
Severity: normal
Dear Maintainer, The shipped AppArmor profile /etc/apparmor.d/usr.sbin.squid 
fails to confine the running Squid daemon because /usr/sbin/squid is managed 
via update-alternatives and resolves to /usr/sbin/squid-gnutls (or 
/usr/sbin/squid-openssl).
Since AppArmor resolves symlinks and matches profiles against the real target 
binary path at execve() time, the rule /usr/sbin/squid is never triggered. As a 
result, squid runs completely unconfined even when the AppArmor profile is 
loaded in enforce mode.
Steps to reproduce:
1. Install squid on a system with AppArmor enabled.
2. Check the symlink chain:
$ readlink -f /usr/sbin/squid
/usr/sbin/squid-gnutls
3. Restart the service and check AppArmor status:
\(systemctlrestartsquid\) aa-status | grep squid
(The profile is listed under loaded profiles, but 0 processes are confined "0 
processes are in enforce mode.").
Suggested fix:
1
Update the profile attachment path in /etc/apparmor.d/usr.sbin.squid to match 
the alternative binaries, e.g.:
/usr/sbin/squid{,-gnutls} flags=(attach_disconnected) {

or

2
sudo nano /etc/apparmor.d/tunables/alias.d/squid

Add the alias rule (with a trailing comma):
alias /usr/sbin/squid -> /usr/sbin/squid-gnutls,

Sent with [Proton Mail](https://proton.me/mail/home) secure email.

Reply via email to