]> git.ipfire.org Git - people/stevee/selinux-policy.git/blob - policy/modules/services/apcupsd.te
Bump module versions for release.
[people/stevee/selinux-policy.git] / policy / modules / services / apcupsd.te
1
2 policy_module(apcupsd, 1.7.0)
3
4 ########################################
5 #
6 # Declarations
7 #
8
9 type apcupsd_t;
10 type apcupsd_exec_t;
11 init_daemon_domain(apcupsd_t, apcupsd_exec_t)
12
13 type apcupsd_lock_t;
14 files_lock_file(apcupsd_lock_t)
15
16 type apcupsd_initrc_exec_t;
17 init_script_file(apcupsd_initrc_exec_t)
18
19 type apcupsd_log_t;
20 logging_log_file(apcupsd_log_t)
21
22 type apcupsd_tmp_t;
23 files_tmp_file(apcupsd_tmp_t)
24
25 type apcupsd_var_run_t;
26 files_pid_file(apcupsd_var_run_t)
27
28 ########################################
29 #
30 # apcupsd local policy
31 #
32
33 allow apcupsd_t self:capability { dac_override setgid sys_tty_config };
34 allow apcupsd_t self:process signal;
35 allow apcupsd_t self:fifo_file rw_file_perms;
36 allow apcupsd_t self:unix_stream_socket create_stream_socket_perms;
37 allow apcupsd_t self:tcp_socket create_stream_socket_perms;
38
39 allow apcupsd_t apcupsd_lock_t:file manage_file_perms;
40 files_lock_filetrans(apcupsd_t, apcupsd_lock_t, file)
41
42 allow apcupsd_t apcupsd_log_t:dir setattr;
43 manage_files_pattern(apcupsd_t, apcupsd_log_t, apcupsd_log_t)
44 logging_log_filetrans(apcupsd_t, apcupsd_log_t, { file dir })
45
46 manage_files_pattern(apcupsd_t, apcupsd_tmp_t, apcupsd_tmp_t)
47 files_tmp_filetrans(apcupsd_t, apcupsd_tmp_t, file)
48
49 manage_files_pattern(apcupsd_t, apcupsd_var_run_t, apcupsd_var_run_t)
50 files_pid_filetrans(apcupsd_t, apcupsd_var_run_t, file)
51
52 kernel_read_system_state(apcupsd_t)
53
54 corecmd_exec_bin(apcupsd_t)
55 corecmd_exec_shell(apcupsd_t)
56
57 corenet_all_recvfrom_unlabeled(apcupsd_t)
58 corenet_all_recvfrom_netlabel(apcupsd_t)
59 corenet_tcp_sendrecv_generic_if(apcupsd_t)
60 corenet_tcp_sendrecv_generic_node(apcupsd_t)
61 corenet_tcp_sendrecv_all_ports(apcupsd_t)
62 corenet_tcp_bind_generic_node(apcupsd_t)
63 corenet_tcp_bind_apcupsd_port(apcupsd_t)
64 corenet_sendrecv_apcupsd_server_packets(apcupsd_t)
65 corenet_tcp_connect_apcupsd_port(apcupsd_t)
66
67 dev_rw_generic_usb_dev(apcupsd_t)
68
69 # Init script handling
70 domain_use_interactive_fds(apcupsd_t)
71
72 files_read_etc_files(apcupsd_t)
73 files_search_locks(apcupsd_t)
74 # Creates /etc/nologin
75 files_manage_etc_runtime_files(apcupsd_t)
76 files_etc_filetrans_etc_runtime(apcupsd_t, file)
77
78 # https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=240805
79 term_use_unallocated_ttys(apcupsd_t)
80
81 #apcupsd runs shutdown, probably need a shutdown domain
82 init_rw_utmp(apcupsd_t)
83 init_telinit(apcupsd_t)
84
85 logging_send_syslog_msg(apcupsd_t)
86
87 miscfiles_read_localization(apcupsd_t)
88
89 sysnet_dns_name_resolve(apcupsd_t)
90
91 userdom_use_user_ttys(apcupsd_t)
92
93 optional_policy(`
94 hostname_exec(apcupsd_t)
95 ')
96
97 optional_policy(`
98 mta_send_mail(apcupsd_t)
99 mta_system_content(apcupsd_tmp_t)
100 ')
101
102 ########################################
103 #
104 # apcupsd_cgi Declarations
105 #
106
107 optional_policy(`
108 apache_content_template(apcupsd_cgi)
109
110 allow httpd_apcupsd_cgi_script_t self:tcp_socket create_stream_socket_perms;
111 allow httpd_apcupsd_cgi_script_t self:udp_socket create_socket_perms;
112
113 corenet_all_recvfrom_unlabeled(httpd_apcupsd_cgi_script_t)
114 corenet_all_recvfrom_netlabel(httpd_apcupsd_cgi_script_t)
115 corenet_tcp_sendrecv_generic_if(httpd_apcupsd_cgi_script_t)
116 corenet_tcp_sendrecv_generic_node(httpd_apcupsd_cgi_script_t)
117 corenet_tcp_sendrecv_all_ports(httpd_apcupsd_cgi_script_t)
118 corenet_tcp_connect_apcupsd_port(httpd_apcupsd_cgi_script_t)
119 corenet_udp_sendrecv_generic_if(httpd_apcupsd_cgi_script_t)
120 corenet_udp_sendrecv_generic_node(httpd_apcupsd_cgi_script_t)
121 corenet_udp_sendrecv_all_ports(httpd_apcupsd_cgi_script_t)
122
123 sysnet_dns_name_resolve(httpd_apcupsd_cgi_script_t)
124 ')