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