Chris PeBenito e32d52
## <module name="logging" layer="system">
Chris PeBenito e32d52
## <summary>Policy for the kernel message logger and system logging daemon.</summary>
Chris PeBenito e181fe
Chris PeBenito b4cd15
#######################################
Chris PeBenito b4cd15
#
Chris PeBenito c9428d
# logging_log_file(domain)
Chris PeBenito b4cd15
#
Chris PeBenito c9428d
define(`logging_log_file',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito c9428d
	files_file_type($1)
Chris PeBenito 0c73cd
	typeattribute $1 logfile;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito c9428d
define(`logging_log_file_depend',`
Chris PeBenito 0c73cd
	attribute logfile;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito fb1aee
########################################
Chris PeBenito fb1aee
#
Chris PeBenito c9428d
# logging_create_log(domain,privatetype,[class(es)])
Chris PeBenito fb1aee
#
Chris PeBenito c9428d
define(`logging_create_log',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 var_log_t:dir rw_dir_perms;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	ifelse(`$3',`',`
Chris PeBenito 0c73cd
		type_transition $1 var_log_t:file $2;
Chris PeBenito 0c73cd
	',`
Chris PeBenito 0c73cd
		type_transition $1 var_log_t:$3 $2;
Chris PeBenito 0c73cd
	')
Chris PeBenito fb1aee
')
Chris PeBenito fb1aee
Chris PeBenito c9428d
define(`logging_create_log_depend',`
Chris PeBenito 0c73cd
	type var_log_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class dir rw_dir_perms;
Chris PeBenito fb1aee
')
Chris PeBenito fb1aee
Chris PeBenito b4cd15
#######################################
Chris PeBenito b4cd15
#
Chris PeBenito c9428d
# logging_send_syslog_msg(domain)
Chris PeBenito 8c7717
#
Chris PeBenito c9428d
define(`logging_send_syslog_msg',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 devlog_t:lnk_file read;
Chris PeBenito cc41a9
	allow $1 devlog_t:sock_file rw_file_perms;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	# the type of socket depends on the syslog daemon
Chris PeBenito 0c73cd
	allow $1 syslogd_t:unix_dgram_socket sendto;
Chris PeBenito 0c73cd
	allow $1 syslogd_t:unix_stream_socket connectto;
Chris PeBenito cc41a9
	allow $1 self:unix_dgram_socket create_socket_perms;
Chris PeBenito cc41a9
	allow $1 self:unix_stream_socket create_socket_perms;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	# cjp: this should most likely be removed:
Chris PeBenito 0fd9dc
	term_use_console($1)
Chris PeBenito 8c7717
')
Chris PeBenito 8c7717
Chris PeBenito c9428d
define(`logging_send_syslog_msg_depend',`
Chris PeBenito 0c73cd
	type syslogd_t, devlog_t;
Chris PeBenito 0c73cd
Chris PeBenito cc41a9
	class sock_file rw_file_perms;
Chris PeBenito cc41a9
	class unix_dgram_socket { create_socket_perms sendto };
Chris PeBenito cc41a9
	class unix_stream_socket { create_socket_perms connectto };
Chris PeBenito 8c7717
')
Chris PeBenito 8c7717
Chris PeBenito daa0e0
########################################
Chris PeBenito c9428d
## <interface name="logging_search_logs">
Chris PeBenito daa0e0
##	<description>
Chris PeBenito daa0e0
##		Allows the domain to open a file in the
Chris PeBenito daa0e0
##		log directory, but does not allow the listing
Chris PeBenito daa0e0
##		of the contents of the log directory.
Chris PeBenito daa0e0
##	</description>
Chris PeBenito daa0e0
##	<parameter name="domain">
Chris PeBenito daa0e0
##		The type of the process performing this action.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
## </interface>
Chris PeBenito 3ce6cb
#
Chris PeBenito c9428d
define(`logging_search_logs',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito c9428d
	files_search_var($1)
Chris PeBenito 0c73cd
	allow $1 var_log_t:dir search;
Chris PeBenito 3ce6cb
')
Chris PeBenito 3ce6cb
Chris PeBenito c9428d
define(`logging_search_logs_depend',`
Chris PeBenito 0c73cd
	type var_log_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class dir search;
Chris PeBenito 3ce6cb
')
Chris PeBenito 3ce6cb
Chris PeBenito 3ce6cb
#######################################
Chris PeBenito 3ce6cb
#
Chris PeBenito c9428d
# logging_dontaudit_getattr_all_logs(domain)
Chris PeBenito b16c6b
#
Chris PeBenito c9428d
define(`logging_dontaudit_getattr_all_logs',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	dontaudit $1 logfile:file getattr;
Chris PeBenito b16c6b
')
Chris PeBenito b16c6b
Chris PeBenito c9428d
define(`logging_dontaudit_getattr_all_logs_depend',`
Chris PeBenito 0c73cd
	attribute logfile;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class file getattr;
Chris PeBenito b16c6b
')
Chris PeBenito b16c6b
Chris PeBenito b16c6b
#######################################
Chris PeBenito b16c6b
#
Chris PeBenito 3ce6cb
# logging_append_all_logs(domain)
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
define(`logging_append_all_logs',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito c9428d
	files_search_var($1)
Chris PeBenito cc41a9
	allow $1 var_log_t:dir r_dir_perms;
Chris PeBenito 0c73cd
	allow $1 logfile:file { getattr append };
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
define(`logging_append_all_logs_depend',`
Chris PeBenito 0c73cd
	attribute logfile;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	type var_log_t;
Chris PeBenito 0c73cd
Chris PeBenito cc41a9
	class dir r_dir_perms;
Chris PeBenito 0c73cd
	class file { getattr append };
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
#######################################
Chris PeBenito b4cd15
#
Chris PeBenito 3ce6cb
# logging_read_all_logs(domain)
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
define(`logging_read_all_logs',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito c9428d
	files_search_var($1)
Chris PeBenito cc41a9
	allow $1 var_log_t:dir r_dir_perms;
Chris PeBenito cc41a9
	allow $1 logfile:file r_file_perms;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
define(`logging_read_all_logs_depend',`
Chris PeBenito 0c73cd
	attribute logfile;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	type var_log_t;
Chris PeBenito 0c73cd
Chris PeBenito cc41a9
	class dir r_dir_perms;
Chris PeBenito cc41a9
	class file r_file_perms;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
#######################################
Chris PeBenito b4cd15
#
Chris PeBenito c9428d
# logging_read_generic_logs(domain)
Chris PeBenito 24280a
#
Chris PeBenito c9428d
define(`logging_read_generic_logs',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito c9428d
	files_search_var($1)
Chris PeBenito cc41a9
	allow $1 var_log_t:dir r_dir_perms;
Chris PeBenito cc41a9
	allow $1 var_log_t:file r_file_perms;
Chris PeBenito 24280a
')
Chris PeBenito 24280a
Chris PeBenito c9428d
define(`logging_read_generic_logs_depend',`
Chris PeBenito 0c73cd
	type var_log_t;
Chris PeBenito 0c73cd
Chris PeBenito cc41a9
	class dir r_dir_perms;
Chris PeBenito cc41a9
	class file r_file_perms;
Chris PeBenito 24280a
')
Chris PeBenito 24280a
Chris PeBenito 24280a
#######################################
Chris PeBenito 24280a
#
Chris PeBenito c9428d
# logging_write_generic_logs(domain)
Chris PeBenito d490eb
#
Chris PeBenito c9428d
define(`logging_write_generic_logs',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito c9428d
	files_search_var($1)
Chris PeBenito cc41a9
	allow $1 var_log_t:dir r_dir_perms;
Chris PeBenito 0c73cd
	allow $1 var_log_t:file { getattr write };
Chris PeBenito d490eb
')
Chris PeBenito d490eb
Chris PeBenito c9428d
define(`logging_write_generic_logs_depend',`
Chris PeBenito 0c73cd
	type var_log_t;
Chris PeBenito 0c73cd
Chris PeBenito cc41a9
	class dir r_dir_perms;
Chris PeBenito 0c73cd
	class file { getattr write };
Chris PeBenito d490eb
')
Chris PeBenito d490eb
Chris PeBenito d490eb
#######################################
Chris PeBenito d490eb
#
Chris PeBenito c9428d
# logging_rw_generic_logs(domain)
Chris PeBenito b4cd15
#
Chris PeBenito c9428d
define(`logging_rw_generic_logs',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito c9428d
	files_search_var($1)
Chris PeBenito cc41a9
	allow $1 var_log_t:dir r_dir_perms;
Chris PeBenito cc41a9
	allow $1 var_log_t:file rw_file_perms;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito c9428d
define(`logging_rw_generic_logs_depend',`
Chris PeBenito 0c73cd
	type var_log_t;
Chris PeBenito 0c73cd
Chris PeBenito cc41a9
	class dir r_dir_perms;
Chris PeBenito cc41a9
	class file rw_file_perms;
Chris PeBenito b4cd15
')
Chris PeBenito e32d52
Chris PeBenito e32d52
## </module>