|
Chris PeBenito |
ab58ad |
#
|
|
Chris PeBenito |
ab58ad |
# Evolution
|
|
Chris PeBenito |
ab58ad |
#
|
|
Chris PeBenito |
ab58ad |
# Author: Ivan Gyurdiev <ivg2@cornell.edu>
|
|
Chris PeBenito |
ab58ad |
#
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
################################################
|
|
Chris PeBenito |
ab58ad |
# evolution_common(app_prefix,role_prefix)
|
|
Chris PeBenito |
ab58ad |
#
|
|
Chris PeBenito |
ab58ad |
define(`evolution_common', `
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# Gnome common stuff
|
|
Chris PeBenito |
ab58ad |
gnome_application($1, $2)
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# Stat root
|
|
Chris PeBenito |
ab58ad |
allow $1_t root_t:dir search;
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# Access null device
|
|
Chris PeBenito |
ab58ad |
allow $1_t null_device_t:chr_file rw_file_perms;
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# FIXME: suppress access to .local/.icons/.themes until properly implemented
|
|
Chris PeBenito |
ab58ad |
dontaudit $1_t $2_home_t:dir r_dir_perms;
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# FIXME: suppress access to .gaim/blist.xml (buddy list synchronization)
|
|
Chris PeBenito |
ab58ad |
# until properly implemented
|
|
Chris PeBenito |
ab58ad |
dontaudit $1_t $2_home_t:file r_file_perms;
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
') dnl evolution_common
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
#######################################
|
|
Chris PeBenito |
ab58ad |
# evolution_data_server(role_prefix)
|
|
Chris PeBenito |
ab58ad |
#
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
define(`evolution_data_server', `
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# Type for daemon
|
|
Chris PeBenito |
ab58ad |
type $1_evolution_server_t, domain, nscd_client_domain;
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# Transition from user type
|
|
Chris PeBenito |
ab58ad |
if (! disable_evolution_trans) {
|
|
Chris PeBenito |
ab58ad |
domain_auto_trans($1_t, evolution_server_exec_t, $1_evolution_server_t)
|
|
Chris PeBenito |
ab58ad |
}
|
|
Chris PeBenito |
ab58ad |
role $1_r types $1_evolution_server_t;
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# Evolution common stuff
|
|
Chris PeBenito |
ab58ad |
evolution_common($1_evolution_server, $1)
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# Access evolution home
|
|
Chris PeBenito |
ab58ad |
home_domain_access($1_evolution_server_t, $1, evolution)
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# Talks to exchange
|
|
Chris PeBenito |
ab58ad |
bonobo_connect($1_evolution_server, $1_evolution_exchange)
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
can_exec($1_evolution_server_t, shell_exec_t)
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# Obtain weather data via http (read server name from xml file in /usr)
|
|
Chris PeBenito |
ab58ad |
allow $1_evolution_server_t usr_t:file r_file_perms;
|
|
Chris PeBenito |
ab58ad |
can_resolve($1_evolution_server_t)
|
|
Chris PeBenito |
ab58ad |
can_network_client_tcp($1_evolution_server_t, { http_port_t http_cache_port_t } )
|
|
Chris PeBenito |
ab58ad |
allow $1_evolution_server_t { http_cache_port_t http_port_t }:tcp_socket name_connect;
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# Talk to ldap (address book)
|
|
Chris PeBenito |
ab58ad |
can_network_client_tcp($1_evolution_server_t, ldap_port_t)
|
|
Chris PeBenito |
ab58ad |
allow $1_evolution_server_t ldap_port_t:tcp_socket name_connect;
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# Look in /etc/pki
|
|
Chris PeBenito |
ab58ad |
r_dir_file($1_evolution_server_t, cert_t)
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
') dnl evolution_data_server
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
#######################################
|
|
Chris PeBenito |
ab58ad |
# evolution_webcal(role_prefix)
|
|
Chris PeBenito |
ab58ad |
#
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
define(`evolution_webcal', `
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# Type for program
|
|
Chris PeBenito |
ab58ad |
type $1_evolution_webcal_t, domain, nscd_client_domain;
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# Transition from user type
|
|
Chris PeBenito |
ab58ad |
domain_auto_trans($1_t, evolution_webcal_exec_t, $1_evolution_webcal_t)
|
|
Chris PeBenito |
ab58ad |
role $1_r types $1_evolution_webcal_t;
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# X/evolution common stuff
|
|
Chris PeBenito |
ab58ad |
x_client_domain($1_evolution_webcal, $1)
|
|
Chris PeBenito |
ab58ad |
evolution_common($1_evolution_webcal, $1)
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# Search home directory (?)
|
|
Chris PeBenito |
ab58ad |
allow $1_evolution_webcal_t $1_home_dir_t:dir search;
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# Networking capability - connect to website and handle ics link
|
|
Chris PeBenito |
ab58ad |
# FIXME: is this necessary ?
|
|
Chris PeBenito |
ab58ad |
can_resolve($1_evolution_webcal_t);
|
|
Chris PeBenito |
ab58ad |
can_network_client_tcp($1_evolution_webcal_t, { http_port_t http_cache_port_t } )
|
|
Chris PeBenito |
ab58ad |
allow $1_evolution_webcal_t { http_cache_port_t http_port_t } :tcp_socket name_connect;
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
') dnl evolution_webcal
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
#######################################
|
|
Chris PeBenito |
ab58ad |
# evolution_alarm(role_prefix)
|
|
Chris PeBenito |
ab58ad |
#
|
|
Chris PeBenito |
ab58ad |
define(`evolution_alarm', `
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# Type for program
|
|
Chris PeBenito |
ab58ad |
type $1_evolution_alarm_t, domain, nscd_client_domain;
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# Transition from user type
|
|
Chris PeBenito |
ab58ad |
domain_auto_trans($1_t, evolution_alarm_exec_t, $1_evolution_alarm_t)
|
|
Chris PeBenito |
ab58ad |
role $1_r types $1_evolution_alarm_t;
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# Common evolution stuff, X
|
|
Chris PeBenito |
ab58ad |
evolution_common($1_evolution_alarm, $1)
|
|
Chris PeBenito |
ab58ad |
x_client_domain($1_evolution_alarm, $1)
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# Connect to exchange, e-d-s
|
|
Chris PeBenito |
ab58ad |
bonobo_connect($1_evolution_alarm, $1_evolution_server)
|
|
Chris PeBenito |
ab58ad |
bonobo_connect($1_evolution_alarm, $1_evolution_exchange)
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# Access evolution home
|
|
Chris PeBenito |
ab58ad |
home_domain_access($1_evolution_alarm_t, $1, evolution)
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
') dnl evolution_alarm
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
########################################
|
|
Chris PeBenito |
ab58ad |
# evolution_exchange(role_prefix)
|
|
Chris PeBenito |
ab58ad |
#
|
|
Chris PeBenito |
ab58ad |
define(`evolution_exchange', `
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# Type for program
|
|
Chris PeBenito |
ab58ad |
type $1_evolution_exchange_t, domain, nscd_client_domain;
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# Transition from user type
|
|
Chris PeBenito |
ab58ad |
domain_auto_trans($1_t, evolution_exchange_exec_t, $1_evolution_exchange_t)
|
|
Chris PeBenito |
ab58ad |
role $1_r types $1_evolution_exchange_t;
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# Common evolution stuff, X
|
|
Chris PeBenito |
ab58ad |
evolution_common($1_evolution_exchange, $1)
|
|
Chris PeBenito |
ab58ad |
x_client_domain($1_evolution_exchange, $1)
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# Access evolution home
|
|
Chris PeBenito |
ab58ad |
home_domain_access($1_evolution_exchange_t, $1, evolution)
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# /tmp/.exchange-$USER
|
|
Chris PeBenito |
ab58ad |
tmp_domain($1_evolution_exchange)
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# Allow netstat
|
|
Chris PeBenito |
ab58ad |
allow $1_evolution_exchange_t bin_t:dir search;
|
|
Chris PeBenito |
ab58ad |
can_exec($1_evolution_exchange_t, bin_t)
|
|
Chris PeBenito |
ab58ad |
r_dir_file($1_evolution_exchange_t, proc_net_t)
|
|
Chris PeBenito |
ab58ad |
allow $1_evolution_exchange_t sysctl_net_t:dir search;
|
|
Chris PeBenito |
ab58ad |
allow $1_evolution_exchange_t self:{ udp_socket tcp_socket } create_socket_perms;
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# Clock applet talks to exchange (FIXME: Needs policy)
|
|
Chris PeBenito |
ab58ad |
bonobo_connect($1, $1_evolution_exchange)
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# FIXME: policy incomplete
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
') dnl evolution_exchange
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
#######################################
|
|
Chris PeBenito |
ab58ad |
# evolution_domain(role_prefix)
|
|
Chris PeBenito |
ab58ad |
#
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
define(`evolution_domain', `
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# Type for program
|
|
Chris PeBenito |
ab58ad |
type $1_evolution_t, domain, nscd_client_domain, privlog;
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# Transition from user type
|
|
Chris PeBenito |
ab58ad |
domain_auto_trans($1_t, evolution_exec_t, $1_evolution_t)
|
|
Chris PeBenito |
ab58ad |
role $1_r types $1_evolution_t;
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# X, mail, evolution common stuff
|
|
Chris PeBenito |
ab58ad |
x_client_domain($1_evolution, $1)
|
|
Chris PeBenito |
ab58ad |
mail_client_domain($1_evolution, $1)
|
|
Chris PeBenito |
ab58ad |
gnome_file_dialog($1_evolution, $1)
|
|
Chris PeBenito |
ab58ad |
evolution_common($1_evolution, $1)
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# Connect to e-d-s, exchange, alarm
|
|
Chris PeBenito |
ab58ad |
bonobo_connect($1_evolution, $1_evolution_server)
|
|
Chris PeBenito |
ab58ad |
bonobo_connect($1_evolution, $1_evolution_exchange)
|
|
Chris PeBenito |
ab58ad |
bonobo_connect($1_evolution, $1_evolution_alarm)
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# Access .evolution
|
|
Chris PeBenito |
ab58ad |
home_domain($1, evolution)
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# Store passwords in .gnome2_private
|
|
Chris PeBenito |
ab58ad |
gnome_private_store($1_evolution, $1)
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# Run various programs
|
|
Chris PeBenito |
ab58ad |
allow $1_evolution_t { bin_t sbin_t }:dir r_dir_perms;
|
|
Chris PeBenito |
ab58ad |
allow $1_evolution_t { self bin_t }:lnk_file r_file_perms;
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
### Junk mail filtering (start spamd)
|
|
Chris PeBenito |
ab58ad |
ifdef(`spamd.te', `
|
|
Chris PeBenito |
ab58ad |
# Start the spam daemon
|
|
Chris PeBenito |
ab58ad |
domain_auto_trans($1_evolution_t, spamd_exec_t, spamd_t)
|
|
Chris PeBenito |
ab58ad |
role $1_r types spamd_t;
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# Write pid file and socket in ~/.evolution/cache/tmp
|
|
Chris PeBenito |
ab58ad |
file_type_auto_trans(spamd_t, $1_evolution_home_t, spamd_tmp_t, { file sock_file })
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# Allow evolution to signal the daemon
|
|
Chris PeBenito |
ab58ad |
# FIXME: Now evolution can read spamd temp files
|
|
Chris PeBenito |
ab58ad |
allow $1_evolution_t spamd_tmp_t:file r_file_perms;
|
|
Chris PeBenito |
ab58ad |
allow $1_evolution_t spamd_t:process signal;
|
|
Chris PeBenito |
ab58ad |
dontaudit $1_evolution_t spamd_tmp_t:sock_file getattr;
|
|
Chris PeBenito |
ab58ad |
') dnl spamd.te
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
### Junk mail filtering (start spamc)
|
|
Chris PeBenito |
ab58ad |
ifdef(`spamc.te', `
|
|
Chris PeBenito |
ab58ad |
domain_auto_trans($1_evolution_t, spamc_exec_t, $1_spamc_t)
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# Allow connection to spamd socket above
|
|
Chris PeBenito |
ab58ad |
allow $1_spamc_t $1_evolution_home_t:dir search;
|
|
Chris PeBenito |
ab58ad |
') dnl spamc.te
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
### Junk mail filtering (start spamassassin)
|
|
Chris PeBenito |
ab58ad |
ifdef(`spamassassin.te', `
|
|
Chris PeBenito |
ab58ad |
domain_auto_trans($1_evolution_t, spamassassin_exec_t, $1_spamassassin_t)
|
|
Chris PeBenito |
ab58ad |
') dnl spamassasin.te
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
') dnl evolution_domain
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
#################################
|
|
Chris PeBenito |
ab58ad |
# evolution_domains(role_prefix)
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
define(`evolution_domains', `
|
|
Chris PeBenito |
ab58ad |
evolution_domain($1)
|
|
Chris PeBenito |
ab58ad |
evolution_data_server($1)
|
|
Chris PeBenito |
ab58ad |
evolution_webcal($1)
|
|
Chris PeBenito |
ab58ad |
evolution_alarm($1)
|
|
Chris PeBenito |
ab58ad |
evolution_exchange($1)
|
|
Chris PeBenito |
ab58ad |
') dnl end evolution_domains
|