forked from pulp/pulpcore-selinux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pulpcore.te
175 lines (136 loc) · 5.42 KB
/
pulpcore.te
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
policy_module(pulpcore, 1.2.0)
########################################
#
# Declarations
#
type pulpcore_t;
type pulpcore_exec_t;
init_daemon_domain(pulpcore_t, pulpcore_exec_t)
init_nnp_daemon_domain(pulpcore_t)
permissive pulpcore_t;
type pulpcore_server_t;
type pulpcore_server_exec_t;
init_daemon_domain(pulpcore_server_t, pulpcore_server_exec_t)
init_nnp_daemon_domain(pulpcore_server_t)
permissive pulpcore_server_t;
type pulpcore_etc_t;
files_config_file(pulpcore_etc_t)
type pulpcore_var_lib_t;
files_type(pulpcore_var_lib_t)
type pulpcore_server_var_lib_t;
files_type(pulpcore_server_var_lib_t)
type pulpcore_var_run_t;
files_pid_file(pulpcore_var_run_t)
type pulpcore_server_var_run_t;
files_pid_file(pulpcore_server_var_run_t)
type pulpcore_tmp_t;
files_tmp_file(pulpcore_tmp_t)
type pulpcore_server_tmp_t;
files_tmp_file(pulpcore_server_tmp_t)
type pulpcore_server_tmpfs_t;
files_tmpfs_file(pulpcore_server_tmpfs_t);
########################################
#
# pulpcore/pulpcore_server local policy
#
allow pulpcore_t pulpcore_server_exec_t:file getattr;
allow pulpcore_server_t pulpcore_exec_t:file getattr;
allow pulpcore_server_t self:fifo_file rw_fifo_file_perms;
allow pulpcore_server_t self:unix_stream_socket create_stream_socket_perms;
allow pulpcore_server_t self:netlink_route_socket { create_socket_perms nlmsg_read };
allow pulpcore_server_t self:tcp_socket create_stream_socket_perms;
allow pulpcore_server_t self:udp_socket create_stream_socket_perms;
# /etc
read_files_pattern(pulpcore_t, pulpcore_etc_t, pulpcore_etc_t)
read_files_pattern(pulpcore_server_t, pulpcore_etc_t, pulpcore_etc_t)
# /var/lib
manage_dirs_pattern(pulpcore_t, pulpcore_var_lib_t, pulpcore_var_lib_t)
manage_files_pattern(pulpcore_t, pulpcore_var_lib_t, pulpcore_var_lib_t)
manage_dirs_pattern(pulpcore_server_t, pulpcore_server_var_lib_t, pulpcore_server_var_lib_t)
manage_files_pattern(pulpcore_server_t, pulpcore_server_var_lib_t, pulpcore_server_var_lib_t)
manage_dirs_pattern(pulpcore_t, pulpcore_server_var_lib_t, pulpcore_server_var_lib_t)
manage_files_pattern(pulpcore_t, pulpcore_server_var_lib_t, pulpcore_server_var_lib_t)
filetrans_pattern(pulpcore_server_t, pulpcore_var_lib_t, pulpcore_server_var_lib_t, { dir file })
manage_dirs_pattern(pulpcore_server_t, pulpcore_var_lib_t, pulpcore_var_lib_t)
manage_files_pattern(pulpcore_server_t, pulpcore_var_lib_t, pulpcore_var_lib_t)
read_lnk_files_pattern(pulpcore_server_t, pulpcore_var_lib_t, pulpcore_var_lib_t)
write_sock_files_pattern(pulpcore_t, pulpcore_var_lib_t, pulpcore_var_lib_t)
# /run
manage_dirs_pattern(pulpcore_t, pulpcore_var_run_t, pulpcore_var_run_t)
manage_files_pattern(pulpcore_t, pulpcore_var_run_t, pulpcore_var_run_t)
files_pid_filetrans(pulpcore_t, pulpcore_var_run_t, { dir file sock_file})
manage_dirs_pattern(pulpcore_server_t, pulpcore_server_var_run_t, pulpcore_server_var_run_t)
manage_files_pattern(pulpcore_server_t, pulpcore_server_var_run_t, pulpcore_server_var_run_t)
manage_sock_files_pattern(pulpcore_server_t, pulpcore_server_var_run_t, pulpcore_server_var_run_t)
files_pid_filetrans(pulpcore_server_t, pulpcore_server_var_run_t, { dir file sock_file})
# /tmp
manage_dirs_pattern(pulpcore_t, pulpcore_tmp_t, pulpcore_tmp_t)
manage_files_pattern(pulpcore_t, pulpcore_tmp_t, pulpcore_tmp_t)
manage_lnk_files_pattern(pulpcore_t, pulpcore_tmp_t, pulpcore_tmp_t)
files_tmp_filetrans(pulpcore_t, pulpcore_tmp_t, { file dir })
manage_dirs_pattern(pulpcore_server_t, pulpcore_server_tmp_t, pulpcore_server_tmp_t)
manage_files_pattern(pulpcore_server_t, pulpcore_server_tmp_t, pulpcore_server_tmp_t)
files_tmp_filetrans(pulpcore_server_t, pulpcore_server_tmp_t, { file dir })
# /dev/shm
manage_files_pattern(pulpcore_t, pulpcore_server_tmpfs_t, pulpcore_server_tmpfs_t)
fs_tmpfs_filetrans(pulpcore_t, pulpcore_server_tmpfs_t, file )
allow pulpcore_t pulpcore_server_tmpfs_t:file map;
# interface calls
kernel_read_all_proc(pulpcore_t)
kernel_read_all_proc(pulpcore_server_t)
auth_use_nsswitch(pulpcore_server_t)
auth_use_nsswitch(pulpcore_t)
can_exec(pulpcore_t, pulpcore_var_lib_t)
corecmd_exec_bin(pulpcore_t)
corecmd_exec_shell(pulpcore_t)
corecmd_exec_bin(pulpcore_server_t)
corecmd_exec_shell(pulpcore_server_t)
corenet_tcp_connect_http_port(pulpcore_t)
corenet_tcp_connect_postgresql_port(pulpcore_t)
corenet_tcp_connect_pulpcore_port(pulpcore_t)
corenet_tcp_connect_redis_port(pulpcore_t)
corenet_tcp_bind_pulpcore_port(pulpcore_server_t)
corenet_tcp_connect_http_port(pulpcore_server_t)
corenet_tcp_connect_postgresql_port(pulpcore_server_t)
corenet_tcp_connect_redis_port(pulpcore_server_t)
fs_getattr_tmpfs(pulpcore_t)
fs_getattr_xattr_fs(pulpcore_t)
fs_getattr_xattr_fs(pulpcore_server_t)
libs_exec_ldconfig(pulpcore_t)
libs_exec_ldconfig(pulpcore_server_t)
miscfiles_read_generic_certs(pulpcore_t)
sysnet_read_config(pulpcore_t)
optional_policy(`
gpg_exec(pulpcore_t)
')
optional_policy(`
kerberos_read_keytab(pulpcore_t)
kerberos_read_keytab(pulpcore_server_t)
')
optional_policy(`
postgresql_stream_connect(pulpcore_t)
postgresql_stream_connect(pulpcore_server_t)
')
optional_policy(`
redis_stream_connect(pulpcore_t)
redis_stream_connect(pulpcore_server_t)
')
optional_policy(`
unconfined_stream_connect(pulpcore_t)
')
########################################
#
# Local policy for external domains
#
optional_policy(`
gen_require(`
type httpd_t;
')
pulpcore_server_stream_connect(httpd_t)
')
optional_policy(`
gen_require(`
type init_t;
')
pulpcore_filetrans_named_content(init_t)
')