]> git.proxmox.com Git - ceph.git/blob - ceph/selinux/ceph.te
bump version to 18.2.2-pve1
[ceph.git] / ceph / selinux / ceph.te
1 policy_module(ceph, 1.1.1)
2
3 require {
4 type sysfs_t;
5 type configfs_t;
6 type commplex_main_port_t;
7 type http_cache_port_t;
8 type rpm_exec_t;
9 type rpm_var_lib_t;
10 type kernel_t;
11 type var_run_t;
12 type random_device_t;
13 type urandom_device_t;
14 type setfiles_t;
15 type nvme_device_t;
16 type targetd_etc_rw_t;
17 type amqp_port_t;
18 type soundd_port_t;
19 class sock_file unlink;
20 class tcp_socket name_connect_t;
21 class lnk_file { create getattr read unlink };
22 class dir { add_name create getattr open read remove_name rmdir search write };
23 class file { create getattr open read rename unlink write ioctl };
24 class blk_file { getattr ioctl open read write };
25 class capability2 block_suspend;
26 class process2 { nnp_transition nosuid_transition };
27 }
28
29 ########################################
30 #
31 # Declarations
32 #
33
34 type ceph_t;
35 type ceph_exec_t;
36 init_daemon_domain(ceph_t, ceph_exec_t)
37 ceph_exec(ceph_t)
38
39 permissive ceph_t;
40
41 type ceph_initrc_exec_t;
42 init_script_file(ceph_initrc_exec_t)
43
44 type ceph_log_t;
45 logging_log_file(ceph_log_t)
46
47 type ceph_var_lib_t;
48 files_type(ceph_var_lib_t)
49
50 type ceph_var_run_t;
51 files_pid_file(ceph_var_run_t)
52
53 ########################################
54 #
55 # ceph local policy
56 #
57
58 allow ceph_t self:process { signal_perms };
59 allow ceph_t self:fifo_file rw_fifo_file_perms;
60 allow ceph_t self:unix_stream_socket create_stream_socket_perms;
61 allow ceph_t self:capability { setuid setgid dac_override dac_read_search };
62 allow ceph_t self:capability2 block_suspend;
63
64 manage_dirs_pattern(ceph_t, ceph_log_t, ceph_log_t)
65 manage_files_pattern(ceph_t, ceph_log_t, ceph_log_t)
66 manage_lnk_files_pattern(ceph_t, ceph_log_t, ceph_log_t)
67
68 manage_dirs_pattern(ceph_t, ceph_var_lib_t, ceph_var_lib_t)
69 manage_files_pattern(ceph_t, ceph_var_lib_t, ceph_var_lib_t)
70 manage_lnk_files_pattern(ceph_t, ceph_var_lib_t, ceph_var_lib_t)
71
72 manage_dirs_pattern(ceph_t, ceph_var_run_t, ceph_var_run_t)
73 manage_files_pattern(ceph_t, ceph_var_run_t, ceph_var_run_t)
74 manage_lnk_files_pattern(ceph_t, ceph_var_run_t, ceph_var_run_t)
75
76 kernel_read_system_state(ceph_t)
77 kernel_read_network_state(ceph_t)
78 ifdef(`kernel_io_uring_use',`
79 kernel_io_uring_use(ceph_t)
80 ')
81 allow ceph_t kernel_t:system module_request;
82
83 corenet_all_recvfrom_unlabeled(ceph_t)
84 corenet_all_recvfrom_netlabel(ceph_t)
85 corenet_udp_sendrecv_generic_if(ceph_t)
86 corenet_udp_sendrecv_generic_node(ceph_t)
87 corenet_udp_bind_generic_node(ceph_t)
88 corenet_tcp_bind_generic_node(ceph_t)
89
90 corenet_sendrecv_cyphesis_server_packets(ceph_t)
91 corenet_tcp_bind_cyphesis_port(ceph_t)
92 corenet_tcp_sendrecv_cyphesis_port(ceph_t)
93
94 allow ceph_t commplex_main_port_t:tcp_socket name_connect;
95 allow ceph_t http_cache_port_t:tcp_socket name_connect;
96 allow ceph_t amqp_port_t:tcp_socket name_connect;
97 allow ceph_t soundd_port_t:tcp_socket name_connect;
98
99 corecmd_exec_bin(ceph_t)
100 corecmd_exec_shell(ceph_t)
101
102 allow ceph_t rpm_exec_t:file getattr;
103 allow ceph_t rpm_var_lib_t:dir { add_name write };
104 allow ceph_t rpm_var_lib_t:file { create open };
105
106 dev_read_urand(ceph_t)
107
108 domain_read_all_domains_state(ceph_t)
109
110 fs_getattr_all_fs(ceph_t)
111
112 auth_use_nsswitch(ceph_t)
113
114 logging_send_syslog_msg(ceph_t)
115
116 sysnet_dns_name_resolve(ceph_t)
117
118 udev_read_db(ceph_t)
119
120 allow ceph_t nvme_device_t:blk_file { getattr ioctl open read write };
121
122 # basis for future security review
123 allow ceph_t ceph_var_run_t:sock_file { create unlink write setattr };
124 allow ceph_t self:capability { sys_rawio chown };
125
126 allow ceph_t self:tcp_socket { accept listen };
127 corenet_tcp_connect_cyphesis_port(ceph_t)
128 corenet_tcp_connect_generic_port(ceph_t)
129 files_list_tmp(ceph_t)
130 files_manage_generic_tmp_files(ceph_t)
131 fstools_exec(ceph_t)
132 nis_use_ypbind_uncond(ceph_t)
133 storage_raw_rw_fixed_disk(ceph_t)
134 files_manage_generic_locks(ceph_t)
135 libs_exec_ldconfig(ceph_t)
136 fs_list_hugetlbfs(ceph_t)
137 fs_list_tmpfs(ceph_t)
138 fs_read_cgroup_files(ceph_t)
139 fs_read_tmpfs_symlinks(ceph_t)
140 fs_search_cgroup_dirs(ceph_t)
141 ceph_read_lib_files(init_t)
142
143 allow ceph_t sysfs_t:dir read;
144 allow ceph_t sysfs_t:file { read getattr open };
145 allow ceph_t sysfs_t:lnk_file { read getattr };
146
147 allow ceph_t configfs_t:dir { add_name create getattr open read remove_name rmdir search write };
148 allow ceph_t configfs_t:file { getattr open read write ioctl };
149 allow ceph_t configfs_t:lnk_file { create getattr read unlink };
150
151
152 allow ceph_t random_device_t:chr_file getattr;
153 allow ceph_t urandom_device_t:chr_file getattr;
154 allow ceph_t self:process setpgid;
155 allow ceph_t self:process setsched;
156 allow ceph_t var_run_t:dir { write create add_name };
157 allow ceph_t var_run_t:file { read write create open getattr };
158 allow ceph_t init_var_run_t:file getattr;
159 allow init_t ceph_t:process2 { nnp_transition nosuid_transition };
160
161 allow ceph_t targetd_etc_rw_t:dir { getattr search };
162
163 fsadm_manage_pid(ceph_t)
164
165 #============= setfiles_t ==============
166 allow setfiles_t ceph_var_lib_t:file write;