From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by passt.top (Postfix, from userid 1000) id C3A035A0272; Thu, 7 Sep 2023 00:35:15 +0200 (CEST) From: Stefano Brivio To: passt-dev@passt.top Subject: [PATCH 1/5] apparmor: Use abstractions/nameservice to deal with symlinked resolv.conf Date: Thu, 7 Sep 2023 00:35:11 +0200 Message-Id: <20230906223515.2533706-2-sbrivio@redhat.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230906223515.2533706-1-sbrivio@redhat.com> References: <20230906223515.2533706-1-sbrivio@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: GJXTCW5RCB33N4EE77NAHK5UGULGUBHJ X-Message-ID-Hash: GJXTCW5RCB33N4EE77NAHK5UGULGUBHJ X-MailFrom: sbrivio@passt.top X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Paul Holzinger , David Gibson X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: While abstractions/nameservice appeared too broad and overkill for our simple need (read-only resolv.conf access), it properly deals with symlinked resolv.conf files generated by systemd-resolved, NetworkManager or suchlike. If we just grant read-only access to /etc/resolv.conf, we'll fail to read nameserver information in rather common configurations, because AppArmor won't follow the symlink. Signed-off-by: Stefano Brivio --- contrib/apparmor/abstractions/passt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/contrib/apparmor/abstractions/passt b/contrib/apparmor/abstractions/passt index 6e2a6f3..a16eb6e 100644 --- a/contrib/apparmor/abstractions/passt +++ b/contrib/apparmor/abstractions/passt @@ -15,8 +15,7 @@ include - # Alternatively: include - @{etc_ro}/resolv.conf r, # get_dns(), conf.c + include # get_dns(), conf.c capability net_bind_service, # isolation.c, conf.c capability setuid, -- 2.39.2