aboutsummaryrefslogtreecommitdiff
blob: 9353d5ebbc858b467e40acaae15305642346906a (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
115
116
117
118
119
120
121
policy_module(razor, 2.3.0)

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

type razor_exec_t;
corecmd_executable_file(razor_exec_t)

type razor_etc_t;
files_config_file(razor_etc_t)

type razor_home_t;
typealias razor_home_t alias { user_razor_home_t staff_razor_home_t sysadm_razor_home_t };
typealias razor_home_t alias { auditadm_razor_home_t secadm_razor_home_t };
userdom_user_home_content(razor_home_t)

type razor_log_t;
logging_log_file(razor_log_t)

type razor_tmp_t;
typealias razor_tmp_t alias { user_razor_tmp_t staff_razor_tmp_t sysadm_razor_tmp_t };
typealias razor_tmp_t alias { auditadm_razor_tmp_t secadm_razor_tmp_t };
userdom_user_tmp_file(razor_tmp_t)

type razor_var_lib_t;
files_type(razor_var_lib_t)

# these are here due to ordering issues:
razor_common_domain_template(razor)
typealias razor_t alias { user_razor_t staff_razor_t sysadm_razor_t };
typealias razor_t alias { auditadm_razor_t secadm_razor_t };
userdom_user_application_type(razor_t)

razor_common_domain_template(system_razor)
role system_r types system_razor_t;

########################################
#
# System razor local policy
#

# this version of razor is invoked typically
# via the system spam filter

allow system_razor_t self:tcp_socket create_socket_perms;

manage_dirs_pattern(system_razor_t, razor_etc_t, razor_etc_t)
manage_files_pattern(system_razor_t, razor_etc_t, razor_etc_t)
manage_lnk_files_pattern(system_razor_t, razor_etc_t, razor_etc_t)
files_search_etc(system_razor_t)

allow system_razor_t razor_log_t:file manage_file_perms;
logging_log_filetrans(system_razor_t, razor_log_t, file)

manage_files_pattern(system_razor_t, razor_var_lib_t, razor_var_lib_t)
files_var_lib_filetrans(system_razor_t, razor_var_lib_t, file)

corenet_all_recvfrom_unlabeled(system_razor_t)
corenet_all_recvfrom_netlabel(system_razor_t)
corenet_tcp_sendrecv_generic_if(system_razor_t)
corenet_raw_sendrecv_generic_if(system_razor_t)
corenet_tcp_sendrecv_generic_node(system_razor_t)
corenet_raw_sendrecv_generic_node(system_razor_t)
corenet_tcp_sendrecv_razor_port(system_razor_t)
corenet_tcp_connect_razor_port(system_razor_t)
corenet_sendrecv_razor_client_packets(system_razor_t)

sysnet_read_config(system_razor_t)

# cjp: this shouldn't be needed
userdom_use_unpriv_users_fds(system_razor_t)

optional_policy(`
	logging_send_syslog_msg(system_razor_t)
')

optional_policy(`
	nscd_socket_use(system_razor_t)
')

########################################
#
# User razor local policy
#

# Allow razor to be run by hand.  Needed by any action other than
# invocation from a spam filter.

allow razor_t self:unix_stream_socket create_stream_socket_perms;

manage_dirs_pattern(razor_t, razor_home_t, razor_home_t)
manage_files_pattern(razor_t, razor_home_t, razor_home_t)
manage_lnk_files_pattern(razor_t, razor_home_t, razor_home_t)
userdom_user_home_dir_filetrans(razor_t, razor_home_t, dir)

manage_dirs_pattern(razor_t, razor_tmp_t, razor_tmp_t)
manage_files_pattern(razor_t, razor_tmp_t, razor_tmp_t)
files_tmp_filetrans(razor_t, razor_tmp_t, { file dir })

logging_send_syslog_msg(razor_t)

userdom_search_user_home_dirs(razor_t)
userdom_use_user_terminals(razor_t)

tunable_policy(`use_nfs_home_dirs',`
	fs_manage_nfs_dirs(razor_t)
	fs_manage_nfs_files(razor_t)
	fs_manage_nfs_symlinks(razor_t)
')

tunable_policy(`use_samba_home_dirs',`
	fs_manage_cifs_dirs(razor_t)
	fs_manage_cifs_files(razor_t)
	fs_manage_cifs_symlinks(razor_t)
')

optional_policy(`
	nscd_socket_use(razor_t)
')