Blame targeted/domains/program/webalizer.te
|
Chris PeBenito |
ab58ad |
# DESC webalizer - webalizer
|
|
Chris PeBenito |
ab58ad |
#
|
|
Chris PeBenito |
ab58ad |
# Author: Yuichi Nakamura (ynakam @ selinux.gr.jp)
|
|
Chris PeBenito |
ab58ad |
#
|
|
Chris PeBenito |
ab58ad |
# Depends: apache.te
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
application_domain(webalizer, `, nscd_client_domain')
|
|
Chris PeBenito |
ab58ad |
# to use from cron
|
|
Chris PeBenito |
ab58ad |
system_crond_entry(webalizer_exec_t,webalizer_t)
|
|
Chris PeBenito |
ab58ad |
role system_r types webalizer_t;
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
##type definision
|
|
Chris PeBenito |
ab58ad |
# type for usage file
|
|
Chris PeBenito |
ab58ad |
type webalizer_usage_t,file_type,sysadmfile;
|
|
Chris PeBenito |
ab58ad |
# type for /var/lib/webalizer
|
|
Chris PeBenito |
ab58ad |
type webalizer_write_t,file_type,sysadmfile;
|
|
Chris PeBenito |
ab58ad |
# type for webalizer.conf
|
|
Chris PeBenito |
ab58ad |
etc_domain(webalizer)
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
#read apache log
|
|
Chris PeBenito |
ab58ad |
allow webalizer_t var_log_t:dir r_dir_perms;
|
|
Chris PeBenito |
ab58ad |
r_dir_file(webalizer_t, httpd_log_t)
|
|
Chris PeBenito |
ab58ad |
ifdef(`ftpd.te', `
|
|
Chris PeBenito |
ab58ad |
allow webalizer_t xferlog_t:file { getattr read };
|
|
Chris PeBenito |
ab58ad |
')
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
#r/w /var/lib/webalizer
|
|
Chris PeBenito |
ab58ad |
var_lib_domain(webalizer)
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
#read /var/www/usage
|
|
Chris PeBenito |
ab58ad |
create_dir_file(webalizer_t, httpd_sys_content_t)
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
#read system files under /etc
|
|
Chris PeBenito |
ab58ad |
allow webalizer_t { etc_t etc_runtime_t }:file { getattr read };
|
|
Chris PeBenito |
ab58ad |
read_locale(webalizer_t)
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# can use tmp file
|
|
Chris PeBenito |
ab58ad |
tmp_domain(webalizer)
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# can read /proc
|
|
Chris PeBenito |
ab58ad |
read_sysctl(webalizer_t)
|
|
Chris PeBenito |
ab58ad |
allow webalizer_t proc_t:dir search;
|
|
Chris PeBenito |
ab58ad |
allow webalizer_t proc_t:file r_file_perms;
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# network
|
|
Chris PeBenito |
ab58ad |
can_network_server(webalizer_t)
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
#process communication inside webalizer itself
|
|
Chris PeBenito |
ab58ad |
general_domain_access(webalizer_t)
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
allow webalizer_t self:capability dac_override;
|