-
Notifications
You must be signed in to change notification settings - Fork 0
/
custodia.te
95 lines (69 loc) · 2.69 KB
/
custodia.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
policy_module(custodia, 1.0.0)
########################################
#
# Declarations
#
type custodia_t;
type custodia_exec_t;
init_daemon_domain(custodia_t, custodia_exec_t)
permissive custodia_t;
type custodia_log_t;
logging_log_file(custodia_log_t)
type custodia_etc_t;
files_type(custodia_etc_t)
type custodia_keytab_t;
files_type(custodia_keytab_t)
type custodia_var_lib_t;
files_type(custodia_var_lib_t)
type custodia_var_run_t;
files_pid_file(custodia_var_run_t)
type custodia_unit_file_t;
systemd_unit_file(custodia_unit_file_t)
########################################
#
# custodia local policy
#
allow custodia_t self:fifo_file rw_fifo_file_perms;
allow custodia_t self:unix_stream_socket create_stream_socket_perms;
allow custodia_t self:capability net_admin;
allow custodia_t self:unix_dgram_socket { create getopt setopt };
allow custodia_t self:tcp_socket { accept connect create getattr getopt setopt shutdown };
allow custodia_t self:udp_socket { connect create getattr };
allow custodia_t self:process execmem;
allow custodia_t custodia_etc_t:file { getattr ioctl open read };
allow custodia_t custodia_keytab_t:file { getattr ioctl open read };
manage_dirs_pattern(custodia_t, custodia_log_t, custodia_log_t)
manage_files_pattern(custodia_t, custodia_log_t, custodia_log_t)
manage_lnk_files_pattern(custodia_t, custodia_log_t, custodia_log_t)
logging_log_filetrans(custodia_t, custodia_log_t, { dir file lnk_file })
manage_dirs_pattern(custodia_t, custodia_var_lib_t, custodia_var_lib_t)
manage_files_pattern(custodia_t, custodia_var_lib_t, custodia_var_lib_t)
manage_lnk_files_pattern(custodia_t, custodia_var_lib_t, custodia_var_lib_t)
files_var_lib_filetrans(custodia_t, custodia_var_lib_t, { dir file lnk_file })
manage_dirs_pattern(custodia_t, custodia_var_run_t, custodia_var_run_t)
manage_files_pattern(custodia_t, custodia_var_run_t, custodia_var_run_t)
manage_lnk_files_pattern(custodia_t, custodia_var_run_t, custodia_var_run_t)
files_pid_filetrans(custodia_t, custodia_var_run_t, { dir file lnk_file })
kernel_read_network_state(custodia_t)
kernel_read_system_state(custodia_t)
kernel_dgram_send(custodia_t)
auth_read_passwd(custodia_t)
corecmd_exec_bin(custodia_t)
corenet_tcp_bind_generic_node(custodia_t)
dev_list_sysfs(custodia_t)
dev_read_rand(custodia_t)
miscfiles_read_generic_certs(custodia_t)
sysnet_read_config(custodia_t)
files_read_etc_files(custodia_t)
require {
type custodia_t;
class capability net_admin;
class unix_dgram_socket { create getopt setopt };
class tcp_socket { accept connect create name_bind name_connect setopt shutdown };
class udp_socket { connect create getattr };
}
require {
type custodia_t;
type custodia_etc_t;
class file { getattr ioctl open read };
}