aboutsummaryrefslogtreecommitdiff
blob: 29661dea009af98586b293dac66f25467019dd8f (plain)
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
policy_module(shorewall, 1.6.0)

########################################
#
# Declarations
#

type shorewall_t;
type shorewall_exec_t;
init_daemon_domain(shorewall_t, shorewall_exec_t)

type shorewall_initrc_exec_t;
init_script_file(shorewall_initrc_exec_t)

type shorewall_etc_t;
files_config_file(shorewall_etc_t)

type shorewall_lock_t;
files_lock_file(shorewall_lock_t)

type shorewall_tmp_t;
files_tmp_file(shorewall_tmp_t)

type shorewall_var_lib_t;
domain_entry_file(shorewall_t, shorewall_var_lib_t)

type shorewall_log_t;
logging_log_file(shorewall_log_t)

########################################
#
# Local policy
#

allow shorewall_t self:capability { dac_override net_admin net_raw setuid setgid sys_nice sys_admin };
dontaudit shorewall_t self:capability sys_tty_config;
allow shorewall_t self:fifo_file rw_fifo_file_perms;
allow shorewall_t self:netlink_socket create_socket_perms;

read_files_pattern(shorewall_t, shorewall_etc_t, shorewall_etc_t)
list_dirs_pattern(shorewall_t, shorewall_etc_t, shorewall_etc_t)

manage_files_pattern(shorewall_t, shorewall_lock_t, shorewall_lock_t)
files_lock_filetrans(shorewall_t, shorewall_lock_t, file)

manage_dirs_pattern(shorewall_t, shorewall_log_t, shorewall_log_t)
append_files_pattern(shorewall_t, shorewall_log_t, shorewall_log_t)
create_files_pattern(shorewall_t, shorewall_log_t, shorewall_log_t)
setattr_files_pattern(shorewall_t, shorewall_log_t, shorewall_log_t)
logging_log_filetrans(shorewall_t, shorewall_log_t, { file dir })

manage_dirs_pattern(shorewall_t, shorewall_tmp_t, shorewall_tmp_t)
manage_files_pattern(shorewall_t, shorewall_tmp_t, shorewall_tmp_t)
files_tmp_filetrans(shorewall_t, shorewall_tmp_t, { file dir })

exec_files_pattern(shorewall_t, shorewall_var_lib_t, shorewall_var_lib_t)
manage_dirs_pattern(shorewall_t, shorewall_var_lib_t, shorewall_var_lib_t)
manage_files_pattern(shorewall_t, shorewall_var_lib_t, shorewall_var_lib_t)
files_var_lib_filetrans(shorewall_t, shorewall_var_lib_t, { dir file })

allow shorewall_t shorewall_initrc_exec_t:file read_file_perms;

kernel_read_kernel_sysctls(shorewall_t)
kernel_read_network_state(shorewall_t)
kernel_read_system_state(shorewall_t)
kernel_rw_net_sysctls(shorewall_t)

corecmd_exec_bin(shorewall_t)
corecmd_exec_shell(shorewall_t)

dev_read_sysfs(shorewall_t)
dev_read_urand(shorewall_t)

domain_read_all_domains_state(shorewall_t)

files_getattr_kernel_modules(shorewall_t)
files_read_usr_files(shorewall_t)
files_search_kernel_modules(shorewall_t)

fs_getattr_all_fs(shorewall_t)

auth_use_nsswitch(shorewall_t)

init_rw_utmp(shorewall_t)

logging_read_generic_logs(shorewall_t)
logging_send_syslog_msg(shorewall_t)

miscfiles_read_localization(shorewall_t)

sysnet_domtrans_ifconfig(shorewall_t)

userdom_dontaudit_list_user_home_dirs(shorewall_t)
userdom_use_user_terminals(shorewall_t)

optional_policy(`
	brctl_domtrans(shorewall_t)
')

optional_policy(`
	hostname_exec(shorewall_t)
')

optional_policy(`
	iptables_domtrans(shorewall_t)
')

optional_policy(`
	modutils_domtrans_insmod(shorewall_t)
')

optional_policy(`
	ulogd_search_log(shorewall_t)
')