-
Notifications
You must be signed in to change notification settings - Fork 10
/
fapolicyd.te
107 lines (82 loc) · 3.09 KB
/
fapolicyd.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
policy_module(fapolicyd, 1.0.0)
########################################
#
# Declarations
#
type fapolicyd_t;
type fapolicyd_exec_t;
init_daemon_domain(fapolicyd_t, fapolicyd_exec_t)
type fapolicyd_config_t;
files_type(fapolicyd_config_t)
files_ro_base_file(fapolicyd_config_t)
type fapolicyd_var_lib_t;
files_type(fapolicyd_var_lib_t)
type fapolicyd_log_t;
logging_log_file(fapolicyd_log_t)
type fapolicyd_unit_file_t;
systemd_unit_file(fapolicyd_unit_file_t)
type fapolicyd_var_run_t;
files_pid_file(fapolicyd_var_run_t)
########################################
#
# fapolicyd local policy
#
allow fapolicyd_t self:capability { audit_write chown dac_override setgid setuid sys_admin sys_nice sys_ptrace };
allow fapolicyd_t self:cap_userns sys_ptrace;
allow fapolicyd_t self:fifo_file rw_fifo_file_perms;
allow fapolicyd_t self:process { setcap setsched };
allow fapolicyd_t self:unix_stream_socket create_stream_socket_perms;
allow fapolicyd_t self:unix_dgram_socket create_socket_perms;
gen_require(`
attribute file_type;
attribute filesystem_type;
attribute mountpoint;
')
ifdef(`watch_mount_dirs_pattern',`
watch_mount_dirs_pattern(fapolicyd_t, file_type, file_type)
watch_with_perm_dirs_pattern(fapolicyd_t, file_type, file_type)
allow fapolicyd_t file_type:file { watch_mount watch_with_perm };
')
ifdef(`fs_watch_all_fs',`
fs_watch_all_fs(fapolicyd_t)
files_watch_sb_all_mountpoints(fapolicyd_t)
')
allow fapolicyd_t file_type : lnk_file { getattr read };
manage_files_pattern(fapolicyd_t, fapolicyd_log_t, fapolicyd_log_t)
logging_log_filetrans(fapolicyd_t, fapolicyd_log_t, file)
manage_dirs_pattern(fapolicyd_t, fapolicyd_var_lib_t, fapolicyd_var_lib_t)
manage_files_pattern(fapolicyd_t, fapolicyd_var_lib_t, fapolicyd_var_lib_t)
manage_lnk_files_pattern(fapolicyd_t, fapolicyd_var_lib_t, fapolicyd_var_lib_t)
mmap_read_files_pattern(fapolicyd_t, fapolicyd_var_lib_t, fapolicyd_var_lib_t)
files_var_lib_filetrans(fapolicyd_t, fapolicyd_var_lib_t, { dir file lnk_file })
manage_dirs_pattern(fapolicyd_t, fapolicyd_var_run_t, fapolicyd_var_run_t)
manage_files_pattern(fapolicyd_t, fapolicyd_var_run_t, fapolicyd_var_run_t)
manage_fifo_files_pattern(fapolicyd_t, fapolicyd_var_run_t,fapolicyd_var_run_t)
manage_lnk_files_pattern(fapolicyd_t, fapolicyd_var_run_t, fapolicyd_var_run_t)
files_pid_filetrans(fapolicyd_t, fapolicyd_var_run_t, { dir file fifo_file lnk_file })
kernel_dgram_send(fapolicyd_t)
kernel_read_all_sysctls(fapolicyd_t)
kernel_read_all_proc(fapolicyd_t)
auth_read_passwd(fapolicyd_t)
samba_stream_connect_winbind(fapolicyd_t)
corecmd_exec_bin(fapolicyd_t)
domain_read_all_domains_state(fapolicyd_t)
files_mmap_all_files(fapolicyd_t)
files_read_all_files(fapolicyd_t)
fs_getattr_xattr_fs(fapolicyd_t)
logging_send_syslog_msg(fapolicyd_t)
dbus_system_bus_client(fapolicyd_t)
optional_policy(`
rpm_read_db(fapolicyd_t)
rpm_manage_db(fapolicyd_t)
')
ifdef(`systemd_userdbd_stream_connect',`
optional_policy(`
systemd_userdbd_stream_connect(fapolicyd_t)
')
')
ifdef(`systemd_homed_stream_connect',`
optional_policy(`
systemd_homed_stream_connect(fapolicyd_t)
')
')