1 |
commit: 2c2c9b394efb09bf61c6bd82d470d76d3e8d30b4 |
2 |
Author: Kenton Groombridge <me <AT> concord <DOT> sh> |
3 |
AuthorDate: Fri Mar 11 05:07:56 2022 +0000 |
4 |
Commit: Jason Zaman <perfinion <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Apr 9 19:28:30 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=2c2c9b39 |
7 |
|
8 |
container, podman: allow podman to create and write config files |
9 |
|
10 |
Podman 4.0 now creates the CNI network config files if they do not |
11 |
exist. |
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 | 38 ++++++++++++++++++++++++++++++++++++ |
17 |
policy/modules/services/podman.te | 4 ++++ |
18 |
2 files changed, 42 insertions(+) |
19 |
|
20 |
diff --git a/policy/modules/services/container.if b/policy/modules/services/container.if |
21 |
index e9217f63..bf5ecfb5 100644 |
22 |
--- a/policy/modules/services/container.if |
23 |
+++ b/policy/modules/services/container.if |
24 |
@@ -738,6 +738,44 @@ interface(`container_mountpoint',` |
25 |
typeattribute $1 container_mountpoint_type; |
26 |
') |
27 |
|
28 |
+######################################## |
29 |
+## <summary> |
30 |
+## Allow the specified domain to |
31 |
+## create container config files. |
32 |
+## </summary> |
33 |
+## <param name="domain"> |
34 |
+## <summary> |
35 |
+## Domain allowed access. |
36 |
+## </summary> |
37 |
+## </param> |
38 |
+# |
39 |
+interface(`container_create_config_files',` |
40 |
+ gen_require(` |
41 |
+ type container_config_t; |
42 |
+ ') |
43 |
+ |
44 |
+ create_files_pattern($1, container_config_t, container_config_t) |
45 |
+') |
46 |
+ |
47 |
+######################################## |
48 |
+## <summary> |
49 |
+## Allow the specified domain to |
50 |
+## write container config files. |
51 |
+## </summary> |
52 |
+## <param name="domain"> |
53 |
+## <summary> |
54 |
+## Domain allowed access. |
55 |
+## </summary> |
56 |
+## </param> |
57 |
+# |
58 |
+interface(`container_write_config_files',` |
59 |
+ gen_require(` |
60 |
+ type container_config_t; |
61 |
+ ') |
62 |
+ |
63 |
+ write_files_pattern($1, container_config_t, container_config_t) |
64 |
+') |
65 |
+ |
66 |
######################################## |
67 |
## <summary> |
68 |
## Allow the specified domain to |
69 |
|
70 |
diff --git a/policy/modules/services/podman.te b/policy/modules/services/podman.te |
71 |
index dfb8e5da..5df45d32 100644 |
72 |
--- a/policy/modules/services/podman.te |
73 |
+++ b/policy/modules/services/podman.te |
74 |
@@ -39,6 +39,10 @@ allow podman_t podman_conmon_t:unix_stream_socket { connectto rw_stream_socket_p |
75 |
|
76 |
container_engine_executable_entrypoint(podman_t) |
77 |
|
78 |
+# podman 4.0.0 now creates OCI networking configs |
79 |
+container_create_config_files(podman_t) |
80 |
+container_write_config_files(podman_t) |
81 |
+ |
82 |
domtrans_pattern(podman_t, podman_conmon_exec_t, podman_conmon_t) |
83 |
|
84 |
logging_send_syslog_msg(podman_t) |