public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: Stefano Brivio <sbrivio@redhat.com>
To: passt-dev@passt.top
Cc: Paul Holzinger <pholzing@redhat.com>,
	David Gibson <david@gibson.dropbear.id.au>
Subject: [PATCH 1/5] apparmor: Use abstractions/nameservice to deal with symlinked resolv.conf
Date: Thu,  7 Sep 2023 00:35:11 +0200	[thread overview]
Message-ID: <20230906223515.2533706-2-sbrivio@redhat.com> (raw)
In-Reply-To: <20230906223515.2533706-1-sbrivio@redhat.com>

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 <sbrivio@redhat.com>
---
 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 <abstractions/base>
 
-  # Alternatively: include <abstractions/nameservice>
-  @{etc_ro}/resolv.conf			r,	# get_dns(), conf.c
+  include <abstractions/nameservice>		# get_dns(), conf.c
 
   capability net_bind_service,			# isolation.c, conf.c
   capability setuid,
-- 
@@ -15,8 +15,7 @@
 
   include <abstractions/base>
 
-  # Alternatively: include <abstractions/nameservice>
-  @{etc_ro}/resolv.conf			r,	# get_dns(), conf.c
+  include <abstractions/nameservice>		# get_dns(), conf.c
 
   capability net_bind_service,			# isolation.c, conf.c
   capability setuid,
-- 
2.39.2


  reply	other threads:[~2023-09-06 22:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-06 22:35 [PATCH 0/5] Fixes to AppArmor policy, passt/pasta profile split Stefano Brivio
2023-09-06 22:35 ` Stefano Brivio [this message]
2023-09-06 22:35 ` [PATCH 2/5] apparmor: Explicitly pass options we use while remounting root filesystem Stefano Brivio
2023-09-06 22:35 ` [PATCH 3/5] apparmor: Allow read-only access to uid_map Stefano Brivio
2023-09-06 22:35 ` [PATCH 4/5] apparmor: Allow pasta to remount /proc, access entries under its own copy Stefano Brivio
2023-09-06 22:35 ` [PATCH 5/5] apparmor: Add pasta's own profile Stefano Brivio

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230906223515.2533706-2-sbrivio@redhat.com \
    --to=sbrivio@redhat.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=passt-dev@passt.top \
    --cc=pholzing@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).