This commit is contained in:
Chris PeBenito 2006-03-09 19:02:29 +00:00
parent 338dbd7225
commit c8d5b357c3
12 changed files with 488 additions and 1 deletions

View File

@ -3,6 +3,7 @@
apt (Erich Schubert)
clamav (Erich Schubert)
dpkg (Erich Schubert)
rhgb
thunderbird
tor (Erich Schubert)

View File

@ -111,3 +111,20 @@ interface(`firstboot_write_pipes',`
allow $1 firstboot_t:fifo_file write;
')
########################################
## <summary>
## Read firstboot writable config files.
## </summary>
## <param name="domain">
## <summary>
## The type of the process performing this action.
## </summary>
## </param>
#
interface(`firstboot_read_rw_files',`
gen_require(`
type firstboot_rw_t;
')
allow $1 firstboot_rw_t:file r_file_perms;
')

View File

@ -1960,7 +1960,7 @@ interface(`fs_search_ramfs',`
type ramfs_t;
')
allow $1 ramfs_t:dir search;
allow $1 ramfs_t:dir search_dir_perms;
')
########################################
@ -2017,6 +2017,26 @@ interface(`fs_dontaudit_read_ramfs_pipes',`
dontaudit $1 ramfs_t:fifo_file read;
')
########################################
## <summary>
## Create, read, write, and delete
## files on a ramfs filesystem.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`fs_manage_ramfs_files',`
gen_require(`
type ramfs_t;
')
allow $1 ramfs_t:dir rw_dir_perms;
allow $1 ramfs_t:file manage_file_perms;
')
########################################
## <summary>
## Write to named pipe on a ramfs filesystem.
@ -2032,9 +2052,29 @@ interface(`fs_write_ramfs_pipes',`
type ramfs_t;
')
allow $1 ramfs_t:dir search_dir_perms;
allow $1 ramfs_t:fifo_file write;
')
########################################
## <summary>
## Do not audit attempts to write to named
## pipes on a ramfs filesystem.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`fs_dontaudit_write_ramfs_pipes',`
gen_require(`
type ramfs_t;
')
dontaudit $1 ramfs_t:fifo_file write;
')
########################################
## <summary>
## Read and write a named pipe on a ramfs filesystem.
@ -2050,9 +2090,30 @@ interface(`fs_rw_ramfs_pipes',`
type ramfs_t;
')
allow $1 ramfs_t:dir search_dir_perms;
allow $1 ramfs_t:fifo_file rw_file_perms;
')
########################################
## <summary>
## Create, read, write, and delete
## named pipes on a ramfs filesystem.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`fs_manage_ramfs_pipes',`
gen_require(`
type ramfs_t;
')
allow $1 ramfs_t:dir rw_dir_perms;
allow $1 ramfs_t:fifo_file manage_file_perms;
')
########################################
## <summary>
## Write to named socket on a ramfs filesystem.
@ -2071,6 +2132,26 @@ interface(`fs_write_ramfs_sockets',`
allow $1 ramfs_t:sock_file write;
')
########################################
## <summary>
## Create, read, write, and delete
## named sockets on a ramfs filesystem.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`fs_manage_ramfs_sockets',`
gen_require(`
type ramfs_t;
')
allow $1 ramfs_t:dir rw_dir_perms;
allow $1 ramfs_t:sock_file manage_file_perms;
')
########################################
## <summary>
## Mount a ROM filesystem.

View File

@ -0,0 +1,4 @@
#
# /usr
#
/usr/bin/rhgb -- gen_context(system_u:object_r:rhgb_exec_t,s0)

View File

@ -0,0 +1,126 @@
## <summary> Red Hat Graphical Boot </summary>
########################################
## <summary>
## RHGB stub interface. No access allowed.
## </summary>
## <param name="domain">
## <summary>
## N/A
## </summary>
## </param>
#
interface(`rhgb_stub',`
gen_require(`
type rhgb_t;
')
')
########################################
## <summary>
## Use a rhgb file descriptor.
## </summary>
## <param name="domain">
## <summary>
## The type of the process performing this action.
## </summary>
## </param>
#
interface(`rhgb_use_fds',`
gen_require(`
type rhgb_t;
')
allow $1 rhgb_t:fd use;
')
########################################
## <summary>
## Read and write to unix stream sockets.
## </summary>
## <param name="domain">
## <summary>
## The type of the process performing this action.
## </summary>
## </param>
#
interface(`rhgb_rw_stream_sockets',`
gen_require(`
type rhgb_t;
')
allow $1 rhgb_t:unix_stream_socket { read write };
')
########################################
## <summary>
## Do not audit attempts to read and write
## rhgb unix domain stream sockets.
## </summary>
## <param name="domain">
## <summary>
## The type of the process performing this action.
## </summary>
## </param>
#
interface(`rhgb_dontaudit_rw_stream_sockets',`
gen_require(`
type rhgb_t;
')
dontaudit $1 rhgb_t:unix_stream_socket { read write };
')
########################################
## <summary>
## Connected to rhgb unix stream socket.
## </summary>
## <param name="domain">
## <summary>
## The type of the process performing this action.
## </summary>
## </param>
#
interface(`rhgb_stream_connect',`
gen_require(`
type rhgb_t;
')
allow $1 rhgb_t:unix_stream_socket connectto;
')
########################################
## <summary>
## Read and write to rhgb shared memory.
## </summary>
## <param name="domain">
## <summary>
## The type of the process performing this action.
## </summary>
## </param>
#
interface(`rhgb_rw_shm',`
gen_require(`
type rhgb_t;
')
allow $1 rhgb_t:shm rw_shm_perms;
')
########################################
## <summary>
## Read and write to rhgb temporary file system.
## </summary>
## <param name="domain">
## <summary>
## The type of the process performing this action.
## </summary>
## </param>
#
interface(`rhgb_rw_tmpfs_files',`
gen_require(`
type rhgb_tmpfs_t;
')
allow $1 rhgb_tmpfs_t:file { read write };
')

View File

@ -0,0 +1,149 @@
policy_module(rhgb,1.0.0)
########################################
#
# Declarations
#
type rhgb_t;
type rhgb_exec_t;
init_daemon_domain(rhgb_t,rhgb_exec_t)
type rhgb_devpts_t;
term_pty(rhgb_devpts_t)
type rhgb_tmpfs_t;
files_tmpfs_file(rhgb_tmpfs_t)
########################################
#
# Local policy
#
allow rhgb_t self:capability { sys_admin sys_tty_config };
dontaudit rhgb_t self:capability sys_tty_config;
allow rhgb_t self:process signal_perms;
allow rhgb_t self:shm create_shm_perms;
allow rhgb_t self:unix_stream_socket create_stream_socket_perms;
allow rhgb_t self:fifo_file rw_file_perms;
allow rhgb_t self:tcp_socket create_socket_perms;
allow rhgb_t self:udp_socket create_socket_perms;
allow rhgb_t rhgb_devpts_t:chr_file { rw_file_perms setattr };
term_create_pty(rhgb_t,rhgb_devpts_t)
allow rhgb_t rhgb_tmpfs_t:dir manage_dir_perms;
allow rhgb_t rhgb_tmpfs_t:file manage_file_perms;
allow rhgb_t rhgb_tmpfs_t:lnk_file create_lnk_perms;
allow rhgb_t rhgb_tmpfs_t:sock_file manage_file_perms;
allow rhgb_t rhgb_tmpfs_t:fifo_file manage_file_perms;
fs_tmpfs_filetrans(rhgb_t,rhgb_tmpfs_t,{ dir file lnk_file sock_file fifo_file })
kernel_read_kernel_sysctls(rhgb_t)
kernel_read_system_state(rhgb_t)
corecmd_exec_bin(rhgb_t)
corecmd_exec_sbin(rhgb_t)
corenet_tcp_sendrecv_generic_if(rhgb_t)
corenet_udp_sendrecv_generic_if(rhgb_t)
corenet_raw_sendrecv_generic_if(rhgb_t)
corenet_tcp_sendrecv_all_nodes(rhgb_t)
corenet_udp_sendrecv_all_nodes(rhgb_t)
corenet_raw_sendrecv_all_nodes(rhgb_t)
corenet_tcp_sendrecv_all_ports(rhgb_t)
corenet_udp_sendrecv_all_ports(rhgb_t)
corenet_non_ipsec_sendrecv(rhgb_t)
corenet_tcp_bind_all_nodes(rhgb_t)
corenet_udp_bind_all_nodes(rhgb_t)
corenet_tcp_connect_all_ports(rhgb_t)
dev_read_sysfs(rhgb_t)
domain_use_interactive_fds(rhgb_t)
files_read_etc_files(rhgb_t)
files_read_etc_runtime_files(rhgb_t)
files_search_tmp(rhgb_t)
files_read_usr_files(rhgb_t)
files_mounton_mnt(rhgb_t)
files_dontaudit_read_default_files(rhgb_t)
files_dontaudit_search_pids(rhgb_t)
# for nscd
files_dontaudit_search_var(rhgb_t)
fs_search_auto_mountpoints(rhgb_t)
fs_mount_ramfs(rhgb_t)
fs_unmount_ramfs(rhgb_t)
# for ramfs file systems
fs_manage_ramfs_files(rhgb_t)
fs_manage_ramfs_pipes(rhgb_t)
fs_manage_ramfs_sockets(rhgb_t)
term_dontaudit_use_console(rhgb_t)
term_use_unallocated_ttys(rhgb_t)
init_use_fds(rhgb_t)
init_use_script_ptys(rhgb_t)
init_write_initctl(rhgb_t)
libs_use_ld_so(rhgb_t)
libs_use_shared_libs(rhgb_t)
# for localization
libs_read_lib_files(rhgb_t)
logging_send_syslog_msg(rhgb_t)
miscfiles_read_localization(rhgb_t)
miscfiles_read_fonts(rhgb_t)
sysnet_read_config(rhgb_t)
userdom_dontaudit_use_unpriv_user_fds(rhgb_t)
xserver_read_xdm_xserver_tmp_files(rhgb_t)
xserver_kill_xdm_xserver(rhgb_t)
# for running setxkbmap
xserver_read_xkb_libs(rhgb_t)
ifdef(`targeted_policy',`
term_dontaudit_use_generic_ptys(rhgb_t)
files_dontaudit_read_root_files(rhgb_t)
')
optional_policy(`firstboot',`
firstboot_read_rw_files(rhgb_t)
')
optional_policy(`nis',`
nis_use_ypbind(rhgb_t)
')
optional_policy(`selinuxutil',`
seutil_sigchld_newrole(rhgb_t)
')
optional_policy(`udev',`
udev_read_db(rhgb_t)
')
ifdef(`TODO',`
#TODO
ifdef(`hide_broken_symptoms', `
# for a bug in the X server
dontaudit mount_t rhgb_gph_t:fd use;
')
#TODO this seems a bit much
allow domain rhgb_devpts_t:chr_file { read write };
#TODO this (ie files_dontaudit_read_default_files(rhgb_t))doesn't make sense with the following
allow rhgb_t default_t:file { getattr read };
#TODO
# for gnome-pty-helper
gph_domain(rhgb, system)
allow initrc_t rhgb_gph_t:fd use;
ifdef(`hide_broken_symptoms', `
# it should not do this
dontaudit rhgb_t { staff_home_dir_t sysadm_home_dir_t }:dir search;
')
')

View File

@ -828,3 +828,79 @@ interface(`xserver_delete_log',`
allow $1 xserver_log_t:dir rw_dir_perms;
allow $1 xserver_log_t:file unlink;
')
########################################
## <summary>
## Read X keyboard extension libraries.
## </summary>
## <param name="domain">
## <summary>
## Domain to not audit
## </summary>
## </param>
#
interface(`xserver_read_xkb_libs',`
gen_require(`
type xkb_var_lib_t;
')
files_search_var_lib($1)
allow $1 xkb_var_lib_t:dir list_dir_perms;
allow $1 xkb_var_lib_t:file r_file_perms;
allow $1 xkb_var_lib_t:lnk_file { getattr read };
')
########################################
## <summary>
## Read xdm temporary files.
## </summary>
## <param name="domain">
## <summary>
## Domain to not audit
## </summary>
## </param>
#
interface(`xserver_read_xdm_xserver_tmp_files',`
gen_require(`
type xdm_xserver_tmp_t;
')
allow $1 xdm_xserver_tmp_t:file { getattr read };
')
########################################
## <summary>
## Kill XDM X servers
## </summary>
## <param name="domain">
## <summary>
## Domain to not audit
## </summary>
## </param>
#
interface(`xserver_kill_xdm_xserver',`
gen_require(`
type xdm_xserver_t;
')
allow $1 xdm_xserver_t:process sigkill;
')
########################################
## <summary>
## Do not audit attempts to read and write to
## a XDM X server socket.
## </summary>
## <param name="domain">
## <summary>
## Domain to not audit
## </summary>
## </param>
#
interface(`xserver_dontaudit_rw_xdm_xserver_tcp_sockets',`
gen_require(`
type xdm_xserver_t;
')
dontaudit $1 xdm_xserver_t:tcp_socket { read write };
')

View File

@ -429,6 +429,11 @@ ifdef(`targeted_policy',`
unconfined_domtrans(xdm_xserver_t)
')
optional_policy(`rhgb',`
rhgb_rw_shm(xdm_xserver_t)
rhgb_rw_tmpfs_files(xdm_xserver_t)
')
ifdef(`TODO',`
allow xdm_t xconsole_device_t:fifo_file { getattr setattr };

View File

@ -167,3 +167,8 @@ optional_policy(`cron',`
optional_policy(`nis',`
nis_use_ypbind(fsadm_t)
')
optional_policy(`rhgb',`
fs_dontaudit_write_ramfs_pipes(fsadm_t)
rhgb_stub(fsadm_t)
')

View File

@ -660,6 +660,11 @@ optional_policy(`quota',`
optional_policy(`rhgb',`
corecmd_shell_entry_type(initrc_t)
fs_write_ramfs_sockets(initrc_t)
fs_search_ramfs(initrc_t)
rhgb_rw_stream_sockets(initrc_t)
rhgb_stream_connect(initrc_t)
')
optional_policy(`rpm',`

View File

@ -143,6 +143,16 @@ optional_policy(`nscd',`
nscd_socket_use(insmod_t)
')
optional_policy(`rhgb',`
fs_manage_ramfs_files(insmod_t)
rhgb_use_fds(insmod_t)
ifdef(`hide_broken_symptoms',`
xserver_dontaudit_rw_xdm_xserver_tcp_sockets(insmod_t)
')
')
optional_policy(`rpm',`
rpm_rw_pipes(insmod_t)
')

View File

@ -128,6 +128,14 @@ optional_policy(`apm',`
apm_use_fds(mount_t)
')
optional_policy(`rhgb',`
ifdef(`hide_broken_symptoms',`
# for a bug in the X server
rhgb_dontaudit_rw_stream_sockets(mount_t)
term_dontaudit_use_ptmx(mount_t)
')
')
# for kernel package installation
optional_policy(`rpm',`
rpm_rw_pipes(mount_t)