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
|
policy_module(cdrecord, 2.5.0)
########################################
#
# Declarations
#
## <desc>
## <p>
## Allow cdrecord to read various content.
## nfs, samba, removable devices, user temp
## and untrusted content files
## </p>
## </desc>
gen_tunable(cdrecord_read_content, false)
type cdrecord_t;
type cdrecord_exec_t;
typealias cdrecord_t alias { user_cdrecord_t staff_cdrecord_t sysadm_cdrecord_t };
typealias cdrecord_t alias { auditadm_cdrecord_t secadm_cdrecord_t };
userdom_user_application_domain(cdrecord_t, cdrecord_exec_t)
########################################
#
# Local policy
#
allow cdrecord_t self:capability { ipc_lock sys_nice setuid dac_override sys_rawio };
allow cdrecord_t self:process { getcap getsched setrlimit setsched sigkill };
allow cdrecord_t self:unix_dgram_socket create_socket_perms;
allow cdrecord_t self:unix_stream_socket create_stream_socket_perms;
# growisofs uses mkisofs
corecmd_exec_bin(cdrecord_t)
# allow searching for cdrom-drive
dev_list_all_dev_nodes(cdrecord_t)
dev_read_sysfs(cdrecord_t)
domain_interactive_fd(cdrecord_t)
domain_use_interactive_fds(cdrecord_t)
files_read_etc_files(cdrecord_t)
term_use_controlling_term(cdrecord_t)
term_list_ptys(cdrecord_t)
# allow cdrecord to write the CD
storage_raw_read_removable_device(cdrecord_t)
storage_raw_write_removable_device(cdrecord_t)
storage_write_scsi_generic(cdrecord_t)
logging_send_syslog_msg(cdrecord_t)
miscfiles_read_localization(cdrecord_t)
# write to the user domain tty.
userdom_use_user_terminals(cdrecord_t)
userdom_read_user_home_content_files(cdrecord_t)
# Handle nfs home dirs
tunable_policy(`cdrecord_read_content && use_nfs_home_dirs',`
fs_list_auto_mountpoints(cdrecord_t)
files_list_home(cdrecord_t)
fs_read_nfs_files(cdrecord_t)
fs_read_nfs_symlinks(cdrecord_t)
',`
files_dontaudit_list_home(cdrecord_t)
fs_dontaudit_list_auto_mountpoints(cdrecord_t)
fs_dontaudit_read_nfs_files(cdrecord_t)
fs_dontaudit_list_nfs(cdrecord_t)
')
# Handle samba home dirs
tunable_policy(`cdrecord_read_content && use_samba_home_dirs',`
fs_list_auto_mountpoints(cdrecord_t)
files_list_home(cdrecord_t)
fs_read_cifs_files(cdrecord_t)
fs_read_cifs_symlinks(cdrecord_t)
',`
files_dontaudit_list_home(cdrecord_t)
fs_dontaudit_list_auto_mountpoints(cdrecord_t)
fs_dontaudit_read_cifs_files(cdrecord_t)
fs_dontaudit_list_cifs(cdrecord_t)
')
# Handle removable media, /tmp, and /home
tunable_policy(`cdrecord_read_content',`
userdom_list_user_tmp(cdrecord_t)
userdom_read_user_tmp_files(cdrecord_t)
userdom_read_user_tmp_symlinks(cdrecord_t)
userdom_read_user_home_content_files(cdrecord_t)
userdom_read_user_home_content_symlinks(cdrecord_t)
ifndef(`enable_mls',`
fs_search_removable(cdrecord_t)
fs_read_removable_files(cdrecord_t)
fs_read_removable_symlinks(cdrecord_t)
')
',`
files_dontaudit_list_tmp(cdrecord_t)
files_dontaudit_list_home(cdrecord_t)
fs_dontaudit_list_removable(cdrecord_t)
fs_dontaudit_read_removable_files(cdrecord_t)
userdom_dontaudit_list_user_tmp(cdrecord_t)
userdom_dontaudit_read_user_tmp_files(cdrecord_t)
userdom_dontaudit_list_user_home_dirs(cdrecord_t)
userdom_dontaudit_read_user_home_content_files(cdrecord_t)
')
tunable_policy(`use_nfs_home_dirs',`
files_search_mnt(cdrecord_t)
fs_read_nfs_files(cdrecord_t)
fs_read_nfs_symlinks(cdrecord_t)
')
optional_policy(`
resmgr_stream_connect(cdrecord_t)
')
|