]> git.proxmox.com Git - ceph.git/blob - ceph/selinux/ceph.te
update sources to 12.2.7
[ceph.git] / ceph / selinux / ceph.te
1 policy_module(ceph, 1.1.1)
2
3 require {
4 type sysfs_t;
5 type var_run_t;
6 type random_device_t;
7 type urandom_device_t;
8 type setfiles_t;
9 type nvme_device_t;
10 class sock_file unlink;
11 class lnk_file read;
12 class dir read;
13 class file { getattr read open };
14 class blk_file { getattr ioctl open read write };
15 class capability2 block_suspend;
16 }
17
18 ########################################
19 #
20 # Declarations
21 #
22
23 type ceph_t;
24 type ceph_exec_t;
25 init_daemon_domain(ceph_t, ceph_exec_t)
26
27 permissive ceph_t;
28
29 type ceph_initrc_exec_t;
30 init_script_file(ceph_initrc_exec_t)
31
32 type ceph_log_t;
33 logging_log_file(ceph_log_t)
34
35 type ceph_var_lib_t;
36 files_type(ceph_var_lib_t)
37
38 type ceph_var_run_t;
39 files_pid_file(ceph_var_run_t)
40
41 ########################################
42 #
43 # ceph local policy
44 #
45
46 allow ceph_t self:process { signal_perms };
47 allow ceph_t self:fifo_file rw_fifo_file_perms;
48 allow ceph_t self:unix_stream_socket create_stream_socket_perms;
49 allow ceph_t self:capability { setuid setgid dac_override };
50 allow ceph_t self:capability2 block_suspend;
51
52 manage_dirs_pattern(ceph_t, ceph_log_t, ceph_log_t)
53 manage_files_pattern(ceph_t, ceph_log_t, ceph_log_t)
54 manage_lnk_files_pattern(ceph_t, ceph_log_t, ceph_log_t)
55
56 manage_dirs_pattern(ceph_t, ceph_var_lib_t, ceph_var_lib_t)
57 manage_files_pattern(ceph_t, ceph_var_lib_t, ceph_var_lib_t)
58 manage_lnk_files_pattern(ceph_t, ceph_var_lib_t, ceph_var_lib_t)
59
60 manage_dirs_pattern(ceph_t, ceph_var_run_t, ceph_var_run_t)
61 manage_files_pattern(ceph_t, ceph_var_run_t, ceph_var_run_t)
62 manage_lnk_files_pattern(ceph_t, ceph_var_run_t, ceph_var_run_t)
63
64 kernel_read_system_state(ceph_t)
65 kernel_read_network_state(ceph_t)
66
67 corenet_all_recvfrom_unlabeled(ceph_t)
68 corenet_all_recvfrom_netlabel(ceph_t)
69 corenet_udp_sendrecv_generic_if(ceph_t)
70 corenet_udp_sendrecv_generic_node(ceph_t)
71 corenet_udp_bind_generic_node(ceph_t)
72 corenet_tcp_bind_generic_node(ceph_t)
73
74 corenet_sendrecv_cyphesis_server_packets(ceph_t)
75 corenet_tcp_bind_cyphesis_port(ceph_t)
76 corenet_tcp_sendrecv_cyphesis_port(ceph_t)
77
78 corecmd_exec_bin(ceph_t)
79 corecmd_exec_shell(ceph_t)
80
81 dev_read_urand(ceph_t)
82
83 domain_read_all_domains_state(ceph_t)
84
85 fs_getattr_all_fs(ceph_t)
86
87 auth_use_nsswitch(ceph_t)
88
89 logging_send_syslog_msg(ceph_t)
90
91 sysnet_dns_name_resolve(ceph_t)
92
93 allow ceph_t nvme_device_t:blk_file { getattr ioctl open read write };
94
95 # basis for future security review
96 allow ceph_t ceph_var_run_t:sock_file { create unlink write setattr };
97 allow ceph_t self:capability { sys_rawio chown };
98
99 allow ceph_t self:tcp_socket { accept listen };
100 corenet_tcp_connect_cyphesis_port(ceph_t)
101 corenet_tcp_connect_generic_port(ceph_t)
102 files_list_tmp(ceph_t)
103 files_manage_generic_tmp_files(ceph_t)
104 fstools_exec(ceph_t)
105 nis_use_ypbind_uncond(ceph_t)
106 storage_raw_rw_fixed_disk(ceph_t)
107 files_manage_generic_locks(ceph_t)
108 libs_exec_ldconfig(ceph_t)
109
110 allow ceph_t sysfs_t:dir read;
111 allow ceph_t sysfs_t:file { read getattr open };
112 allow ceph_t sysfs_t:lnk_file { read getattr };
113
114 allow ceph_t random_device_t:chr_file getattr;
115 allow ceph_t urandom_device_t:chr_file getattr;
116 allow ceph_t self:process setpgid;
117 allow ceph_t var_run_t:dir { write create add_name };
118 allow ceph_t var_run_t:file { read write create open getattr };
119
120 fsadm_manage_pid(ceph_t)
121
122 #============= setfiles_t ==============
123 allow setfiles_t ceph_var_lib_t:file write;