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