Chris PeBenito 17de1b
## <summary>Policy for the kernel message logger and system logging daemon.</summary>
Chris PeBenito 17de1b
Chris PeBenito 17de1b
#######################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Make the specified type a file
Chris PeBenito 17de1b
##	used for logs.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="file_type">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Type of the file to be used as a log.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`logging_log_file',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		attribute logfile;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_type($1)
Chris PeBenito 17de1b
	files_associate_tmp($1)
Chris PeBenito 17de1b
	fs_associate_tmpfs($1)
Chris PeBenito 17de1b
	typeattribute $1 logfile;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito d5b81a
#######################################
Chris PeBenito d5b81a
## <summary>
Chris PeBenito d5b81a
##	Send audit messages.
Chris PeBenito d5b81a
## </summary>
Chris PeBenito d5b81a
## <param name="domain">
Chris PeBenito d5b81a
##	<summary>
Chris PeBenito d5b81a
##	Domain allowed access.
Chris PeBenito d5b81a
##	</summary>
Chris PeBenito d5b81a
## </param>
Chris PeBenito d5b81a
#
Chris PeBenito d5b81a
interface(`logging_send_audit_msgs',`
Chris PeBenito d5b81a
	allow $1 self:capability audit_write;
Chris PeBenito eaed90
	allow $1 self:netlink_audit_socket { r_netlink_socket_perms nlmsg_relay };
Chris PeBenito eaed90
')
Chris PeBenito eaed90
Chris PeBenito eaed90
#######################################
Chris PeBenito eaed90
## <summary>
Chris PeBenito eaed90
##	dontaudit attempts to send audit messages.
Chris PeBenito eaed90
## </summary>
Chris PeBenito eaed90
## <param name="domain">
Chris PeBenito eaed90
##	<summary>
Chris PeBenito eaed90
##	Domain allowed access.
Chris PeBenito eaed90
##	</summary>
Chris PeBenito eaed90
## </param>
Chris PeBenito eaed90
#
Chris PeBenito eaed90
interface(`logging_dontaudit_send_audit_msgs',`
Chris PeBenito eaed90
	dontaudit $1 self:capability audit_write;
Chris PeBenito eaed90
	dontaudit $1 self:netlink_audit_socket { r_netlink_socket_perms nlmsg_relay };
Chris PeBenito eaed90
')
Chris PeBenito eaed90
Chris PeBenito eaed90
########################################
Chris PeBenito eaed90
## <summary>
Chris PeBenito eaed90
##	Set login uid
Chris PeBenito eaed90
## </summary>
Chris PeBenito eaed90
## <param name="domain">
Chris PeBenito eaed90
##	<summary>
Chris PeBenito eaed90
##	Domain allowed access.
Chris PeBenito eaed90
##	</summary>
Chris PeBenito eaed90
## </param>
Chris PeBenito eaed90
#
Chris PeBenito eaed90
interface(`logging_set_loginuid',`
Chris PeBenito eaed90
	allow $1 self:capability audit_control;
Chris PeBenito eaed90
	allow $1 self:netlink_audit_socket { r_netlink_socket_perms nlmsg_relay };
Chris PeBenito eaed90
')
Chris PeBenito eaed90
Chris PeBenito eaed90
########################################
Chris PeBenito eaed90
## <summary>
Chris PeBenito eaed90
##	Set up audit
Chris PeBenito eaed90
## </summary>
Chris PeBenito eaed90
## <param name="domain">
Chris PeBenito eaed90
##	<summary>
Chris PeBenito eaed90
##	Domain allowed access.
Chris PeBenito eaed90
##	</summary>
Chris PeBenito eaed90
## </param>
Chris PeBenito eaed90
#
Chris PeBenito eaed90
interface(`logging_set_audit_parameters',`
Chris PeBenito eaed90
	allow $1 self:capability { audit_write audit_control };
Chris PeBenito d5b81a
	allow $1 self:netlink_audit_socket { create_netlink_socket_perms nlmsg_relay };
Chris PeBenito d5b81a
')
Chris PeBenito d5b81a
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Read the audit log.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito bbcd3c
## <rolecap/>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`logging_read_audit_log',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type auditd_log_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_var($1)
Chris PeBenito c0868a
	read_files_pattern($1,auditd_log_t,auditd_log_t)
Chris PeBenito c0868a
	allow $1 auditd_log_t:dir list_dir_perms;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Execute auditctl in the auditctl domain.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`logging_domtrans_auditctl',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type auditctl_t, auditctl_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito c0868a
	domtrans_pattern($1,auditctl_exec_t,auditctl_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Execute auditctl in the auditctl domain, and
Chris PeBenito 17de1b
##	allow the specified role the auditctl domain.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
## <param name="role">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The role to be allowed the auditctl domain.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
## <param name="terminal">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The type of the terminal allow the auditctl domain to use.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito bbcd3c
## <rolecap/>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`logging_run_auditctl',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type auditctl_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	logging_domtrans_auditctl($1)
Chris PeBenito 17de1b
	role $2 types auditctl_t;
Chris PeBenito 17de1b
	allow auditctl_t $3:chr_file rw_term_perms;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Execute auditd in the auditd domain.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`logging_domtrans_auditd',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type auditd_t, auditd_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito c0868a
	domtrans_pattern($1,auditd_exec_t,auditd_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Execute auditd in the auditd domain, and
Chris PeBenito 17de1b
##	allow the specified role the auditd domain.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
## <param name="role">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The role to be allowed the auditd domain.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
## <param name="terminal">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The type of the terminal allow the auditd domain to use.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`logging_run_auditd',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type auditd_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	logging_domtrans_auditd($1)
Chris PeBenito 17de1b
	role $2 types auditd_t;
Chris PeBenito 17de1b
	allow auditd_t $3:chr_file rw_term_perms;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito a5e213
##	Connect to auditdstored over an unix stream socket.
Chris PeBenito a5e213
## </summary>
Chris PeBenito a5e213
## <param name="domain">
Chris PeBenito a5e213
##	<summary>
Chris PeBenito a5e213
##	Domain allowed access.
Chris PeBenito a5e213
##	</summary>
Chris PeBenito a5e213
## </param>
Chris PeBenito a5e213
#
Chris PeBenito a5e213
interface(`logging_stream_connect_auditd',`
Chris PeBenito a5e213
	gen_require(`
Chris PeBenito a5e213
		type auditd_t, auditd_var_run_t;
Chris PeBenito a5e213
	')
Chris PeBenito a5e213
Chris PeBenito a5e213
	files_search_pids($1)
Chris PeBenito c0868a
	stream_connect_pattern($1,auditd_var_run_t,auditd_var_run_t,auditd_t)
Chris PeBenito a5e213
')
Chris PeBenito a5e213
Chris PeBenito a5e213
########################################
Chris PeBenito a5e213
## <summary>
Chris PeBenito 17de1b
##	Manage the auditd configuration files.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito bbcd3c
## <rolecap/>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`logging_manage_audit_config',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type auditd_etc_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_etc($1)
Chris PeBenito c0868a
	manage_files_pattern($1,auditd_etc_t,auditd_etc_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Manage the audit log.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito bbcd3c
## <rolecap/>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`logging_manage_audit_log',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type auditd_log_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_var($1)
Chris PeBenito c0868a
	manage_dirs_pattern($1,auditd_log_t,auditd_log_t)
Chris PeBenito c0868a
	manage_files_pattern($1,auditd_log_t,auditd_log_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 14add3
##	Execute klogd in the klog domain.
Chris PeBenito 14add3
## </summary>
Chris PeBenito 14add3
## <param name="domain">
Chris PeBenito 14add3
##	<summary>
Chris PeBenito 14add3
##	Domain allowed access.
Chris PeBenito 14add3
##	</summary>
Chris PeBenito 14add3
## </param>
Chris PeBenito 14add3
#
Chris PeBenito 14add3
interface(`logging_domtrans_klog',`
Chris PeBenito 14add3
	gen_require(`
Chris PeBenito 14add3
		type klogd_t, klogd_exec_t;
Chris PeBenito 14add3
	')
Chris PeBenito 14add3
Chris PeBenito 14add3
	corecmd_search_bin($1)
Chris PeBenito 14add3
	domtrans_pattern($1,klogd_exec_t,klogd_t)
Chris PeBenito 14add3
')
Chris PeBenito 14add3
Chris PeBenito 14add3
########################################
Chris PeBenito 14add3
## <summary>
Chris PeBenito 17de1b
##	Execute syslogd in the syslog domain.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`logging_domtrans_syslog',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type syslogd_t, syslogd_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 8021cb
	corecmd_search_bin($1)
Chris PeBenito c0868a
	domtrans_pattern($1,syslogd_exec_t,syslogd_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Create an object in the log directory, with a private
Chris PeBenito 17de1b
##	type using a type transition.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
## <param name="private type">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The type of the object to be created.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
## <param name="object">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The object class of the object being created.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`logging_log_filetrans',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type var_log_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_var($1)
Chris PeBenito c0868a
	filetrans_pattern($1,var_log_t,$2,$3)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Send system log messages.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`logging_send_syslog_msg',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type syslogd_t, devlog_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $1 devlog_t:lnk_file read;
Chris PeBenito 17de1b
	allow $1 devlog_t:sock_file rw_file_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# the type of socket depends on the syslog daemon
Chris PeBenito 17de1b
	allow $1 syslogd_t:unix_dgram_socket sendto;
Chris PeBenito 17de1b
	allow $1 syslogd_t:unix_stream_socket connectto;
Chris PeBenito 17de1b
	allow $1 self:unix_dgram_socket create_socket_perms;
Chris PeBenito 17de1b
	allow $1 self:unix_stream_socket create_socket_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# cjp: this should most likely be removed:
Chris PeBenito 17de1b
	term_use_console($1)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Read the auditd configuration files.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito bbcd3c
## <rolecap/>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`logging_read_audit_config',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type auditd_etc_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_etc($1)
Chris PeBenito c0868a
	read_files_pattern($1,auditd_etc_t,auditd_etc_t)
Chris PeBenito c0868a
	allow $1 auditd_etc_t:dir list_dir_perms;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 0a0b80
##	dontaudit search of auditd configuration files.
Chris PeBenito 0a0b80
## </summary>
Chris PeBenito 0a0b80
## <param name="domain">
Chris PeBenito 0a0b80
##	<summary>
Chris PeBenito 0a0b80
##	Domain allowed access.
Chris PeBenito 0a0b80
##	</summary>
Chris PeBenito 0a0b80
## </param>
Chris PeBenito 0a0b80
## <rolecap/>
Chris PeBenito 0a0b80
#
Chris PeBenito 0a0b80
interface(`logging_dontaudit_search_audit_config',`
Chris PeBenito 0a0b80
	gen_require(`
Chris PeBenito 0a0b80
		type auditd_etc_t;
Chris PeBenito 0a0b80
	')
Chris PeBenito 0a0b80
Chris PeBenito 0a0b80
	dontaudit $1 auditd_etc_t:dir search_dir_perms;
Chris PeBenito 0a0b80
')
Chris PeBenito 0a0b80
Chris PeBenito 0a0b80
########################################
Chris PeBenito 0a0b80
## <summary>
Chris PeBenito 1abafe
##	Read syslog configuration files.
Chris PeBenito 1abafe
## </summary>
Chris PeBenito 1abafe
## <param name="domain">
Chris PeBenito 1abafe
##	<summary>
Chris PeBenito 1abafe
##	Domain allowed access.
Chris PeBenito 1abafe
##	</summary>
Chris PeBenito 1abafe
## </param>
Chris PeBenito 1abafe
## <rolecap/>
Chris PeBenito 1abafe
#
Chris PeBenito 1abafe
interface(`logging_read_syslog_config',`
Chris PeBenito 1abafe
	gen_require(`
Chris PeBenito 1abafe
		type syslog_conf_t;
Chris PeBenito 1abafe
	')
Chris PeBenito 1abafe
Chris PeBenito 1abafe
	allow $1 syslog_conf_t:file read_file_perms;
Chris PeBenito 1abafe
')
Chris PeBenito 1abafe
Chris PeBenito 1abafe
########################################
Chris PeBenito 1abafe
## <summary>
Chris PeBenito 17de1b
##	Allows the domain to open a file in the
Chris PeBenito 17de1b
##	log directory, but does not allow the listing
Chris PeBenito 17de1b
##	of the contents of the log directory.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`logging_search_logs',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type var_log_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_var($1)
Chris PeBenito 465510
	allow $1 var_log_t:dir search_dir_perms;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
#######################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##      Do not audit attempts to search the var log directory.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##      <summary>
Chris PeBenito 17de1b
##      Domain not to audit.
Chris PeBenito 17de1b
##      </summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`logging_dontaudit_search_logs',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type var_log_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 465510
	dontaudit $1 var_log_t:dir search_dir_perms;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
#######################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	List the contents of the generic log directory (/var/log).
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`logging_list_logs',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type var_log_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_var($1)
Chris PeBenito c0868a
	allow $1 var_log_t:dir list_dir_perms;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
#######################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Read and write the generic log directory (/var/log).
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`logging_rw_generic_log_dirs',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type var_log_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_var($1)
Chris PeBenito 17de1b
	allow $1 var_log_t:dir rw_dir_perms;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Do not audit attempts to get the atttributes
Chris PeBenito 17de1b
##	of any log files.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`logging_dontaudit_getattr_all_logs',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		attribute logfile;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	dontaudit $1 logfile:file getattr;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Append to all log files.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`logging_append_all_logs',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		attribute logfile;
Chris PeBenito 17de1b
		type var_log_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_var($1)
Chris PeBenito c0868a
	allow $1 var_log_t:dir list_dir_perms;
Chris PeBenito 17de1b
	allow $1 logfile:file { getattr append };
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Read all log files.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito bbcd3c
## <rolecap/>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`logging_read_all_logs',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		attribute logfile;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_var($1)
Chris PeBenito eaed90
	allow $1 logfile:dir list_dir_perms;
Chris PeBenito eaed90
	read_files_pattern($1, logfile, logfile)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Execute all log files in the caller domain.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# cjp: not sure why this is needed.  This was added
Chris PeBenito 17de1b
# because of logrotate.
Chris PeBenito 17de1b
interface(`logging_exec_all_logs',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		attribute logfile;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_var($1)
Chris PeBenito c0868a
	allow $1 logfile:dir list_dir_perms;
Chris PeBenito 17de1b
	can_exec($1,logfile)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Create, read, write, and delete all log files.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito bbcd3c
## <rolecap/>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`logging_manage_all_logs',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		attribute logfile;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_var($1)
Chris PeBenito c0868a
	manage_files_pattern($1,logfile,logfile)
Chris PeBenito c0868a
	read_lnk_files_pattern($1,logfile,logfile)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Read generic log files.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito bbcd3c
## <rolecap/>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`logging_read_generic_logs',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type var_log_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_var($1)
Chris PeBenito c0868a
	allow $1 var_log_t:dir list_dir_perms;
Chris PeBenito c0868a
	read_files_pattern($1,var_log_t,var_log_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Write generic log files.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`logging_write_generic_logs',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type var_log_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_var($1)
Chris PeBenito c0868a
	allow $1 var_log_t:dir list_dir_perms;
Chris PeBenito c0868a
	write_files_pattern($1,var_log_t,var_log_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Read and write generic log files.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`logging_rw_generic_logs',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type var_log_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_var($1)
Chris PeBenito c0868a
	allow $1 var_log_t:dir list_dir_perms;
Chris PeBenito c0868a
	rw_files_pattern($1,var_log_t,var_log_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Create, read, write, and delete
Chris PeBenito 17de1b
##	generic log files.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito bbcd3c
## <rolecap/>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`logging_manage_generic_logs',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type var_log_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_var($1)
Chris PeBenito c0868a
	manage_files_pattern($1,var_log_t,var_log_t)
Chris PeBenito 17de1b
')
Chris PeBenito eaed90
Chris PeBenito eaed90
########################################
Chris PeBenito eaed90
## <summary>
Chris PeBenito eaed90
##	All of the rules required to administrate
Chris PeBenito eaed90
##	the audit environment
Chris PeBenito eaed90
## </summary>
Chris PeBenito eaed90
## <param name="domain">
Chris PeBenito eaed90
##	<summary>
Chris PeBenito eaed90
##	Domain allowed access.
Chris PeBenito eaed90
##	</summary>
Chris PeBenito eaed90
## </param>
Chris PeBenito eaed90
## <param name="role">
Chris PeBenito eaed90
##	<summary>
Chris PeBenito eaed90
##	The role to be allowed to manage the audit domain.
Chris PeBenito eaed90
##	</summary>
Chris PeBenito eaed90
## </param>
Chris PeBenito eaed90
## <param name="terminal">
Chris PeBenito eaed90
##	<summary>
Chris PeBenito eaed90
##	The type of the user terminal.
Chris PeBenito eaed90
##	</summary>
Chris PeBenito eaed90
## </param>
Chris PeBenito eaed90
## <rolecap/>
Chris PeBenito eaed90
#
Chris PeBenito eaed90
interface(`logging_admin_audit',`
Chris PeBenito eaed90
	gen_require(`
Chris PeBenito eaed90
		type auditd_t, auditd_etc_t, auditd_log_t;
Chris PeBenito eaed90
		type auditd_var_run_t;
Chris PeBenito eaed90
	')
Chris PeBenito eaed90
Chris PeBenito eaed90
	allow $1 auditd_t:process { ptrace signal_perms };
Chris PeBenito eaed90
	ps_process_pattern($1, auditd_t)
Chris PeBenito eaed90
Chris PeBenito eaed90
	manage_dirs_pattern($1, auditd_etc_t, auditd_etc_t)
Chris PeBenito eaed90
	manage_files_pattern($1, auditd_etc_t, auditd_etc_t)
Chris PeBenito eaed90
Chris PeBenito eaed90
	manage_dirs_pattern($1, auditd_log_t, auditd_log_t)
Chris PeBenito eaed90
	manage_files_pattern($1, auditd_log_t, auditd_log_t)
Chris PeBenito eaed90
Chris PeBenito eaed90
	manage_dirs_pattern($1, auditd_var_run_t, auditd_var_run_t)
Chris PeBenito eaed90
	manage_files_pattern($1, auditd_var_run_t, auditd_var_run_t)
Chris PeBenito eaed90
')
Chris PeBenito eaed90
Chris PeBenito eaed90
########################################
Chris PeBenito eaed90
## <summary>
Chris PeBenito eaed90
##	All of the rules required to administrate
Chris PeBenito eaed90
##	the syslog environment
Chris PeBenito eaed90
## </summary>
Chris PeBenito eaed90
## <param name="domain">
Chris PeBenito eaed90
##	<summary>
Chris PeBenito eaed90
##	Domain allowed access.
Chris PeBenito eaed90
##	</summary>
Chris PeBenito eaed90
## </param>
Chris PeBenito eaed90
## <param name="role">
Chris PeBenito eaed90
##	<summary>
Chris PeBenito eaed90
##	The role to be allowed to manage the syslog domain.
Chris PeBenito eaed90
##	</summary>
Chris PeBenito eaed90
## </param>
Chris PeBenito eaed90
## <param name="terminal">
Chris PeBenito eaed90
##	<summary>
Chris PeBenito eaed90
##	The type of the user terminal.
Chris PeBenito eaed90
##	</summary>
Chris PeBenito eaed90
## </param>
Chris PeBenito eaed90
## <rolecap/>
Chris PeBenito eaed90
#
Chris PeBenito eaed90
interface(`logging_admin_syslog',`
Chris PeBenito eaed90
	gen_require(`
Chris PeBenito eaed90
		type syslogd_t, klogd_t, syslog_conf_t;
Chris PeBenito eaed90
		type syslogd_tmp_t, syslogd_var_lib_t;
Chris PeBenito eaed90
		type syslogd_var_run_t, klogd_var_run_t;
Chris PeBenito eaed90
		type klogd_tmp_t, var_log_t;
Chris PeBenito eaed90
	')
Chris PeBenito eaed90
Chris PeBenito eaed90
	allow $1 syslogd_t:process { ptrace signal_perms };
Chris PeBenito eaed90
	allow $1 klogd_t:process { ptrace signal_perms };
Chris PeBenito eaed90
	ps_process_pattern($1, syslogd_t)
Chris PeBenito eaed90
	ps_process_pattern($1, klogd_t)
Chris PeBenito eaed90
Chris PeBenito eaed90
	manage_dirs_pattern($1, klogd_var_run_t, klogd_var_run_t)
Chris PeBenito eaed90
	manage_files_pattern($1, klogd_var_run_t, klogd_var_run_t)
Chris PeBenito eaed90
Chris PeBenito eaed90
	manage_dirs_pattern($1, klogd_tmp_t, klogd_tmp_t)
Chris PeBenito eaed90
	manage_files_pattern($1, klogd_tmp_t, klogd_tmp_t)
Chris PeBenito eaed90
Chris PeBenito eaed90
	manage_dirs_pattern($1, syslogd_tmp_t, syslogd_tmp_t)
Chris PeBenito eaed90
	manage_files_pattern($1, syslogd_tmp_t, syslogd_tmp_t)
Chris PeBenito eaed90
Chris PeBenito eaed90
	manage_dirs_pattern($1, syslog_conf_t, syslog_conf_t)
Chris PeBenito eaed90
	manage_files_pattern($1, syslog_conf_t, syslog_conf_t)
Chris PeBenito eaed90
	files_etc_filetrans($1, syslog_conf_t, file)
Chris PeBenito eaed90
Chris PeBenito eaed90
	manage_dirs_pattern($1, syslogd_var_lib_t, syslogd_var_lib_t)
Chris PeBenito eaed90
	manage_files_pattern($1, syslogd_var_lib_t, syslogd_var_lib_t)
Chris PeBenito eaed90
Chris PeBenito eaed90
	manage_dirs_pattern($1, syslogd_var_run_t, syslogd_var_run_t)
Chris PeBenito eaed90
	manage_files_pattern($1, syslogd_var_run_t, syslogd_var_run_t)
Chris PeBenito eaed90
Chris PeBenito eaed90
	logging_manage_all_logs($1)
Chris PeBenito eaed90
')
Chris PeBenito eaed90
Chris PeBenito eaed90
########################################
Chris PeBenito eaed90
## <summary>
Chris PeBenito eaed90
##	All of the rules required to administrate
Chris PeBenito eaed90
##	the logging environment
Chris PeBenito eaed90
## </summary>
Chris PeBenito eaed90
## <param name="domain">
Chris PeBenito eaed90
##	<summary>
Chris PeBenito eaed90
##	Domain allowed access.
Chris PeBenito eaed90
##	</summary>
Chris PeBenito eaed90
## </param>
Chris PeBenito eaed90
## <param name="role">
Chris PeBenito eaed90
##	<summary>
Chris PeBenito eaed90
##	The role to be allowed to manage the syslog domain.
Chris PeBenito eaed90
##	</summary>
Chris PeBenito eaed90
## </param>
Chris PeBenito eaed90
## <param name="terminal">
Chris PeBenito eaed90
##	<summary>
Chris PeBenito eaed90
##	The type of the user terminal.
Chris PeBenito eaed90
##	</summary>
Chris PeBenito eaed90
## </param>
Chris PeBenito eaed90
## <rolecap/>
Chris PeBenito eaed90
#
Chris PeBenito eaed90
interface(`logging_admin',`
Chris PeBenito eaed90
	logging_admin_audit($1, $2, $3)
Chris PeBenito eaed90
	logging_admin_syslog($1, $2, $3)
Chris PeBenito eaed90
')