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