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