Skip to content

Commit 94b2618

Browse files
committed
Add containers_use_ecryptfs boolean
Signed-off-by: Daniel J Walsh <[email protected]>
1 parent 6e0cb6e commit 94b2618

File tree

1 file changed

+25
-5
lines changed

1 file changed

+25
-5
lines changed

container.te

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
policy_module(container, 2.196.1)
1+
policy_module(container, 2.197.0)
22

33
gen_require(`
44
class passwd rootok;
@@ -39,6 +39,14 @@ gen_tunable(container_manage_cgroup, false)
3939
## </desc>
4040
gen_tunable(container_use_cephfs, false)
4141

42+
## <desc>
43+
## <p>
44+
## Determine whether container can
45+
## use ecrypt file system
46+
## </p>
47+
## </desc>
48+
gen_tunable(container_use_ecryptfs, false)
49+
4250
attribute container_runtime_domain;
4351
container_runtime_domain_template(container_runtime)
4452
typealias container_runtime_t alias docker_t;
@@ -523,10 +531,6 @@ tunable_policy(`virt_use_samba',`
523531
allow container_domain cifs_t:file execmod;
524532
')
525533

526-
gen_require(`
527-
type cephfs_t;
528-
')
529-
530534
tunable_policy(`virt_use_nfs',`
531535
fs_manage_nfs_dirs(container_domain)
532536
fs_manage_nfs_files(container_domain)
@@ -538,6 +542,10 @@ tunable_policy(`virt_use_nfs',`
538542
allow container_domain nfs_t:file execmod;
539543
')
540544

545+
gen_require(`
546+
type cephfs_t;
547+
')
548+
541549
tunable_policy(`container_use_cephfs',`
542550
manage_files_pattern(container_domain, cephfs_t, cephfs_t)
543551
manage_lnk_files_pattern(container_domain, cephfs_t, cephfs_t)
@@ -546,6 +554,18 @@ tunable_policy(`container_use_cephfs',`
546554
allow container_domain cephfs_t:file execmod;
547555
')
548556

557+
gen_require(`
558+
type ecryptfs_t;
559+
')
560+
561+
tunable_policy(`container_use_ecryptfs',`
562+
manage_files_pattern(container_domain, ecryptfs_t, ecryptfs_t)
563+
manage_lnk_files_pattern(container_domain, ecryptfs_t, ecryptfs_t)
564+
manage_dirs_pattern(container_domain, ecryptfs_t, ecryptfs_t)
565+
exec_files_pattern(container_domain, ecryptfs_t, ecryptfs_t)
566+
allow container_domain ecryptfs_t:file execmod;
567+
')
568+
549569
fs_manage_fusefs_named_sockets(container_runtime_domain)
550570
fs_manage_fusefs_dirs(container_runtime_domain)
551571
fs_manage_fusefs_files(container_runtime_domain)

0 commit comments

Comments
 (0)