Gentoo Archives: gentoo-commits

From: Jason Zaman <perfinion@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/hardened-refpolicy:master commit in: policy/modules/services/
Date: Sat, 03 Sep 2022 19:10:22
Message-Id: 1662230515.cd84d1468359c3bbf0c2c482a1474a9ebd18e3b3.perfinion@gentoo
1 commit: cd84d1468359c3bbf0c2c482a1474a9ebd18e3b3
2 Author: Kenton Groombridge <me <AT> concord <DOT> sh>
3 AuthorDate: Sat Apr 2 19:55:24 2022 +0000
4 Commit: Jason Zaman <perfinion <AT> gentoo <DOT> org>
5 CommitDate: Sat Sep 3 18:41:55 2022 +0000
6 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=cd84d146
7
8 container, podman: allow podman to restart container units
9
10 podman auto-update will automatically start the container unit when it
11 is updated.
12
13 Signed-off-by: Kenton Groombridge <me <AT> concord.sh>
14 Signed-off-by: Jason Zaman <perfinion <AT> gentoo.org>
15
16 policy/modules/services/container.if | 20 ++++++++++++++++++++
17 policy/modules/services/podman.te | 4 ++++
18 2 files changed, 24 insertions(+)
19
20 diff --git a/policy/modules/services/container.if b/policy/modules/services/container.if
21 index 541eb8a5..07ef8873 100644
22 --- a/policy/modules/services/container.if
23 +++ b/policy/modules/services/container.if
24 @@ -1382,6 +1382,26 @@ interface(`container_unlabeled_var_lib_filetrans',`
25 kernel_unlabeled_filetrans($1, container_var_lib_t, $2, $3)
26 ')
27
28 +########################################
29 +## <summary>
30 +## Allow the specified domain to start
31 +## systemd units for containers.
32 +## </summary>
33 +## <param name="domain">
34 +## <summary>
35 +## Domain allowed access.
36 +## </summary>
37 +## </param>
38 +#
39 +interface(`container_start_units',`
40 + gen_require(`
41 + type container_unit_t;
42 + class service start;
43 + ')
44 +
45 + allow $1 container_unit_t:service start;
46 +')
47 +
48 ########################################
49 ## <summary>
50 ## All of the rules required to
51
52 diff --git a/policy/modules/services/podman.te b/policy/modules/services/podman.te
53 index 3169c0da..12c67145 100644
54 --- a/policy/modules/services/podman.te
55 +++ b/policy/modules/services/podman.te
56 @@ -77,6 +77,10 @@ ifdef(`init_systemd',`
57 systemd_list_journal_dirs(podman_t)
58 systemd_read_journal_files(podman_t)
59 systemd_watch_journal_dirs(podman_t)
60 +
61 + # podman auto-update will restart the unit for
62 + # the container when it is updated
63 + container_start_units(podman_t)
64 ')
65
66 ########################################