Announce: Updated SELinux conditional policy extensions
A new release of the conditional policy extensions to SELinux is available from our website:
http://www.tresys.com/selinux/index.html
Patches are also attached to this email. The conditional policy extensions to SELinux allow runtime modification of the security policy without having to load a new policy. Using boolean variables and expressions, it is possible to define sections of policy that are conditionally applied. Please see the website for more information.
This release includes modifications to the linux kernel, checkpolicy, libselinux, and the default policy and allows the creation and loading of conditional policies. Any testing or feedback would be greatly appreciated.
Thanks,
Karl
Signature · 5 lines
Karl MacMillan Tresys Technology [email protected] http://www.tresys.com (410) 290-1411 x134
linux-2.6/security/selinux/include/conditional.h new file +22 -0
@@ -0,0 +1,22 @@ +/* +* Interface to booleans in the security server. This is exported +* for the selinuxfs. +* +* Author: Karl MacMillan <[email protected]> +* +* Copyright (C) 2003 - 2004 Tresys Technology, LLC +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, version 2. +*/ + +#ifndef _SELINUX_CONDITIONAL_H_ +#define _SELINUX_CONDITIONAL_H_ + +int security_get_bools (int *len,char ***names,int **values); + +int security_set_bools (int len,int *values); + +int security_get_bool_value (int bool); + +#endif
linux-2.6/security/selinux/include/security.h +4 -1
@@ -2,7 +2,9 @@* Security server interface. * * Author : Stephen Smalley, <[email protected]> +* */ +#ifndef _SELINUX_SECURITY_H_#define _SELINUX_SECURITY_H_
@@ -13,7 +15,8 @@#define SECCLASS_NULL 0x0000/* no class */ #define SELINUX_MAGIC 0xf97cff8c -#define POLICYDB_VERSION 15 +#define POLICYDB_VERSION 16 +#define POLICYDB_VERSION_COMPAT 15#ifdef CONFIG_SECURITY_SELINUX_BOOTPARAM extern int selinux_enabled;
linux-2.6/security/selinux/selinuxfs.c +359 -8
433 lines not on this page · raw message
linux-2.6/security/selinux/ss/Makefile +1 -1
@@ -5,7 +5,7 @@ EXTRA_CFLAGS += -Isecurity/selinux/include obj-y := ss.o -ss-objs := ebitmap.o hashtab.o symtab.o sidtab.o avtab.o policydb.o services.o +ss-objs := ebitmap.o hashtab.o symtab.o sidtab.o avtab.o policydb.o services.o conditional.o ifeq ($(CONFIG_SECURITY_SELINUX_MLS),y) ss-objs += mls.o
linux-2.6/security/selinux/ss/avtab.c +194 -62
308 lines not on this page · raw message
linux-2.6/security/selinux/ss/avtab.h +20 -0
@@ -7,6 +7,16 @@* * Author : Stephen Smalley, <[email protected]> */ + +/* Updated: Frank Mayer <[email protected]> and Karl MacMillan <[email protected]> +* +* Added conditional policy language extensions +* +* Copyright (C) 2003 Tresys Technology, LLC +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, version 2. +*/ #ifndef _SS_AVTAB_H_#define _SS_AVTAB_H_
@@ -25,6 +35,7 @@#define AVTAB_MEMBER 32#define AVTAB_CHANGE 64#define AVTAB_TYPE (AVTAB_TRANSITION | AVTAB_MEMBER | AVTAB_CHANGE) +#define AVTAB_ENABLED 0x80000000/* reserved for used in cond_avtab */ u32 specified;/* what fields are specified */ u32 data[3 ];/* access vectors or types */ #define avtab_allowed (x) (x)->data[0]
@@ -56,7 +67,16 @@ void *args), void *args);void avtab_hash_eval (struct avtab *h,char *tag); + +int avtab_read_item (void *fp,struct avtab_datum *avdatum,struct avtab_key *avkey);int avtab_read (struct avtab *a,void *fp,u32 config); + +struct avtab_node *avtab_insert_nonunique (struct avtab *h,struct avtab_key *key, +struct avtab_datum *datum); + +struct avtab_node *avtab_search_node (struct avtab *h,struct avtab_key *key,int specified); + +struct avtab_node *avtab_search_node_next (struct avtab_node *node,int specified);#define AVTAB_HASH_BITS 15#define AVTAB_HASH_BUCKETS (1 << AVTAB_HASH_BITS)
linux-2.6/security/selinux/ss/conditional.c new file +484 -0
484 lines not on this page · raw message
linux-2.6/security/selinux/ss/conditional.h new file +77 -0
77 lines not on this page · raw message
linux-2.6/security/selinux/ss/policydb.c +63 -15
174 lines not on this page · raw message
linux-2.6/security/selinux/ss/policydb.h +31 -2
@@ -4,6 +4,17 @@* * Author : Stephen Smalley, <[email protected]> */ + +/* Updated: Frank Mayer <[email protected]> and Karl MacMillan <[email protected]> +* +* Added conditional policy language extensions +* +* Copyright (C) 2003 - 2004 Tresys Technology, LLC +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, version 2. +*/ +#ifndef _SS_POLICYDB_H_#define _SS_POLICYDB_H_
@@ -100,6 +111,13 @@ };#endif +/* Boolean data type */ +struct cond_bool_datum { +__u32 value;/* internal type value */ +int state; +}; + +struct cond_node ;/* * The configuration data includes security contexts for
@@ -145,9 +163,11 @@#ifdef CONFIG_SECURITY_SELINUX_MLS #define SYM_LEVELS 5#define SYM_CATS 6 -#define SYM_NUM 7 +#define SYM_BOOLS 7 +#define SYM_NUM 8#else -#define SYM_NUM 5 +#define SYM_BOOLS 5 +#define SYM_NUM 6#endif /* object context array indices */
@@ -170,6 +190,7 @@#define p_users symtab[SYM_USERS]#define p_levels symtab[SYM_LEVELS]#define p_cats symtab[SYM_CATS] +#define p_bools symtab[SYM_BOOLS]/* symbol names indexed by (value - 1) */ char **sym_val_to_name[SYM_NUM ];
@@ -180,6 +201,7 @@#define p_user_val_to_name sym_val_to_name[SYM_USERS]#define p_sens_val_to_name sym_val_to_name[SYM_LEVELS]#define p_cat_val_to_name sym_val_to_name[SYM_CATS] +#define p_bool_val_to_name sym_val_to_name[SYM_BOOLS]/* class, role, and user attributes indexed by (value - 1) */ struct class_datum **class_val_to_struct;
@@ -191,6 +213,13 @@/* role transitions */ struct role_trans *role_tr; + +/* bools indexed by (value - 1) */ +struct cond_bool_datum **bool_val_to_struct; +/* type enforcement conditional access vectors and transitions */ +struct avtab te_cond_avtab; +/* linked list indexing te_cond_avtab by conditional */ +struct cond_node * cond_list;/* role allows */ struct role_allow *role_allow;
linux-2.6/security/selinux/ss/services.c +139 -0
187 lines not on this page · raw message
selinux-usr/policy/types/booleans.te new file +11 -0
@@ -0,0 +1,11 @@ +# +# Author: Karl MacMillan <[email protected]> +# + +# +# disable_dontaudit is a boolean that can be used +# to disable all of the dontaudit rules in the +# policy. This is primarily useful for debugging. +# + +bool disable_dontaudit false;
selinux-usr/policy/domains/program/chkpwd.te +4 -1
@@ -10,7 +10,10 @@ type chkpwd_exec_t, file_type, sysadmfile, exec_type; chkpwd_domain(system) -dontaudit system_chkpwd_t privfd:fd use; +if (!disable_dontaudit) +{ + dontaudit system_chkpwd_t privfd:fd use; +} # Everything else is in the chkpwd_domain macro in # macros/program/chkpwd_macros.te.
selinux-usr/policy/domains/program/crond.te +13 -5
@@ -37,7 +37,10 @@ ') # to stop killall type operations from filling our logs -dontaudit system_crond_t domain:dir search; +if (!disable_dontaudit) +{ + dontaudit system_crond_t domain:dir search; +} # read files in /etc allow system_crond_t etc_t:{ file lnk_file } r_file_perms;
@@ -189,7 +192,10 @@ # /sbin/runlevel ask for w access to utmp, but will operate # correctly without it. Do not audit write denials to utmp. -dontaudit system_crond_t initrc_var_run_t:file { read write }; +if (!disable_dontaudit) +{ + dontaudit system_crond_t initrc_var_run_t:file { read write }; +} # Access accounting summary files. allow system_crond_t var_log_sa_t:file create_file_perms;
@@ -206,6 +212,8 @@ allow system_crond_t var_spool_t:dir rw_dir_perms; # Do not audit attempts to search unlabeled directories (e.g. slocate). -dontaudit system_crond_t unlabeled_t:dir r_dir_perms; -dontaudit system_crond_t unlabeled_t:file r_file_perms; - +if (!disable_dontaudit) +{ + dontaudit system_crond_t unlabeled_t:dir r_dir_perms; + dontaudit system_crond_t unlabeled_t:file r_file_perms; +}
selinux-usr/policy/domains/program/ifconfig.te +8 -2
@@ -30,7 +30,10 @@ # Use capabilities. allow ifconfig_t self:capability net_admin; -dontaudit ifconfig_t self:capability sys_module; +if (!disable_dontaudit) +{ + dontaudit ifconfig_t self:capability sys_module; +} # Inherit and use descriptors from init. allow ifconfig_t init_t:fd use;
@@ -53,7 +56,10 @@ # ifconfig attempts to search some sysctl entries. # Do not audit those attempts; comment out these rules if it is desired to # see the denials. -dontaudit ifconfig_t { sysctl_t sysctl_net_t }:dir search; +if (!disable_dontaudit) +{ + dontaudit ifconfig_t { sysctl_t sysctl_net_t }:dir search; +} allow ifconfig_t fs_t:filesystem getattr;
selinux-usr/policy/domains/program/init.te +4 -1
@@ -126,4 +126,7 @@ can_exec(init_t,etc_t) # for initrd pivot_root seems to access this -dontaudit init_t file_labels_t:dir { search }; +if (!disable_dontaudit) +{ + dontaudit init_t file_labels_t:dir { search }; +}
selinux-usr/policy/domains/program/ldconfig.te +4 -1
@@ -15,7 +15,10 @@ role system_r types ldconfig_t; domain_auto_trans({ sysadm_t initrc_t ifdef(`dpkg.te', `dpkg_t') }, ldconfig_exec_t, ldconfig_t) -dontaudit ldconfig_t device_t:dir search; +if (!disable_dontaudit) +{ + dontaudit ldconfig_t device_t:dir search; +} allow ldconfig_t { initrc_devpts_t admin_tty_type }:chr_file rw_file_perms; allow ldconfig_t privfd:fd use;
selinux-usr/policy/domains/program/login.te +19 -11
@@ -18,7 +18,10 @@ type $1_login_t, domain, privuser, privrole, privlog, auth_chkpwd, privowner, mlstrustedreader, mlstrustedwriter, mlstrustedobject, privfd; role system_r types $1_login_t; -dontaudit $1_login_t shadow_t:file { getattr read }; +if (!disable_dontaudit) +{ + dontaudit $1_login_t shadow_t:file { getattr read }; +} general_domain_access($1_login_t);
@@ -114,17 +117,22 @@ login_spawn_domain(local_login, userdomain) # Do not audit denied attempts to access devices. -dontaudit local_login_t fixed_disk_device_t:blk_file { getattr setattr }; -dontaudit local_login_t removable_device_t:blk_file { getattr setattr }; -dontaudit local_login_t device_t:{ chr_file blk_file lnk_file } { getattr setattr }; -dontaudit local_login_t misc_device_t:{ chr_file blk_file lnk_file } { getattr setattr }; -dontaudit local_login_t framebuf_device_t:{ chr_file blk_file lnk_file } { getattr setattr read }; -dontaudit local_login_t apm_bios_t:chr_file { getattr setattr }; -dontaudit local_login_t v4l_device_t:{ chr_file blk_file lnk_file } { getattr setattr read }; -dontaudit local_login_t v4l_device_t:dir { read search getattr }; - +if (!disable_dontaudit) +{ + dontaudit local_login_t fixed_disk_device_t:blk_file { getattr setattr }; + dontaudit local_login_t removable_device_t:blk_file { getattr setattr }; + dontaudit local_login_t device_t:{ chr_file blk_file lnk_file } { getattr setattr }; + dontaudit local_login_t misc_device_t:{ chr_file blk_file lnk_file } { getattr setattr }; + dontaudit local_login_t framebuf_device_t:{ chr_file blk_file lnk_file } { getattr setattr read }; + dontaudit local_login_t apm_bios_t:chr_file { getattr setattr }; + dontaudit local_login_t v4l_device_t:{ chr_file blk_file lnk_file } { getattr setattr read }; + dontaudit local_login_t v4l_device_t:dir { read search getattr }; +} # Do not audit denied attempts to access /mnt. -dontaudit local_login_t file_t:dir r_dir_perms; +if (!disable_dontaudit) +{ + dontaudit local_login_t file_t:dir r_dir_perms; +} # Create lock file.
selinux-usr/policy/domains/program/logrotate.te +4 -1
@@ -82,7 +82,10 @@ # Change ownership on log files. allow logrotate_t self:capability { chown dac_override dac_read_search kill fsetid fowner }; # for mailx -dontaudit logrotate_t self:capability { setuid setgid }; +if (!disable_dontaudit) +{ + dontaudit logrotate_t self:capability { setuid setgid }; +} ifdef(`mta.te', ` allow { system_mail_t mta_user_agent } logrotate_tmp_t:file r_file_perms;
selinux-usr/policy/domains/program/modutil.te +16 -4
@@ -124,13 +124,22 @@ domain_auto_trans(privmodule, insmod_exec_t, insmod_t) can_exec(insmod_t, insmod_exec_t) allow insmod_t privmodule:process sigchld; -dontaudit sysadm_t self:capability sys_module; +if (!disable_dontaudit) +{ + dontaudit sysadm_t self:capability sys_module; +} # for when /var is not mounted early in the boot -dontaudit insmod_t file_t:dir search; +if (!disable_dontaudit) +{ + dontaudit insmod_t file_t:dir search; +} # kernel threads inherit from shared descriptor table used by init -dontaudit insmod_t initctl_t:fifo_file { read write }; +if (!disable_dontaudit) +{ + dontaudit insmod_t initctl_t:fifo_file { read write }; +} ifdef(`crond.te', ` rw_dir_create_file(system_crond_t, var_log_ksyms_t)
@@ -155,7 +164,10 @@ allow update_modules_t { console_device_t devtty_t }:chr_file rw_file_perms; allow update_modules_t { initrc_devpts_t admin_tty_type }:chr_file rw_file_perms; -dontaudit update_modules_t sysadm_home_dir_t:dir search; +if (!disable_dontaudit) +{ + dontaudit update_modules_t sysadm_home_dir_t:dir search; +} uses_shlib(update_modules_t) allow update_modules_t self:process { fork sigchld };
selinux-usr/policy/domains/program/newrole.te +8 -2
@@ -83,10 +83,16 @@ allow newrole_t fs_t:filesystem getattr; # for some PAM modules and for cwd -dontaudit newrole_t { home_root_t home_type }:dir search; +if (!disable_dontaudit) +{ + dontaudit newrole_t { home_root_t home_type }:dir search; +} allow newrole_t proc_t:dir search; allow newrole_t proc_t:file { getattr read }; # for when the network connection is killed -dontaudit unpriv_userdomain newrole_t:process signal; +if (!disable_dontaudit) +{ + dontaudit unpriv_userdomain newrole_t:process signal; +}
selinux-usr/policy/domains/program/passwd.te +40 -10
94 lines not on this page · raw message
selinux-usr/policy/domains/program/setfiles.te +4 -1
@@ -50,7 +50,10 @@ allow setfiles_t etc_runtime_t:file read; allow setfiles_t etc_t:file read; allow setfiles_t proc_t:file { getattr read }; -dontaudit setfiles_t proc_t:lnk_file { getattr read }; +if (!disable_dontaudit) +{ + dontaudit setfiles_t proc_t:lnk_file { getattr read }; +} # for config files in a home directory allow setfiles_t home_type:file r_file_perms;
selinux-usr/policy/domains/program/ssh.te +20 -5
@@ -25,17 +25,26 @@ # auth_chkpwd is for running unix_chkpwd and unix_verify. type $1_t, domain, privuser, privrole, privlog, privowner, privfd, auth_chkpwd; role system_r types $1_t; -dontaudit $1_t shadow_t:file { getattr read }; +if (!disable_dontaudit) +{ + dontaudit $1_t shadow_t:file { getattr read }; +} uses_shlib($1_t) allow $1_t self:unix_dgram_socket create_socket_perms; allow $1_t self:unix_stream_socket create_stream_socket_perms; allow $1_t self:fifo_file rw_file_perms; allow $1_t self:process { fork sigchld setsched signal }; -dontaudit $1_t self:lnk_file read; +if (!disable_dontaudit) +{ + dontaudit $1_t self:lnk_file read; +} # do not allow statfs() -dontaudit $1_t fs_type:filesystem getattr; +if (!disable_dontaudit) +{ + dontaudit $1_t fs_type:filesystem getattr; +} allow $1_t bin_t:dir search; allow $1_t bin_t:lnk_file read;
@@ -49,7 +58,10 @@ # Read /etc. allow $1_t etc_t:dir search; # ioctl is for pam_console -dontaudit $1_t etc_t:file ioctl; +if (!disable_dontaudit) +{ + dontaudit $1_t etc_t:file ioctl; +} allow $1_t etc_t:file { getattr read }; allow $1_t etc_t:lnk_file { getattr read }; allow $1_t etc_runtime_t:file { getattr read };
@@ -138,7 +150,10 @@ sshd_spawn_domain(sshd_extern, user_mini_domain, mini_pty_type) # for when the network connection breaks after running newrole -r sysadm_r -dontaudit sshd_t sysadm_devpts_t:chr_file setattr; +if (!disable_dontaudit) +{ + dontaudit sshd_t sysadm_devpts_t:chr_file setattr; +} # Allow checking users mail at login allow sshd_t { var_spool_t mail_spool_t }:dir search;
selinux-usr/policy/domains/program/unused/acct.te +12 -3
@@ -50,13 +50,22 @@ allow acct_t { sysctl_kernel_t sysctl_t }:dir search; allow acct_t sysctl_kernel_t:file read; -dontaudit acct_t sysadm_home_dir_t:dir { getattr search }; +if (!disable_dontaudit) +{ + dontaudit acct_t sysadm_home_dir_t:dir { getattr search }; +} # for nscd -dontaudit acct_t var_run_t:dir search; +if (!disable_dontaudit) +{ + dontaudit acct_t var_run_t:dir search; +} # not sure why we need this, the command "last" is reported as using it -dontaudit acct_t self:capability kill; +if (!disable_dontaudit) +{ + dontaudit acct_t self:capability kill; +} allow acct_t devtty_t:chr_file { read write };
selinux-usr/policy/domains/program/unused/amanda.te +6 -4
@@ -204,10 +204,12 @@ ########### # Dontaudit ########### -dontaudit amanda_t file_labels_t:dir { getattr read search }; -dontaudit amanda_t file_labels_t:file { getattr read }; -dontaudit amanda_t lost_found_t:dir { getattr read }; - +if (!disable_dontaudit) +{ + dontaudit amanda_t file_labels_t:dir { getattr read search }; + dontaudit amanda_t file_labels_t:file { getattr read }; + dontaudit amanda_t lost_found_t:dir { getattr read }; +} ############################################################################## # AMANDA RECOVER DECLARATIONS
selinux-usr/policy/domains/program/unused/amavis.te +6 -3
@@ -82,6 +82,9 @@ allow amavisd_t etc_runtime_t:file { getattr read }; # broken stuff -dontaudit amavisd_t sysadm_home_dir_t:dir search; -dontaudit amavisd_t shadow_t:file { getattr read }; -dontaudit amavisd_t sysadm_devpts_t:chr_file { read write }; +if (!disable_dontaudit) +{ + dontaudit amavisd_t sysadm_home_dir_t:dir search; + dontaudit amavisd_t shadow_t:file { getattr read }; + dontaudit amavisd_t sysadm_devpts_t:chr_file { read write }; +}
selinux-usr/policy/domains/program/unused/apache.te +9 -4
@@ -94,9 +94,11 @@ ifdef(`mta.te', ` # apache should set close-on-exec -dontaudit httpd_suexec_t httpd_t:unix_stream_socket { read write }; -dontaudit { system_mail_t mta_user_agent } httpd_t:unix_stream_socket { read write }; -') +if (!disable_dontaudit) +{ + dontaudit httpd_suexec_t httpd_t:unix_stream_socket { read write }; + dontaudit { system_mail_t mta_user_agent } httpd_t:unix_stream_socket { read write }; +} uses_shlib(httpd_t)
@@ -109,7 +111,10 @@ # Allow httpd to search users diretories ###################### allow httpd_t home_root_t:dir { getattr search }; -dontaudit httpd_t sysadm_home_dir_t:dir getattr; +if (!disable_dontaudit) +{ + dontaudit httpd_t sysadm_home_dir_t:dir getattr; +} ############################################################################ # Allow the httpd_t the capability to bind to a port and various other stuff
selinux-usr/policy/domains/program/unused/apmd.te +13 -8
@@ -66,13 +66,15 @@ # to quiet fuser and ps # setuid for fuser, dac* for ps -dontaudit apmd_t self:capability { setuid dac_override dac_read_search }; -dontaudit apmd_t domain:{ socket_class_set } getattr; -dontaudit apmd_t { file_type fs_type }:dir_file_class_set getattr; -dontaudit apmd_t home_type:dir { search getattr }; -dontaudit apmd_t domain:key_socket getattr; -dontaudit apmd_t domain:dir search; - +if (!disable_dontaudit) +{ + dontaudit apmd_t self:capability { setuid dac_override dac_read_search }; + dontaudit apmd_t domain:{ socket_class_set } getattr; + dontaudit apmd_t { file_type fs_type }:dir_file_class_set getattr; + dontaudit apmd_t home_type:dir { search getattr }; + dontaudit apmd_t domain:key_socket getattr; + dontaudit apmd_t domain:dir search; +} ifdef(`rpm.te', ` can_exec(apmd_t, apmd_var_run_t)
@@ -85,5 +87,8 @@ ifdef(`netutils.te', `domain_auto_trans(apmd_t, netutils_exec_t, netutils_t)') ', ` # for ifconfig which is run all the time -dontaudit apmd_t sysctl_t:dir search; +if (!disable_dontaudit) +{ + dontaudit apmd_t sysctl_t:dir search; +} ')
selinux-usr/policy/domains/program/unused/automount.te +4 -1
@@ -46,6 +46,9 @@ can_exec(automount_t, mount_exec_t) allow mount_t autofs_t:dir getattr; -dontaudit automount_t var_t:dir write; +if (!disable_dontaudit) +{ + dontaudit automount_t var_t:dir write; +} allow userdomain autofs_t:dir r_dir_perms;
selinux-usr/policy/domains/program/unused/bootloader.te +16 -4
@@ -22,7 +22,10 @@ allow bootloader_t var_log_t:file write; # for nscd -dontaudit bootloader_t var_run_t:dir search; +if (!disable_dontaudit) +{ + dontaudit bootloader_t var_run_t:dir search; +} domain_auto_trans(sysadm_t, bootloader_exec_t, bootloader_t) allow bootloader_t { initrc_t privfd }:fd use;
@@ -54,7 +57,10 @@ allow bootloader_t { bin_t sbin_t }:lnk_file read; allow bootloader_t { modules_dep_t modules_object_t }:file read; -dontaudit bootloader_t modules_dep_t:file ioctl; +if (!disable_dontaudit) +{ + dontaudit bootloader_t modules_dep_t:file ioctl; +} allow bootloader_t modules_object_t:dir { read search }; allow bootloader_t modules_conf_t:file read;
@@ -66,7 +72,10 @@ allow bootloader_t insmod_exec_t:file { rx_file_perms execute_no_trans }; ') -dontaudit bootloader_t sysadm_home_dir_t:dir search; +if (!disable_dontaudit) +{ + dontaudit bootloader_t sysadm_home_dir_t:dir search; +} allow bootloader_t boot_t:dir rw_dir_perms; allow bootloader_t boot_t:{ file lnk_file } create_file_perms;
@@ -93,7 +102,10 @@ allow bootloader_t self:capability { fsetid sys_rawio sys_admin mknod chown }; # allow bootloader to get attributes of any device node allow bootloader_t file_type:dir_file_class_set getattr; -dontaudit bootloader_t devpts_t:dir create_dir_perms; +if (!disable_dontaudit) +{ + dontaudit bootloader_t devpts_t:dir create_dir_perms; +} allow bootloader_t self:process { fork signal_perms }; allow bootloader_t self:lnk_file read;
selinux-usr/policy/domains/program/unused/calamaris.te +5 -3
@@ -49,9 +49,11 @@ allow calamaris_t self:udp_socket create_socket_perms; allow calamaris_t { etc_t resolv_conf_t }:file { getattr read }; allow calamaris_t etc_t:lnk_file read; -dontaudit calamaris_t etc_t:file ioctl; -dontaudit calamaris_t sysadm_home_dir_t:dir { getattr search }; -can_network(calamaris_t) +if (!disable_dontaudit) +{ + dontaudit calamaris_t etc_t:file ioctl; + dontaudit calamaris_t sysadm_home_dir_t:dir { getattr search }; +} ifdef(`named.te', ` can_udp_send(calamaris_t, named_t) can_udp_send(named_t, calamaris_t)
selinux-usr/policy/domains/program/unused/ciped.te +4 -1
@@ -25,4 +25,7 @@ allow ciped_t random_device_t:chr_file { getattr read }; -dontaudit ciped_t var_t:dir search; +if (!disable_dontaudit) +{ + dontaudit ciped_t var_t:dir search; +}
selinux-usr/policy/domains/program/unused/clamav.te +4 -1
@@ -50,4 +50,7 @@ allow clamd_t self:fifo_file rw_file_perms; allow clamd_t random_device_t:chr_file { getattr read }; -dontaudit clamd_t random_device_t:chr_file ioctl; +if (!disable_dontaudit) +{ + dontaudit clamd_t random_device_t:chr_file ioctl; +}
selinux-usr/policy/domains/program/unused/courier.te +4 -1
@@ -75,7 +75,10 @@ # should not be needed! allow courier_authdaemon_t home_root_t:dir search; allow courier_authdaemon_t user_home_dir_type:dir search; -dontaudit courier_authdaemon_t sysadm_home_dir_t:dir search; +if (!disable_dontaudit) +{ + dontaudit courier_authdaemon_t sysadm_home_dir_t:dir search; +} allow courier_authdaemon_t self:unix_stream_socket connectto; allow courier_authdaemon_t self:capability { setuid setgid }; allow courier_authdaemon_t resolv_conf_t:file { read getattr };
selinux-usr/policy/domains/program/unused/crack.te +4 -1
@@ -39,4 +39,7 @@ allow crack_t fs_t:filesystem getattr; -dontaudit crack_t sysadm_home_dir_t:dir { getattr search }; +if (!disable_dontaudit) +{ + dontaudit crack_t sysadm_home_dir_t:dir { getattr search }; +}
selinux-usr/policy/domains/program/unused/cups.te +8 -2
@@ -24,7 +24,10 @@ allow cupsd_t printer_device_t:chr_file rw_file_perms; allow cupsd_t random_device_t:chr_file { getattr read }; -dontaudit cupsd_t random_device_t:chr_file ioctl; +if (!disable_dontaudit) +{ + dontaudit cupsd_t random_device_t:chr_file ioctl; +} # temporary solution, we need something better allow cupsd_t tty_device_t:chr_file rw_file_perms;
@@ -59,7 +62,10 @@ allow cupsd_t { sysctl_kernel_t sysctl_dev_t }:file { getattr read }; # for /etc/printcap -dontaudit cupsd_t etc_t:file write; +if (!disable_dontaudit) +{ + dontaudit cupsd_t etc_t:file write; +} # allow cups to execute its backend scripts can_exec(cupsd_t, cupsd_exec_t)
selinux-usr/policy/domains/program/unused/devfsd.te +4 -1
@@ -77,7 +77,10 @@ allow devfsd_t self:unix_stream_socket connect; allow devfsd_t devfs_control_t:chr_file { getattr read ioctl }; -dontaudit userdomain devfs_control_t:chr_file getattr; +if (!disable_dontaudit) +{ + dontaudit userdomain devfs_control_t:chr_file getattr; +} # allow resolv.conf and UDP access for LDAP or other NSS data source allow devfsd_t resolv_conf_t:file r_file_perms;
selinux-usr/policy/domains/program/unused/dhcpc.te +22 -12
@@ -38,10 +38,12 @@ ifdef(`ping.te', ` domain_auto_trans(dhcpc_t, ping_exec_t, ping_t) # because dhcpc is buggy and leaves file handles open... -dontaudit ping_t dhcpc_state_t:file read; -dontaudit ping_t dhcpc_t:packet_socket { read write }; -dontaudit ping_t dhcpc_t:udp_socket { read write }; -ifdef(`hotplug.te', ` +if (!disable_dontaudit) +{ + dontaudit ping_t dhcpc_state_t:file read; + dontaudit ping_t dhcpc_t:packet_socket { read write }; + dontaudit ping_t dhcpc_t:udp_socket { read write }; +} allow ping_t hotplug_t:fd use; ') dnl end if hotplug ifdef(`cardmgr.te', `
@@ -65,7 +67,10 @@ allow dhcpc_t self:capability { net_admin net_raw net_bind_service }; # for access("/etc/bashrc", X_OK) on Red Hat -dontaudit dhcpc_t self:capability dac_read_search; +if (!disable_dontaudit) +{ + dontaudit dhcpc_t self:capability dac_read_search; +} # for udp port 68 allow dhcpc_t dhcpc_port_t:udp_socket name_bind;
@@ -83,9 +88,11 @@ ifdef(`ifconfig.te', ` domain_auto_trans(dhcpc_t, ifconfig_exec_t, ifconfig_t) # because dhclient is buggy and does not close file handles -dontaudit ifconfig_t dhcpc_t:{ packet_socket udp_socket } { read write }; -dontaudit ifconfig_t dhcpc_state_t:file { read write }; -') +if (!disable_dontaudit) +{ + dontaudit ifconfig_t dhcpc_t:{ packet_socket udp_socket } { read write }; + dontaudit ifconfig_t dhcpc_state_t:file { read write }; +} # Allow dhcpc_t to use packet sockets allow dhcpc_t self:packet_socket create_socket_perms;
@@ -99,7 +106,10 @@ allow dhcpc_t bin_t:lnk_file read; can_exec(dhcpc_t, { bin_t shell_exec_t }) -dontaudit dhcpc_t domain:packet_socket recvfrom; -dontaudit dhcpc_t { netmsg_t icmp_socket_t tcp_socket_t igmp_packet_t }:packet_socket recvfrom; -dontaudit dhcpc_t icmp_socket_t:rawip_socket recvfrom; -dontaudit dhcpc_t any_socket_t:rawip_socket sendto; +if (!disable_dontaudit) +{ + dontaudit dhcpc_t domain:packet_socket recvfrom; + dontaudit dhcpc_t { netmsg_t icmp_socket_t tcp_socket_t igmp_packet_t }:packet_socket recvfrom; + dontaudit dhcpc_t icmp_socket_t:rawip_socket recvfrom; + dontaudit dhcpc_t any_socket_t:rawip_socket sendto; +}
selinux-usr/policy/domains/program/unused/dhcpd.te +7 -4
@@ -62,7 +62,10 @@ # allow reading /proc allow dhcpd_t proc_t:{ file lnk_file } r_file_perms; -dontaudit dhcpd_t domain:packet_socket recvfrom; -dontaudit dhcpd_t { netmsg_t icmp_socket_t tcp_socket_t igmp_packet_t }:packet_socket recvfrom; -dontaudit dhcpd_t icmp_socket_t:rawip_socket recvfrom; -dontaudit dhcpd_t any_socket_t:rawip_socket sendto; +if (!disable_dontaudit) +{ + dontaudit dhcpd_t domain:packet_socket recvfrom; + dontaudit dhcpd_t { netmsg_t icmp_socket_t tcp_socket_t igmp_packet_t }:packet_socket recvfrom; + dontaudit dhcpd_t icmp_socket_t:rawip_socket recvfrom; + dontaudit dhcpd_t any_socket_t:rawip_socket sendto; +}
selinux-usr/policy/domains/program/unused/dictd.te +4 -1
@@ -16,7 +16,10 @@ type etc_dictd_t, file_type, sysadmfile; # for checking for nscd -dontaudit dictd_t var_run_t:dir search; +if (!disable_dontaudit) +{ + dontaudit dictd_t var_run_t:dir search; +} # read config files allow dictd_t { etc_t etc_dictd_t resolv_conf_t etc_runtime_t }:file r_file_perms;
selinux-usr/policy/domains/program/unused/dpkg.te +25 -8
@@ -145,9 +145,11 @@ allow { apt_t dpkg_t install_menu_t } device_t:dir { getattr search }; -dontaudit apt_t var_log_t:dir getattr; -dontaudit apt_t var_run_t:dir search; - +if (!disable_dontaudit) +{ + dontaudit apt_t var_log_t:dir getattr; + dontaudit apt_t var_run_t:dir search; +} # for rc files such as ~/.less r_dir_file(apt_t, sysadm_home_t) allow apt_t sysadm_home_dir_t:dir { search getattr };
@@ -186,7 +188,10 @@ ') # for kernel-image postinst -dontaudit dpkg_t fixed_disk_device_t:blk_file read; +if (!disable_dontaudit) +{ + dontaudit dpkg_t fixed_disk_device_t:blk_file read; +} # allow user domains to execute dpkg allow userdomain dpkg_exec_t:dir r_dir_perms;
@@ -215,7 +220,10 @@ # Inherit and use descriptors from open_init_pty allow { apt_t dpkg_t install_menu_t } initrc_t:fd use; -dontaudit dpkg_t privfd:fd use; +if (!disable_dontaudit) +{ + dontaudit dpkg_t privfd:fd use; +} allow { apt_t dpkg_t install_menu_t } devpts_t:dir search; allow { apt_t dpkg_t install_menu_t } initrc_devpts_t:chr_file rw_file_perms;
@@ -249,7 +257,10 @@ ifdef(`devfsd.te', `', ` allow dpkg_t file_type:{ chr_file blk_file } { create setattr rename }; ') -dontaudit dpkg_t domain:{ socket unix_dgram_socket udp_socket unix_stream_socket tcp_socket fifo_file rawip_socket packet_socket } getattr; +if (!disable_dontaudit) +{ + dontaudit dpkg_t domain:{ socket unix_dgram_socket udp_socket unix_stream_socket tcp_socket fifo_file rawip_socket packet_socket } getattr; +} allow dpkg_t proc_kmsg_t:file getattr; allow dpkg_t root_dir_type:dir getattr;
@@ -277,7 +288,10 @@ allow apt_t tcp_socket_t:tcp_socket connectto; allow { apt_t dpkg_t } var_t:dir { search getattr }; -dontaudit apt_t { fs_type file_type }:dir getattr; +if (!disable_dontaudit) +{ + dontaudit apt_t { fs_type file_type }:dir getattr; +} allow { apt_t dpkg_t } { var_lib_t bin_t }:dir r_dir_perms; allow { apt_t dpkg_t } dpkg_lock_t:file { setattr rw_file_perms };
@@ -314,7 +328,10 @@ type debian_menu_t, file_type, sysadmfile; r_dir_file(userdomain, debian_menu_t) -dontaudit install_menu_t sysadm_home_dir_t:dir search; +if (!disable_dontaudit) +{ + dontaudit install_menu_t sysadm_home_dir_t:dir search; +} allow install_menu_t debian_menu_t:dir create_dir_perms; allow install_menu_t debian_menu_t:{ file lnk_file } create_file_perms; allow install_menu_t dpkg_lock_t:file { setattr rw_file_perms };
selinux-usr/policy/domains/program/unused/fingerd.te +12 -3
@@ -35,7 +35,10 @@ allow fingerd_t self:capability { setgid setuid }; # for gzip from logrotate -dontaudit fingerd_t self:capability fsetid; +if (!disable_dontaudit) +{ + dontaudit fingerd_t self:capability fsetid; +} # cfingerd runs shell scripts allow fingerd_t { bin_t sbin_t }:dir search;
@@ -61,7 +64,10 @@ allow fingerd_t user_home_type:file { getattr read }; # stop it accessing sub-directories, prevents checking a Maildir for new mail, # have to change this when we create a type for Maildir -dontaudit fingerd_t user_home_t:dir search; +if (!disable_dontaudit) +{ + dontaudit fingerd_t user_home_t:dir search; +} # for mail allow fingerd_t { var_spool_t mail_spool_t }:dir search;
@@ -70,7 +76,10 @@ # see who is logged in and when users last logged in allow fingerd_t { initrc_var_run_t lastlog_t }:file { read getattr }; -dontaudit fingerd_t initrc_var_run_t:file lock; +if (!disable_dontaudit) +{ + dontaudit fingerd_t initrc_var_run_t:file lock; +} allow fingerd_t devpts_t:dir search; allow fingerd_t ptyfile:chr_file getattr;
selinux-usr/policy/domains/program/unused/ftpd.te +5 -2
@@ -81,5 +81,8 @@ allow ftpd_t { etc_t resolv_conf_t etc_runtime_t }:file { getattr read }; allow ftpd_t proc_t:file { getattr read }; -dontaudit ftpd_t sysadm_home_dir_t:dir getattr; -dontaudit ftpd_t random_device_t:chr_file read; +if (!disable_dontaudit) +{ + dontaudit ftpd_t sysadm_home_dir_t:dir getattr; + dontaudit ftpd_t random_device_t:chr_file read; +}
selinux-usr/policy/domains/program/unused/hotplug.te +21 -7
@@ -69,10 +69,16 @@ allow hotplug_t modules_dep_t:file { getattr read ioctl }; # for lsmod -dontaudit hotplug_t self:capability sys_module; +if (!disable_dontaudit) +{ + dontaudit hotplug_t self:capability sys_module; +} # for access("/etc/bashrc", X_OK) on Red Hat -dontaudit hotplug_t self:capability dac_read_search; +if (!disable_dontaudit) +{ + dontaudit hotplug_t self:capability dac_read_search; +} ifdef(`fsadm.te', ` domain_auto_trans(hotplug_t, fsadm_exec_t, fsadm_t)
@@ -81,9 +87,11 @@ allow hotplug_t var_log_t:dir search; # for ps -dontaudit hotplug_t domain:dir { getattr search }; -dontaudit hotplug_t { init_t kernel_t }:file read; -ifdef(`initrc.te', ` +if (!disable_dontaudit) +{ + dontaudit hotplug_t domain:dir { getattr search }; + dontaudit hotplug_t { init_t kernel_t }:file read; +} can_ps(hotplug_t, initrc_t) ') ifdef(`modutil.te', `
@@ -91,10 +99,16 @@ ') # for when /var is not mounted early in the boot -dontaudit hotplug_t file_t:dir search; +if (!disable_dontaudit) +{ + dontaudit hotplug_t file_t:dir search; +} # kernel threads inherit from shared descriptor table used by init -dontaudit hotplug_t initctl_t:fifo_file { read write }; +if (!disable_dontaudit) +{ + dontaudit hotplug_t initctl_t:fifo_file { read write }; +} # Read /usr/lib/gconv/.* allow hotplug_t lib_t:file { getattr read };
selinux-usr/policy/domains/program/unused/ipsec.te +14 -7
@@ -111,12 +111,17 @@ allow ipsec_mgmt_t system_map_t:file { read getattr }; # denials when ps tries to search /proc. Do not audit these denials. -dontaudit ipsec_mgmt_t domain:dir r_dir_perms; +if (!disable_dontaudit) +{ + dontaudit ipsec_mgmt_t domain:dir r_dir_perms; +} # suppress audit messages about unnecessary socket access -dontaudit ipsec_mgmt_t domain:key_socket { read write }; -dontaudit ipsec_mgmt_t domain:udp_socket { read write }; - +if (!disable_dontaudit) +{ + dontaudit ipsec_mgmt_t domain:key_socket { read write }; + dontaudit ipsec_mgmt_t domain:udp_socket { read write }; +} # from rbac role system_r types { ipsec_t ipsec_mgmt_t };
@@ -139,9 +144,11 @@ allow ipsec_t bin_t:dir { search }; allow ipsec_t device_t:dir { getattr search }; allow ipsec_mgmt_t device_t:dir { getattr search read }; -dontaudit ipsec_mgmt_t tty_device_t:chr_file getattr; -dontaudit ipsec_mgmt_t devpts_t:dir getattr; -allow ipsec_mgmt_t etc_t:lnk_file read; +if (!disable_dontaudit) +{ + dontaudit ipsec_mgmt_t tty_device_t:chr_file getattr; + dontaudit ipsec_mgmt_t devpts_t:dir getattr; +} allow ipsec_mgmt_t var_t:dir { search }; allow ipsec_mgmt_t sbin_t:dir { search }; allow ipsec_mgmt_t bin_t:dir { search };
selinux-usr/policy/domains/program/unused/loadkeys.te +8 -2
@@ -16,7 +16,10 @@ domain_auto_trans(unpriv_userdomain, loadkeys_exec_t, loadkeys_t) uses_shlib(loadkeys_t) -dontaudit loadkeys_t proc_t:dir search; +if (!disable_dontaudit) +{ + dontaudit loadkeys_t proc_t:dir search; +} allow loadkeys_t proc_t:file { getattr read }; allow loadkeys_t self:process { fork sigchld };
@@ -27,7 +30,10 @@ read_locale(loadkeys_t) -dontaudit loadkeys_t etc_runtime_t:file { getattr read }; +if (!disable_dontaudit) +{ + dontaudit loadkeys_t etc_runtime_t:file { getattr read }; +} # Use capabilities. allow loadkeys_t self:capability { setuid sys_tty_config };
selinux-usr/policy/domains/program/unused/lpd.te +4 -1
@@ -76,7 +76,10 @@ allow lpd_t proc_t:file { getattr read }; # gs-gnu wants to read some sysctl entries, it seems to work without though -dontaudit lpd_t { sysctl_t sysctl_kernel_t }:dir search; +if (!disable_dontaudit) +{ + dontaudit lpd_t { sysctl_t sysctl_kernel_t }:dir search; +} # for defoma r_dir_file(lpd_t, var_lib_t)
selinux-usr/policy/domains/program/unused/mailman.te +8 -2
@@ -44,7 +44,10 @@ allow mailman_queue_t sysadm_home_dir_t:dir { getattr search }; mailman_domain(mail) -dontaudit mailman_mail_t mta_delivery_agent:tcp_socket { read write }; +if (!disable_dontaudit) +{ + dontaudit mailman_mail_t mta_delivery_agent:tcp_socket { read write }; +} allow mailman_mail_t mta_delivery_agent:fd use; ifdef(`qmail.te', ` allow mailman_mail_t qmail_spool_t:file { read ioctl getattr };
@@ -64,7 +67,10 @@ allow httpd_t mailman_data_t:dir search; r_dir_file(mailman_cgi_t, mailman_archive_t) -dontaudit mailman_cgi_t httpd_log_t:file append; +if (!disable_dontaudit) +{ + dontaudit mailman_cgi_t httpd_log_t:file append; +} allow httpd_t mailman_cgi_t:process signal; allow mailman_cgi_t httpd_t:process sigchld; allow mailman_cgi_t httpd_t:fd use;
selinux-usr/policy/domains/program/unused/mrtg.te +32 -8
@@ -46,7 +46,10 @@ ') allow mrtg_t proc_t:file { read getattr }; -dontaudit mrtg_t proc_t:file ioctl; +if (!disable_dontaudit) +{ + dontaudit mrtg_t proc_t:file ioctl; +} allow mrtg_t { var_lock_t var_lib_t }:dir search; rw_dir_create_file(mrtg_t, var_lib_mrtg_t)
@@ -54,13 +57,22 @@ # read config files allow mrtg_t { etc_t etc_mrtg_t resolv_conf_t }:file { read getattr }; -dontaudit mrtg_t etc_mrtg_t:file ioctl; +if (!disable_dontaudit) +{ + dontaudit mrtg_t etc_mrtg_t:file ioctl; +} allow mrtg_t etc_mrtg_t:dir { read search getattr }; -dontaudit mrtg_t etc_mrtg_t:dir write; +if (!disable_dontaudit) +{ + dontaudit mrtg_t etc_mrtg_t:dir write; +} read_locale(mrtg_t) # for /.autofsck -dontaudit mrtg_t root_t:file getattr; +if (!disable_dontaudit) +{ + dontaudit mrtg_t root_t:file getattr; +} allow mrtg_t { sysctl_t sysctl_kernel_t }:dir search; allow mrtg_t sysctl_kernel_t:file read;
@@ -68,15 +80,27 @@ # for uptime allow mrtg_t var_run_t:dir search; allow mrtg_t initrc_var_run_t:file read; -dontaudit mrtg_t initrc_var_run_t:file { write lock }; +if (!disable_dontaudit) +{ + dontaudit mrtg_t initrc_var_run_t:file { write lock }; +} allow mrtg_t etc_runtime_t:file { getattr read }; allow mrtg_t tmp_t:dir getattr; # should not need this! allow mrtg_t sysadm_home_dir_t:dir { search read getattr }; -dontaudit mrtg_t { boot_t device_t file_labels_t file_t lost_found_t }:dir getattr; +if (!disable_dontaudit) +{ + dontaudit mrtg_t { boot_t device_t file_labels_t file_t lost_found_t }:dir getattr; +} ifdef(`quota.te', ` -dontaudit mrtg_t quota_db_t:file getattr; +if (!disable_dontaudit) +{ + dontaudit mrtg_t quota_db_t:file getattr; +} ') -dontaudit mrtg_t root_t:lnk_file getattr; +if (!disable_dontaudit) +{ + dontaudit mrtg_t root_t:lnk_file getattr; +}
selinux-usr/policy/domains/program/unused/named.te +8 -2
@@ -118,7 +118,10 @@ allow ndc_t named_zone_t:dir search; # for chmod in start script -dontaudit initrc_t named_var_run_t:dir setattr; +if (!disable_dontaudit) +{ + dontaudit initrc_t named_var_run_t:dir setattr; +} # for ndc_t to be used for restart shell scripts ifdef(`ndc_shell_script', `
@@ -131,5 +134,8 @@ allow ndc_t named_var_run_t:file getattr; allow ndc_t named_zone_t:dir { read getattr }; allow ndc_t named_zone_t:file getattr; -dontaudit ndc_t sysadm_home_t:dir { getattr search read }; +if (!disable_dontaudit) +{ + dontaudit ndc_t sysadm_home_t:dir { getattr search read }; +} ')
selinux-usr/policy/domains/program/unused/netsaint.te +14 -7
@@ -21,9 +21,11 @@ tmp_domain(netsaint) allow system_mail_t netsaint_tmp_t:file { getattr read }; # for open file handles -dontaudit system_mail_t etc_netsaint_t:file read; -dontaudit system_mail_t netsaint_log_t:fifo_file read; - +if (!disable_dontaudit) +{ + dontaudit system_mail_t etc_netsaint_t:file read; + dontaudit system_mail_t netsaint_log_t:fifo_file read; +} # Use the network. allow netsaint_t self:fifo_file rw_file_perms; allow netsaint_t self:unix_stream_socket create_socket_perms;
@@ -70,7 +72,10 @@ r_dir_file(netsaint_cgi_t, { proc_t self netsaint_t }) allow netsaint_cgi_t boot_t:dir search; allow netsaint_cgi_t system_map_t:file { getattr read }; -dontaudit netsaint_cgi_t domain:dir getattr; +if (!disable_dontaudit) +{ + dontaudit netsaint_cgi_t domain:dir getattr; +} allow netsaint_cgi_t self:unix_stream_socket create_socket_perms; ifdef(`apache.te', `
@@ -82,6 +87,8 @@ ifdef(`ping.te', ` domain_auto_trans(netsaint_t, ping_exec_t, ping_t) allow netsaint_t ping_t:process { sigkill signal }; -dontaudit ping_t etc_netsaint_t:file read; -dontaudit ping_t netsaint_log_t:fifo_file read; -') +if (!disable_dontaudit) +{ + dontaudit ping_t etc_netsaint_t:file read; + dontaudit ping_t netsaint_log_t:fifo_file read; +}
selinux-usr/policy/domains/program/unused/nscd.te +4 -1
@@ -32,4 +32,7 @@ # for when /etc/passwd has just been updated and has the wrong type allow nscd_t shadow_t:file getattr; -dontaudit nscd_t sysadm_home_dir_t:dir search; +if (!disable_dontaudit) +{ + dontaudit nscd_t sysadm_home_dir_t:dir search; +}
selinux-usr/policy/domains/program/unused/ntpd.te +8 -2
@@ -23,7 +23,10 @@ allow ntpd_t self:capability { setgid setuid sys_time net_bind_service ipc_lock }; allow ntpd_t self:process { setcap setsched }; # ntpdate wants sys_nice -dontaudit ntpd_t self:capability { fsetid sys_nice }; +if (!disable_dontaudit) +{ + dontaudit ntpd_t self:capability { fsetid sys_nice }; +} # for some reason it creates a file in /tmp tmp_domain(ntpd)
@@ -58,7 +61,10 @@ allow ntpd_t proc_t:file r_file_perms; allow ntpd_t sysadm_home_dir_t:dir r_dir_perms; allow ntpd_t self:file read; -dontaudit ntpd_t domain:dir search; +if (!disable_dontaudit) +{ + dontaudit ntpd_t domain:dir search; +} ') allow ntpd_t devtty_t:chr_file rw_file_perms;
selinux-usr/policy/domains/program/unused/ping.te +8 -2
@@ -51,7 +51,13 @@ ifdef(`gnome-pty-helper.te', `allow ping_t sysadm_gph_t:fd use;') allow ping_t privfd:fd use; -dontaudit ping_t fs_t:filesystem getattr; +if (!disable_dontaudit) +{ + dontaudit ping_t fs_t:filesystem getattr; +} # it tries to access /var/run -dontaudit ping_t var_t:dir search; +if (!disable_dontaudit) +{ + dontaudit ping_t var_t:dir search; +}
selinux-usr/policy/domains/program/unused/postfix.te +12 -3
@@ -104,7 +104,10 @@ allow postfix_master_t postfix_spool_t:dir create_dir_perms; allow postfix_master_t postfix_spool_t:file rw_file_perms; -dontaudit postfix_master_t man_t:dir search; +if (!disable_dontaudit) +{ + dontaudit postfix_master_t man_t:dir search; +} define(`postfix_server_domain', ` postfix_domain($1, `$2')
@@ -140,7 +143,10 @@ ifdef(`procmail.te', ` domain_auto_trans(postfix_local_t, procmail_exec_t, procmail_t) # for a bug in the postfix local program -dontaudit procmail_t postfix_local_t:tcp_socket { read write }; +if (!disable_dontaudit) +{ + dontaudit procmail_t postfix_local_t:tcp_socket { read write }; +} ') allow postfix_local_t etc_aliases_t:file r_file_perms; allow postfix_local_t self:fifo_file rw_file_perms;
@@ -218,7 +224,10 @@ allow postfix_postdrop_t user_mail_domain:unix_stream_socket rw_socket_perms; allow postfix_postdrop_t postfix_public_t:dir search; allow postfix_postdrop_t postfix_public_t:fifo_file rw_file_perms; -dontaudit postfix_postdrop_t { ptyfile ttyfile }:chr_file { read write }; +if (!disable_dontaudit) +{ + dontaudit postfix_postdrop_t { ptyfile ttyfile }:chr_file { read write }; +} allow postfix_master_t postfix_postdrop_exec_t:file getattr; ifdef(`crond.te', `allow postfix_postdrop_t { crond_t system_crond_t }:fd use;
selinux-usr/policy/domains/program/unused/postgresql.te +8 -2
@@ -22,10 +22,16 @@ can_exec(postgresql_t, dpkg_exec_t) ') -dontaudit postgresql_t sysadm_home_dir_t:dir search; +if (!disable_dontaudit) +{ + dontaudit postgresql_t sysadm_home_dir_t:dir search; +} # quiet ps -dontaudit postgresql_t domain:dir getattr; +if (!disable_dontaudit) +{ + dontaudit postgresql_t domain:dir getattr; +} # for currect directory of scripts allow postgresql_t { var_spool_t cron_spool_t }:dir search;
selinux-usr/policy/domains/program/unused/procmail.te +4 -1
@@ -53,6 +53,9 @@ allow procmail_t var_run_t:dir { getattr search }; # Do not audit attempts to access /root. -dontaudit procmail_t sysadm_home_dir_t:dir { getattr search }; +if (!disable_dontaudit) +{ + dontaudit procmail_t sysadm_home_dir_t:dir { getattr search }; +} allow procmail_t devtty_t:chr_file { read write };
selinux-usr/policy/domains/program/unused/qmail.te +8 -2
@@ -55,7 +55,10 @@ allow qmail_lspawn_t qmail_spool_t:file { read getattr }; allow qmail_lspawn_t etc_t:file { getattr read }; allow qmail_lspawn_t tmp_t:dir getattr; -dontaudit qmail_lspawn_t user_home_dir_type:dir { getattr search }; +if (!disable_dontaudit) +{ + dontaudit qmail_lspawn_t user_home_dir_type:dir { getattr search }; +} qmail_daemon_domain(send) rw_dir_create_file(qmail_send_t, qmail_spool_t)
@@ -68,7 +71,10 @@ qmail_daemon_domain(splogger) allow qmail_splogger_t self:unix_dgram_socket create_socket_perms;
Lines of this file are not shown. View the raw message.
selinux-usr/policy/domains/program/unused/quota.te +4 -1
Lines of this file are not shown. View the raw message.
selinux-usr/policy/domains/program/unused/radius.te +4 -1
Lines of this file are not shown. View the raw message.
selinux-usr/policy/domains/program/unused/rpm.te +12 -3
Lines of this file are not shown. View the raw message.
selinux-usr/policy/domains/program/unused/scannerdaemon.te +6 -3
Lines of this file are not shown. View the raw message.
selinux-usr/policy/domains/program/unused/sendmail.te +8 -2
Lines of this file are not shown. View the raw message.
selinux-usr/policy/domains/program/unused/squid.te +4 -1
Lines of this file are not shown. View the raw message.
selinux-usr/policy/domains/program/unused/sxid.te +16 -4
Lines of this file are not shown. View the raw message.
selinux-usr/policy/domains/program/unused/sysstat.te +12 -3
Lines of this file are not shown. View the raw message.
selinux-usr/policy/domains/program/unused/tcpd.te +4 -1
Lines of this file are not shown. View the raw message.
selinux-usr/policy/domains/program/unused/traceroute.te +5 -2
Lines of this file are not shown. View the raw message.
selinux-usr/policy/domains/program/unused/updfstab.te +5 -3
Lines of this file are not shown. View the raw message.
selinux-usr/policy/domains/program/unused/userhelper.te +8 -2
Lines of this file are not shown. View the raw message.
selinux-usr/policy/domains/program/unused/watchdog.te +4 -1
Lines of this file are not shown. View the raw message.
selinux-usr/policy/domains/program/unused/xdm.te +28 -12
Lines of this file are not shown. View the raw message.
selinux-usr/policy/domains/program/unused/xserver.te +4 -1
Lines of this file are not shown. View the raw message.
selinux-usr/policy/domains/program/useradd.te +14 -5
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
selinux-usr/checkpolicy/avtab.c +208 -60
268 lines not on this page · raw message
selinux-usr/checkpolicy/checkpolicy.c +177 -8
185 lines not on this page · raw message
selinux-usr/checkpolicy/conditional.c new file +715 -0
715 lines not on this page · raw message
selinux-usr/checkpolicy/conditional.h new file +106 -0
106 lines not on this page · raw message
selinux-usr/checkpolicy/policy_parse.y +895 -5
900 lines not on this page · raw message
selinux-usr/checkpolicy/policydb.c +78 -15
93 lines not on this page · raw message
selinux-usr/checkpolicy/test/Makefile new file +38 -0
Lines of this file are not shown. View the raw message.
selinux-usr/checkpolicy/test/dispol.c new file +415 -0
415 lines not on this page · raw message
selinux-usr/checkpolicy/write.c +210 -45
255 lines not on this page · raw message
selinux-usr/libselinux/include/selinux/selinux.h +14 -0
Lines of this file are not shown. View the raw message.
selinux-usr/libselinux/src/booleans.c new file +206 -0
206 lines not on this page · raw message
selinux-usr/libselinux/utils/change_bool.c new file +38 -0
Lines of this file are not shown. View the raw message.
selinux-usr/libselinux/utils/show_bools.c new file +42 -0
42 lines not on this page · raw message
selinux-usr/policy/domains/program/unused/ping.te +11 -0
Lines of this file are not shown. View the raw message.
selinux-usr/selinux-doc/README.CONDITIONAL new file +325 -0
325 lines not on this page · raw message
selinux-usr/selinux-doc/selinux-doc.spec +1 -1
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.
Quoted 4 lines · Karl MacMillan
This release includes modifications to the linux kernel, checkpolicy, libselinux, and the default policy and allows the creation and loading of conditional policies. Any testing or feedback would be greatly appreciated.
At least until fine-grained labeling support exists for selinuxfs, I'd suggest adding a new permission for controlling writes to your booleans rather than re-using setenforce, as the latter conveys too much power. Even if fine-grained labeling support is added, you may still want to retain such a permission to provide a coarse-grained first level of control over who can set the booleans. The two patches below add a setbool permission to the kernel and policy for that purpose, and adjusts your code to use it instead of setenforce.
With regard to fine-grained labeling, it should be straightforward for your sel_make_bools() code to call security_genfs_sid and set the SID in the inode security structure for the boolean inodes, as you have all of the necessary information available there. You can then set the inode security structure initialized flag, and thereby avoid having inode_doinit clobber your SID value when d_instantiate is called.
Signature · 2 lines
Stephen Smalley <[email protected]> National Security Agency
security/selinux/include/av_permissions.h +1 -0
@@ -512,6 +514,7 @@#define SECURITY__COMPUTE_RELABEL 0x00000020UL#define SECURITY__COMPUTE_USER 0x00000040UL#define SECURITY__SETENFORCE 0x00000080UL +#define SECURITY__SETBOOL 0x00000100UL#define SYSTEM__IPC_INFO 0x00000001UL#define SYSTEM__SYSLOG_READ 0x00000002UL
security/selinux/include/av_perm_to_string.h +1 -0
@@ -84,6 +84,7 @@ { SECCLASS_SECURITY, SECURITY__COMPUTE_RELABEL, "compute_relabel" }, { SECCLASS_SECURITY, SECURITY__COMPUTE_USER, "compute_user" }, { SECCLASS_SECURITY, SECURITY__SETENFORCE, "setenforce" }, + { SECCLASS_SECURITY, SECURITY__SETBOOL, "setbool" }, { SECCLASS_SYSTEM, SYSTEM__IPC_INFO, "ipc_info" }, { SECCLASS_SYSTEM, SYSTEM__SYSLOG_READ, "syslog_read" }, { SECCLASS_SYSTEM, SYSTEM__SYSLOG_MOD, "syslog_mod" },
security/selinux/selinuxfs.c +2 -2
@@ -722,7 +722,7 @@down (&sel_sem); - length =task_has_security (current,SECURITY__SETENFORCE ); + length =task_has_security (current,SECURITY__SETBOOL );if (length) goto out;
@@ -778,7 +778,7 @@down (&sel_sem); - length =task_has_security (current,SECURITY__SETENFORCE ); + length =task_has_security (current,SECURITY__SETBOOL );if (length) goto out;
Index: policy/flask/access_vectors
===================================================================
RCS file: /nfshome/pal/CVS/selinux-usr/policy/flask/access_vectors,v retrieving revision 1.4
flask/access_vectors +1 -0
@@ -286,6 +286,7 @@ compute_relabel compute_user setenforce # was avc_toggle in system class + setbool }
Quoted 6 lines · Stephen Smalley
Quoted 4 lines · Karl MacMillan
This release includes modifications to the linux kernel, checkpolicy, libselinux, and the default policy and allows the creation and loading of conditional policies. Any testing or feedback would be greatly appreciated.
Quoted 9 lines
At least until fine-grained labeling support exists for selinuxfs, I'd suggest adding a new permission for controlling writes to your booleans rather than re-using setenforce, as the latter conveys too much power. Even if fine-grained labeling support is added, you may still want to retain such a permission to provide a coarse-grained first level of control over who can set the booleans. The two patches below add a setbool permission to the kernel and policy for that purpose, and adjusts your code to use it instead of setenforce.
Sounds good - I put that in as a temporary measure until the fine-grained labeling came along, but I agree that this is better and that this is a good thing to keep permanently.
Thanks,
Karl
Signature · 11 lines
Karl MacMillan Tresys Technology [email protected] http://www.tresys.com (410) 290-1411 x134 -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 11 lines · Karl MacMillan
A new release of the conditional policy extensions to SELinux is available from our website:
http://www.tresys.com/selinux/index.html
Patches are also attached to this email. The conditional policy extensions to SELinux allow runtime modification of the security policy without having to load a new policy. Using boolean variables and expressions, it is possible to define sections of policy that are conditionally applied. Please see the website for more information.
Quoted 4 lines
This release includes modifications to the linux kernel, checkpolicy, libselinux, and the default policy and allows the creation and loading of conditional policies. Any testing or feedback would be greatly appreciated.
Just to let people know (if they haven't already noticed), we have merged the Tresys conditional policy extensions into our internal tree for inclusion in our next release, and we have pushed the merged code into the sourceforge CVS tree for linux-2.6 and selinux-usr. The extensions change the binary policy format and increment the policy version, so please note the following:
- checkpolicy will still generate the old format if passed a -c option (dropping any booleans and conditional blocks with a warning in that case), and a POLICYCOMPAT definition has been added to the policy Makefile that can be uncommented to cause generation of a policy.15 file for kernels that do not include the Tresys patch (i.e. a vanilla kernel.org kernel or a Fedora Core development kernel). Hence, if you update to the new checkpolicy but are using a kernel without the Tresys patch, then you will want to uncomment the definition for your policy builds.
- The patched kernel will accept either policy version, but at present, /sbin/init will only try to load the version obtained via /selinux/policyvers, which will be 16. We may want to change the SysVinit-selinux patch to retry with the prior policy version if it cannot find the current version, so that if someone updates their kernel to one that includes the Tresys patch but does not update their policy to the newer version, the system will still load the old policy and function as expected.
- The extensions are only implemented for the 2.6-based SELinux. 2.4 SELinux users will need to uncomment the POLICYCOMPAT definition in the policy Makefile. More about the 2.4-based SELinux in a separate message to follow.
Signature · 8 lines
Stephen Smalley <[email protected]> National Security Agency -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.