Skip to content

Commit 3b05502

Browse files
author
Mike Christie
committed
igw: Add selinux support for ceph iscsi
This adds selinux support for the ceph iscsi daemons under the ceph github: ceph-iscsi-config - rbd-target-gw ceph-iscsi-cli - rbd-target-api We use tcmu-runner, but that will go into the core policy to avoid conflicts with gluster and distro bases. This requires the patches: ceph/ceph-iscsi-config#90 ceph/ceph-iscsi-cli#134 Signed-off-by: Mike Christie <[email protected]>
1 parent f981e10 commit 3b05502

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

selinux/ceph.fc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,14 @@
77
/usr/bin/ceph-fuse -- gen_context(system_u:object_r:ceph_exec_t,s0)
88
/usr/bin/ceph-osd -- gen_context(system_u:object_r:ceph_exec_t,s0)
99
/usr/bin/radosgw -- gen_context(system_u:object_r:ceph_exec_t,s0)
10+
/usr/bin/rbd-target-gw -- gen_context(system_u:object_r:ceph_exec_t,s0)
11+
/usr/bin/rbd-target-api -- gen_context(system_u:object_r:ceph_exec_t,s0)
1012

1113
/var/lib/ceph(/.*)? gen_context(system_u:object_r:ceph_var_lib_t,s0)
1214

1315
/var/log/ceph(/.*)? gen_context(system_u:object_r:ceph_log_t,s0)
1416
/var/log/radosgw(/.*)? gen_context(system_u:object_r:ceph_log_t,s0)
17+
/var/log/rbd-target-api(/.*)? gen_context(system_u:object_r:ceph_log_t,s0)
18+
/var/log/rbd-target-gw(/.*)? gen_context(system_u:object_r:ceph_log_t,s0)
1519

1620
/var/run/ceph(/.*)? gen_context(system_u:object_r:ceph_var_run_t,s0)

selinux/ceph.te

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,21 @@ policy_module(ceph, 1.1.1)
22

33
require {
44
type sysfs_t;
5+
type configfs_t;
6+
type commplex_main_port_t;
7+
type rpm_exec_t;
8+
type rpm_var_lib_t;
9+
type kernel_t;
510
type var_run_t;
611
type random_device_t;
712
type urandom_device_t;
813
type setfiles_t;
914
type nvme_device_t;
1015
class sock_file unlink;
11-
class lnk_file read;
12-
class dir read;
13-
class file { getattr read open };
16+
class tcp_socket name_connect_t;
17+
class lnk_file { create getattr read unlink };
18+
class dir { add_name create getattr open read remove_name rmdir search write };
19+
class file { create getattr open read rename unlink write };
1420
class blk_file { getattr ioctl open read write };
1521
class capability2 block_suspend;
1622
}
@@ -63,6 +69,7 @@ manage_lnk_files_pattern(ceph_t, ceph_var_run_t, ceph_var_run_t)
6369

6470
kernel_read_system_state(ceph_t)
6571
kernel_read_network_state(ceph_t)
72+
allow ceph_t kernel_t:system module_request;
6673

6774
corenet_all_recvfrom_unlabeled(ceph_t)
6875
corenet_all_recvfrom_netlabel(ceph_t)
@@ -75,9 +82,15 @@ corenet_sendrecv_cyphesis_server_packets(ceph_t)
7582
corenet_tcp_bind_cyphesis_port(ceph_t)
7683
corenet_tcp_sendrecv_cyphesis_port(ceph_t)
7784

85+
allow ceph_t commplex_main_port_t:tcp_socket name_connect;
86+
7887
corecmd_exec_bin(ceph_t)
7988
corecmd_exec_shell(ceph_t)
8089

90+
allow ceph_t rpm_exec_t:file getattr;
91+
allow ceph_t rpm_var_lib_t:dir { add_name write };
92+
allow ceph_t rpm_var_lib_t:file { create open };
93+
8194
dev_read_urand(ceph_t)
8295

8396
domain_read_all_domains_state(ceph_t)
@@ -111,6 +124,11 @@ allow ceph_t sysfs_t:dir read;
111124
allow ceph_t sysfs_t:file { read getattr open };
112125
allow ceph_t sysfs_t:lnk_file { read getattr };
113126

127+
allow ceph_t configfs_t:dir { add_name create getattr open read remove_name rmdir search write };
128+
allow ceph_t configfs_t:file { getattr open read write };
129+
allow ceph_t configfs_t:lnk_file { create getattr read unlink };
130+
131+
114132
allow ceph_t random_device_t:chr_file getattr;
115133
allow ceph_t urandom_device_t:chr_file getattr;
116134
allow ceph_t self:process setpgid;

0 commit comments

Comments
 (0)