SELinux-Refpolicy Archive on lore.kernel.org
 help / color / Atom feed
From: Chris PeBenito <pebenito@ieee.org>
To: "Sugar, David" <dsugar@tresys.com>,
	"selinux-refpolicy@vger.kernel.org" 
	<selinux-refpolicy@vger.kernel.org>
Subject: Re: [PATCH 4/4] Allow ntpd to read unit files
Date: Sun, 24 Mar 2019 14:36:48 -0400
Message-ID: <67d9f37e-3ecc-d11e-f5db-5f494ed62501@ieee.org> (raw)
In-Reply-To: <20190320002012.21220-5-dsugar@tresys.com>

On 3/19/19 8:20 PM, Sugar, David wrote:
> type=AVC msg=audit(1553013917.359:9935): avc:  denied  { read } for  pid=16326 comm="systemd-timedat" name="50-chronyd.list" dev="dm-1" ino=4870675 scontext=system_u:system_r:ntpd_t:s0 tcontext=system_u:object_r:ntpd_unit_t:s0 tclass=file permissive=1
> type=AVC msg=audit(1553013917.359:9935): avc:  denied  { open } for  pid=16326 comm="systemd-timedat" path="/usr/lib/systemd/ntp-units.d/50-chronyd.list" dev="dm-1" ino=4870675 scontext=system_u:system_r:ntpd_t:s0 tcontext=system_u:object_r:ntpd_unit_t:s0 tclass=file permissive=1
> type=AVC msg=audit(1553013917.359:9936): avc:  denied  { getattr } for  pid=16326 comm="systemd-timedat" path="/usr/lib/systemd/ntp-units.d/50-chronyd.list" dev="dm-1" ino=4870675 scontext=system_u:system_r:ntpd_t:s0 tcontext=system_u:object_r:ntpd_unit_t:s0 tclass=file permissive=1
> 
> type=AVC msg=audit(1553013821.622:9902): avc:  denied  { getattr } for  pid=16281 comm="systemd-timedat" path="/usr/lib/systemd/ntp-units.d" dev="dm-1" ino=4700094 scontext=system_u:system_r:ntpd_t:s0 tcontext=system_u:object_r:systemd_unit_t:s0 tclass=dir permissive=1
> type=AVC msg=audit(1553013821.622:9903): avc:  denied  { read } for  pid=16281 comm="systemd-timedat" name="ntp-units.d" dev="dm-1" ino=4700094 scontext=system_u:system_r:ntpd_t:s0 tcontext=system_u:object_r:systemd_unit_t:s0 tclass=dir permissive=1
> type=AVC msg=audit(1553013821.622:9903): avc:  denied  { open } for  pid=16281 comm="systemd-timedat" path="/usr/lib/systemd/ntp-units.d" dev="dm-1" ino=4700094 scontext=system_u:system_r:ntpd_t:s0 tcontext=system_u:object_r:systemd_unit_t:s0 tclass=dir permissive=1
> 
> Signed-off-by: Dave Sugar <dsugar@tresys.com>
> ---
>   policy/modules/services/ntp.te |  3 +++
>   policy/modules/system/init.if  | 10 ++++++++++
>   2 files changed, 13 insertions(+)
> 
> diff --git a/policy/modules/services/ntp.te b/policy/modules/services/ntp.te
> index eff38486..85747e76 100644
> --- a/policy/modules/services/ntp.te
> +++ b/policy/modules/services/ntp.te
> @@ -138,10 +138,13 @@ userdom_dontaudit_use_unpriv_user_fds(ntpd_t)
>   userdom_list_user_home_dirs(ntpd_t)
>   
>   ifdef(`init_systemd',`
> +	allow ntpd_t ntpd_unit_t:file read_file_perms;
> +
>   	dbus_system_bus_client(ntpd_t)
>   	dbus_connect_system_bus(ntpd_t)
>   	init_dbus_chat(ntpd_t)
>   	init_get_system_status(ntpd_t)
> +	init_list_unit_dirs(ntpd_t)
>   	# for /var/lib/systemd/timesync
>   	init_read_var_lib_links(ntpd_t)
>   	allow ntpd_t self:capability { fowner setpcap };
> diff --git a/policy/modules/system/init.if b/policy/modules/system/init.if
> index 2a17910e..4f4d4d2c 100644
> --- a/policy/modules/system/init.if
> +++ b/policy/modules/system/init.if
> @@ -2960,6 +2960,16 @@ interface(`init_search_units',`
>   	fs_search_tmpfs($1)
>   ')
>   
> +interface(`init_list_unit_dirs',`
> +	gen_require(`
> +		type systemd_unit_t;
> +	')
> +
> +	allow $1 systemd_unit_t:dir list_dir_perms;
> +
> +	init_search_units($1)
> +')

Missing documentation.



-- 
Chris PeBenito

      reply index

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-20  0:20 [PATCH 0/4] Resolve issues using /usr/bin/timedatectl Sugar, David
2019-03-20  0:20 ` [PATCH 1/4] Add interface ntp_dbus_chat Sugar, David
2019-03-24 18:36   ` Chris PeBenito
2019-03-20  0:20 ` [PATCH 2/4] Allow ntpd to update chronyd service Sugar, David
2019-03-24 18:36   ` Chris PeBenito
2019-03-20  0:20 ` [PATCH 3/4] Allow ntpd to update timezone symlink Sugar, David
2019-03-24 18:36   ` Chris PeBenito
2019-03-20  0:20 ` [PATCH 4/4] Allow ntpd to read unit files Sugar, David
2019-03-24 18:36   ` Chris PeBenito [this message]

Reply instructions:

You may reply publically 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=67d9f37e-3ecc-d11e-f5db-5f494ed62501@ieee.org \
    --to=pebenito@ieee.org \
    --cc=dsugar@tresys.com \
    --cc=selinux-refpolicy@vger.kernel.org \
    /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

SELinux-Refpolicy Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/selinux-refpolicy/0 selinux-refpolicy/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 selinux-refpolicy selinux-refpolicy/ https://lore.kernel.org/selinux-refpolicy \
		selinux-refpolicy@vger.kernel.org selinux-refpolicy@archiver.kernel.org
	public-inbox-index selinux-refpolicy


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.selinux-refpolicy


AGPL code for this site: git clone https://public-inbox.org/ public-inbox