aboutsummaryrefslogtreecommitdiff
blob: 7540ce52f599aa4d47eb4a04b8a49a7784f01079 (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
policy_module(minidlna)

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

## <desc>
##	<p>
##	Determine whether minidlna can read generic user content.
##	</p>
## </desc>
gen_tunable(minidlna_read_generic_user_content, false)

type minidlna_t;
type minidlna_exec_t;
init_daemon_domain(minidlna_t, minidlna_exec_t)

type minidlna_conf_t;
files_config_file(minidlna_conf_t)

type minidlna_db_t;
files_type(minidlna_db_t)

type minidlna_initrc_exec_t;
init_script_file(minidlna_initrc_exec_t)

type minidlna_log_t;
logging_log_file(minidlna_log_t)

type minidlna_runtime_t alias minidlna_var_run_t;
files_runtime_file(minidlna_runtime_t)

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

allow minidlna_t self:process setsched;
allow minidlna_t self:tcp_socket create_stream_socket_perms;
allow minidlna_t self:udp_socket create_socket_perms;
allow minidlna_t self:netlink_route_socket r_netlink_socket_perms;
allow minidlna_t minidlna_conf_t:file read_file_perms;

allow minidlna_t minidlna_db_t:dir { create_dir_perms rw_dir_perms };
allow minidlna_t minidlna_db_t:file manage_file_perms;

allow minidlna_t minidlna_log_t:file append_file_perms;
create_files_pattern(minidlna_t, minidlna_log_t, minidlna_log_t)

allow minidlna_t minidlna_runtime_t:file manage_file_perms;
allow minidlna_t minidlna_runtime_t:dir rw_dir_perms;
files_runtime_filetrans(minidlna_t, minidlna_runtime_t, file)

kernel_read_fs_sysctls(minidlna_t)
kernel_read_system_state(minidlna_t)

corecmd_exec_bin(minidlna_t)
corecmd_exec_shell(minidlna_t)

corenet_all_recvfrom_netlabel(minidlna_t)

corenet_sendrecv_ssdp_server_packets(minidlna_t)
corenet_sendrecv_trivnet1_server_packets(minidlna_t)

corenet_tcp_bind_generic_node(minidlna_t)
corenet_tcp_bind_trivnet1_port(minidlna_t)
corenet_tcp_sendrecv_generic_if(minidlna_t)
corenet_tcp_sendrecv_generic_node(minidlna_t)

corenet_udp_bind_generic_node(minidlna_t)
corenet_udp_bind_ssdp_port(minidlna_t)
corenet_udp_sendrecv_generic_if(minidlna_t)
corenet_udp_sendrecv_generic_node(minidlna_t)

files_search_var_lib(minidlna_t)

auth_use_nsswitch(minidlna_t)

logging_search_logs(minidlna_t)

miscfiles_read_localization(minidlna_t)
miscfiles_read_public_files(minidlna_t)

tunable_policy(`minidlna_read_generic_user_content',`
	userdom_list_user_tmp(minidlna_t)
	userdom_read_user_home_content_files(minidlna_t)
	userdom_read_user_home_content_symlinks(minidlna_t)
	userdom_read_user_tmp_files(minidlna_t)
	userdom_read_user_tmp_symlinks(minidlna_t)
',`
	files_dontaudit_list_home(minidlna_t)
	files_dontaudit_list_tmp(minidlna_t)

	userdom_dontaudit_list_user_home_dirs(minidlna_t)
	userdom_dontaudit_list_user_tmp(minidlna_t)
	userdom_dontaudit_read_user_home_content_files(minidlna_t)
	userdom_dontaudit_read_user_tmp_files(minidlna_t)
')

optional_policy(`
	xdg_read_music(minidlna_t)
	xdg_read_pictures(minidlna_t)
	xdg_read_videos(minidlna_t)
')