summaryrefslogtreecommitdiff
path: root/policy/modules/apps/webalizer.te
blob: adeb59d1aac8d3b4191d0d470f6865d442b57fbf (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

policy_module(webalizer, 1.8.0)

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

type webalizer_t;
type webalizer_exec_t;
application_domain(webalizer_t, webalizer_exec_t)
role system_r types webalizer_t;

type webalizer_etc_t;
files_config_file(webalizer_etc_t)

type webalizer_usage_t;
files_type(webalizer_usage_t)

type webalizer_tmp_t;
files_tmp_file(webalizer_tmp_t)

type webalizer_var_lib_t;
files_type(webalizer_var_lib_t)

type webalizer_write_t;
files_type(webalizer_write_t)

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

allow webalizer_t self:capability dac_override;
allow webalizer_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem execstack execheap };
allow webalizer_t self:fd use;
allow webalizer_t self:fifo_file rw_fifo_file_perms;
allow webalizer_t self:sock_file read_sock_file_perms;
allow webalizer_t self:shm create_shm_perms;
allow webalizer_t self:sem create_sem_perms;
allow webalizer_t self:msgq create_msgq_perms;
allow webalizer_t self:msg { send receive };
allow webalizer_t self:unix_dgram_socket create_socket_perms;
allow webalizer_t self:unix_stream_socket create_stream_socket_perms;
allow webalizer_t self:unix_dgram_socket sendto;
allow webalizer_t self:unix_stream_socket connectto;
allow webalizer_t self:tcp_socket connected_stream_socket_perms;
allow webalizer_t self:udp_socket { connect connected_socket_perms };
allow webalizer_t self:netlink_route_socket r_netlink_socket_perms;

allow webalizer_t webalizer_etc_t:file read_file_perms;

manage_dirs_pattern(webalizer_t, webalizer_tmp_t, webalizer_tmp_t)
manage_files_pattern(webalizer_t, webalizer_tmp_t, webalizer_tmp_t)
files_tmp_filetrans(webalizer_t, webalizer_tmp_t, { file dir })

manage_files_pattern(webalizer_t, webalizer_var_lib_t, webalizer_var_lib_t)
files_var_lib_filetrans(webalizer_t, webalizer_var_lib_t, file)

kernel_read_kernel_sysctls(webalizer_t)
kernel_read_system_state(webalizer_t)

corenet_all_recvfrom_unlabeled(webalizer_t)
corenet_all_recvfrom_netlabel(webalizer_t)
corenet_tcp_sendrecv_all_if(webalizer_t)
corenet_tcp_sendrecv_all_nodes(webalizer_t)
corenet_tcp_sendrecv_all_ports(webalizer_t)

fs_search_auto_mountpoints(webalizer_t)
fs_getattr_xattr_fs(webalizer_t)

files_read_etc_files(webalizer_t)
files_read_etc_runtime_files(webalizer_t)

logging_list_logs(webalizer_t)
logging_send_syslog_msg(webalizer_t)

miscfiles_read_localization(webalizer_t)

sysnet_dns_name_resolve(webalizer_t)
sysnet_read_config(webalizer_t)

userdom_use_user_terminals(webalizer_t)
userdom_use_unpriv_users_fds(webalizer_t)
userdom_dontaudit_search_user_home_content(webalizer_t)

apache_read_log(webalizer_t)
apache_manage_sys_content(webalizer_t)

optional_policy(`
	cron_system_entry(webalizer_t, webalizer_exec_t)
')

optional_policy(`
	ftp_read_log(webalizer_t)
')

optional_policy(`
	nis_use_ypbind(webalizer_t)
')

optional_policy(`
	nscd_socket_use(webalizer_t)
')