2005-06-01 14:17:43 +00:00
|
|
|
## <module name="logging" layer="system">
|
|
|
|
## <summary>Policy for the kernel message logger and system logging daemon.</summary>
|
2005-04-20 19:07:16 +00:00
|
|
|
|
2005-04-14 20:18:17 +00:00
|
|
|
#######################################
|
|
|
|
#
|
2005-05-03 20:23:33 +00:00
|
|
|
# logging_make_log_file(domain)
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
|
|
|
define(`logging_make_log_file',`
|
2005-06-03 12:25:14 +00:00
|
|
|
requires_block_template(`$0'_depend)
|
|
|
|
|
|
|
|
files_make_file($1)
|
|
|
|
typeattribute $1 logfile;
|
2005-04-14 20:18:17 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
define(`logging_make_log_file_depend',`
|
2005-06-03 12:25:14 +00:00
|
|
|
attribute logfile;
|
2005-04-14 20:18:17 +00:00
|
|
|
')
|
|
|
|
|
2005-05-11 20:54:14 +00:00
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# logging_create_private_log(domain,privatetype,[class(es)])
|
|
|
|
#
|
|
|
|
define(`logging_create_private_log',`
|
2005-06-03 12:25:14 +00:00
|
|
|
requires_block_template(`$0'_depend)
|
|
|
|
|
|
|
|
allow $1 var_log_t:dir rw_dir_perms;
|
|
|
|
|
|
|
|
ifelse(`$3',`',`
|
|
|
|
type_transition $1 var_log_t:file $2;
|
|
|
|
',`
|
|
|
|
type_transition $1 var_log_t:$3 $2;
|
|
|
|
')
|
2005-05-11 20:54:14 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
define(`logging_create_private_log_depend',`
|
2005-06-03 12:25:14 +00:00
|
|
|
type var_log_t;
|
|
|
|
|
|
|
|
class dir rw_dir_perms;
|
2005-05-11 20:54:14 +00:00
|
|
|
')
|
|
|
|
|
2005-04-19 20:44:07 +00:00
|
|
|
#######################################
|
|
|
|
#
|
2005-05-03 20:23:33 +00:00
|
|
|
# logging_send_system_log_message(domain)
|
2005-04-19 20:44:07 +00:00
|
|
|
#
|
|
|
|
define(`logging_send_system_log_message',`
|
2005-06-03 12:25:14 +00:00
|
|
|
requires_block_template(`$0'_depend)
|
|
|
|
|
|
|
|
allow $1 devlog_t:lnk_file read;
|
|
|
|
allow $1 devlog_t:sock_file { ioctl read getattr lock write append };
|
|
|
|
|
|
|
|
# the type of socket depends on the syslog daemon
|
|
|
|
allow $1 syslogd_t:unix_dgram_socket sendto;
|
|
|
|
allow $1 syslogd_t:unix_stream_socket connectto;
|
|
|
|
allow $1 self:unix_dgram_socket { create read getattr write setattr append bind connect getopt setopt shutdown };
|
|
|
|
allow $1 self:unix_stream_socket { create read getattr write setattr append bind connect getopt setopt shutdown };
|
|
|
|
|
|
|
|
# cjp: this should most likely be removed:
|
|
|
|
terminal_use_console($1)
|
2005-04-19 20:44:07 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
define(`logging_send_system_log_message_depend',`
|
2005-06-03 12:25:14 +00:00
|
|
|
type syslogd_t, devlog_t;
|
|
|
|
|
|
|
|
class sock_file { ioctl read getattr lock write append };
|
|
|
|
class unix_dgram_socket { create read getattr write setattr append bind connect getopt setopt shutdown sendto };
|
|
|
|
class unix_stream_socket { create read getattr write setattr append bind connect getopt setopt shutdown connectto };
|
2005-04-19 20:44:07 +00:00
|
|
|
')
|
|
|
|
|
2005-05-19 21:06:06 +00:00
|
|
|
########################################
|
|
|
|
## <interface name="logging_search_system_log_directory">
|
|
|
|
## <description>
|
|
|
|
## Allows the domain to open a file in the
|
|
|
|
## log directory, but does not allow the listing
|
|
|
|
## of the contents of the log directory.
|
|
|
|
## </description>
|
|
|
|
## <parameter name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </parameter>
|
|
|
|
## <infoflow type="read" weight="3"/>
|
|
|
|
## </interface>
|
2005-05-03 20:23:33 +00:00
|
|
|
#
|
|
|
|
define(`logging_search_system_log_directory',`
|
2005-06-03 12:25:14 +00:00
|
|
|
requires_block_template(`$0'_depend)
|
|
|
|
|
|
|
|
files_search_system_state_data_directory($1)
|
|
|
|
allow $1 var_log_t:dir search;
|
2005-05-03 20:23:33 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
define(`logging_search_system_log_directory_depend',`
|
2005-06-03 12:25:14 +00:00
|
|
|
type var_log_t;
|
|
|
|
|
|
|
|
class dir search;
|
2005-05-03 20:23:33 +00:00
|
|
|
')
|
|
|
|
|
2005-05-16 21:10:33 +00:00
|
|
|
#######################################
|
|
|
|
#
|
|
|
|
# logging_ignore_get_all_logs_attributes(domain)
|
|
|
|
#
|
|
|
|
define(`logging_ignore_get_all_logs_attributes',`
|
2005-06-03 12:25:14 +00:00
|
|
|
requires_block_template(`$0'_depend)
|
|
|
|
|
|
|
|
dontaudit $1 logfile:file getattr;
|
2005-05-16 21:10:33 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
define(`logging_ignore_get_all_logs_attributes_depend',`
|
2005-06-03 12:25:14 +00:00
|
|
|
attribute logfile;
|
|
|
|
|
|
|
|
class file getattr;
|
2005-05-16 21:10:33 +00:00
|
|
|
')
|
|
|
|
|
2005-05-03 20:23:33 +00:00
|
|
|
#######################################
|
|
|
|
#
|
|
|
|
# logging_append_all_logs(domain)
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
|
|
|
define(`logging_append_all_logs',`
|
2005-06-03 12:25:14 +00:00
|
|
|
requires_block_template(`$0'_depend)
|
|
|
|
|
|
|
|
files_search_system_state_data_directory($1)
|
|
|
|
allow $1 var_log_t:dir { getattr search read };
|
|
|
|
allow $1 logfile:file { getattr append };
|
2005-04-14 20:18:17 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
define(`logging_append_all_logs_depend',`
|
2005-06-03 12:25:14 +00:00
|
|
|
attribute logfile;
|
|
|
|
|
|
|
|
type var_log_t;
|
|
|
|
|
|
|
|
class dir { getattr search read };
|
|
|
|
class file { getattr append };
|
2005-04-14 20:18:17 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
#######################################
|
|
|
|
#
|
2005-05-03 20:23:33 +00:00
|
|
|
# logging_read_all_logs(domain)
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
|
|
|
define(`logging_read_all_logs',`
|
2005-06-03 12:25:14 +00:00
|
|
|
requires_block_template(`$0'_depend)
|
|
|
|
|
|
|
|
files_search_system_state_data_directory($1)
|
|
|
|
allow $1 var_log_t:dir { getattr search read };
|
|
|
|
allow $1 logfile:file { getattr read };
|
2005-04-14 20:18:17 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
define(`logging_read_all_logs_depend',`
|
2005-06-03 12:25:14 +00:00
|
|
|
attribute logfile;
|
|
|
|
|
|
|
|
type var_log_t;
|
|
|
|
|
|
|
|
class dir { getattr search read };
|
|
|
|
class file { getattr read };
|
2005-04-14 20:18:17 +00:00
|
|
|
')
|
|
|
|
|
2005-05-11 19:05:15 +00:00
|
|
|
#######################################
|
|
|
|
#
|
|
|
|
# logging_read_system_logs(domain)
|
|
|
|
#
|
|
|
|
define(`logging_read_system_logs',`
|
2005-06-03 12:25:14 +00:00
|
|
|
requires_block_template(`$0'_depend)
|
|
|
|
|
|
|
|
files_search_system_state_data_directory($1)
|
|
|
|
allow $1 var_log_t:dir { getattr search read };
|
|
|
|
allow $1 var_log_t:file { getattr read };
|
2005-05-11 19:05:15 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
define(`logging_read_system_logs_depend',`
|
2005-06-03 12:25:14 +00:00
|
|
|
type var_log_t;
|
|
|
|
|
|
|
|
class dir { getattr search read };
|
|
|
|
class file { getattr read };
|
2005-05-11 19:05:15 +00:00
|
|
|
')
|
|
|
|
|
2005-05-26 20:38:45 +00:00
|
|
|
#######################################
|
|
|
|
#
|
|
|
|
# logging_write_system_logs(domain)
|
|
|
|
#
|
|
|
|
define(`logging_write_system_logs',`
|
2005-06-03 12:25:14 +00:00
|
|
|
requires_block_template(`$0'_depend)
|
|
|
|
|
|
|
|
files_search_system_state_data_directory($1)
|
|
|
|
allow $1 var_log_t:dir { getattr search read };
|
|
|
|
allow $1 var_log_t:file { getattr write };
|
2005-05-26 20:38:45 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
define(`logging_write_system_logs_depend',`
|
2005-06-03 12:25:14 +00:00
|
|
|
type var_log_t;
|
|
|
|
|
|
|
|
class dir { getattr search read };
|
|
|
|
class file { getattr write };
|
2005-05-26 20:38:45 +00:00
|
|
|
')
|
|
|
|
|
2005-04-14 20:18:17 +00:00
|
|
|
#######################################
|
|
|
|
#
|
2005-05-03 20:23:33 +00:00
|
|
|
# logging_modify_system_logs(domain)
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
|
|
|
define(`logging_modify_system_logs',`
|
2005-06-03 12:25:14 +00:00
|
|
|
requires_block_template(`$0'_depend)
|
|
|
|
|
|
|
|
files_search_system_state_data_directory($1)
|
|
|
|
allow $1 var_log_t:dir { getattr search read };
|
|
|
|
allow $1 var_log_t:file { getattr read write append };
|
2005-04-14 20:18:17 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
define(`logging_modify_system_logs_depend',`
|
2005-06-03 12:25:14 +00:00
|
|
|
type var_log_t;
|
|
|
|
|
|
|
|
class dir { getattr search read };
|
|
|
|
class file { getattr read write append };
|
2005-04-14 20:18:17 +00:00
|
|
|
')
|
2005-06-01 14:17:43 +00:00
|
|
|
|
|
|
|
## </module>
|