Latest diffs
Subsystems (2)
Some cleanups in strict to handle turning off unlimitedRC
Add CVS and uucpd policy. These need work if someone want s to play with them.
Added audit_control to login domains to handle pam_loginuid.so
Fixes for syslogng
Cleanup of auditd.te
Netlink changes to handle new auditing pam modules
Fix locations of acrobat
Handle /srv file systems
Add Russell's Compat stuff to make transitioning from targeted to strict cleaner
Change location of crack lib
Minor fixes to tighten up name_connect
Eliminate sysadmfile from policy files to separate sysadm_t from secadm_t
domains/program/crond.te +3 -1
@@ -88,6 +88,8 @@ system_crond_entry(rpm_exec_t, rpm_t) allow system_crond_t rpm_log_t:file create_file_perms; +#read ahead wants to read this +allow initrc_t system_cron_spool_t:file { getattr read }; ') ')
@@ -210,6 +212,6 @@ # Required for webalizer # ifdef(`apache.te', ` -allow system_crond_t httpd_log_t:file { getattr read }; +allow system_crond_t { httpd_log_t httpd_config_t }:file { getattr read }; ') dontaudit crond_t self:capability sys_tty_config;
domains/program/cvs.te +16 -0
@@ -0,0 +1,16 @@ +#DESC cvs - Concurrent Versions System +# +# Author: Dan Walsh <[email protected]> +# +# Depends: inetd.te + +################################# +# +# Rules for the cvs_t domain. +# +# cvs_exec_t is the type of the cvs executable. +# + +inetd_child_domain(cvs, tcp) +type cvs_data_t, file_type, sysadmfile; +create_dir_file(cvs_t, cvs_data_t)
domains/program/initrc.te +3 -3
@@ -12,7 +12,7 @@ # initrc_exec_t is the type of the init program. # # do not use privmail for sendmail as it creates a type transition conflict -type initrc_t, ifdef(`unlimitedRC', `admin, etc_writer, fs_domain, privmem, auth_write, ') domain, privlog, privowner, privmodule, ifdef(`sendmail.te', `', `privmail,') ifdef(`distro_debian', `etc_writer, ') sysctl_kernel_writer, nscd_client_domain; +type initrc_t, fs_domain, ifdef(`unlimitedRC', `admin, etc_writer, privmem, auth_write, ') domain, privlog, privowner, privmodule, ifdef(`sendmail.te', `', `privmail,') ifdef(`distro_debian', `etc_writer, ') sysctl_kernel_writer, nscd_client_domain; role system_r types initrc_t; uses_shlib(initrc_t);
@@ -195,10 +195,8 @@ allow initrc_t tmpfs_t:chr_file rw_file_perms; allow initrc_t tmpfs_t:dir r_dir_perms; -ifdef(`distro_redhat', ` # Allow initrc domain to set the enforcing flag. can_setenforce(initrc_t) -') # # readahead asks for these
@@ -209,6 +207,7 @@ # for /halt /.autofsck and other flag files file_type_auto_trans({ initrc_t sysadm_t }, root_t, etc_runtime_t, file) +file_type_auto_trans(initrc_t, device_t, fixed_disk_device_t, blk_file) ')dnl end distro_redhat allow initrc_t system_map_t:{ file lnk_file } r_file_perms;
@@ -310,3 +309,4 @@ domain_auto_trans(sysadm_t,initrc_exec_t,run_init_t) ') allow initrc_t self:netlink_route_socket r_netlink_socket_perms; +allow initrc_t device_t:lnk_file create_file_perms;
domains/program/load_policy.te +1 -0
@@ -58,3 +58,4 @@ read_locale(load_policy_t) r_dir_file(load_policy_t, selinux_config_t) +allow load_policy_t proc_t:file { getattr read };
domains/program/login.te +1 -1
@@ -65,7 +65,7 @@ ') # Use capabilities -allow $1_login_t self:capability { dac_override chown fowner fsetid kill setgid setuid net_bind_service sys_nice sys_resource sys_tty_config }; +allow $1_login_t self:capability { audit_control dac_override chown fowner fsetid kill setgid setuid net_bind_service sys_nice sys_resource sys_tty_config }; allow $1_login_t self:process setrlimit; dontaudit $1_login_t sysfs_t:dir search;
domains/program/modutil.te +1 -0
@@ -54,6 +54,7 @@ # Read module objects. allow depmod_t modules_object_t:dir r_dir_perms; allow depmod_t modules_object_t:{ file lnk_file } r_file_perms; +allow depmod_t modules_object_t:file unlink; # Access terminals. allow depmod_t { console_device_t initrc_devpts_t admin_tty_type }:chr_file rw_file_perms;
domains/program/ssh.te +1 -1
@@ -71,7 +71,7 @@ can_network($1_t) allow $1_t port_type:tcp_socket name_connect; -allow $1_t self:capability { kill sys_chroot sys_resource chown dac_override fowner fsetid setgid setuid sys_tty_config }; +allow $1_t self:capability { audit_control kill sys_chroot sys_resource chown dac_override fowner fsetid setgid setuid sys_tty_config }; allow $1_t { home_root_t home_dir_type }:dir { search getattr }; if (use_nfs_home_dirs) { allow $1_t autofs_t:dir { search getattr };
domains/program/syslogd.te +2 -0
@@ -111,4 +111,6 @@ allow syslogd_t kernel_t:system { syslog_mod syslog_console }; allow syslogd_t self:capability { sys_admin chown fsetid }; allow syslogd_t var_log_t:dir { create setattr }; +allow syslogd_t syslogd_port_t:tcp_socket name_bind; +allow syslogd_t rsh_port_t:tcp_socket name_connect; }
domains/program/unused/apache.te +1 -0
@@ -401,3 +401,4 @@ dontaudit system_mail_t httpd_t:tcp_socket { read write }; ') +allow httpd_t var_t:file read;
domains/program/unused/auditd.te +24 -2
@@ -2,11 +2,33 @@ # # Authors: Colin Walters <[email protected]> # +define(`audit_manager_domain', ` +allow $1 auditd_etc_t:file rw_file_perms; +create_dir_file($1, auditd_log_t) +') + +type auditd_etc_t, file_type, secure_file_type; daemon_domain(auditd) -allow auditd_t self:netlink_audit_socket { bind create getattr nlmsg_read nlmsg_write read write }; + +allow auditd_t self:netlink_audit_socket create_netlink_socket_perms; allow auditd_t self:capability { audit_write audit_control }; allow auditd_t sysadm_tty_device_t:chr_file rw_file_perms; allow auditd_t self:unix_dgram_socket create_socket_perms; allow auditd_t etc_t:file { getattr read }; -log_domain(auditd) + +# Don't use logdir_domain since this is a security file +type auditd_log_t, file_type, secure_file_type; +file_type_auto_trans(auditd_t, var_log_t, auditd_log_t, file) +allow auditd_t auditd_log_t:dir { setattr rw_dir_perms }; + +can_exec(auditd_t, init_exec_t) +allow auditd_t auditd_etc_t:file r_file_perms; + +audit_manager_domain(secadm_t) + +ifdef(`separate_secadm', `', ` +audit_manager_domain(sysadm_t) +') +can_exec(auditd_t, init_exec_t) +allow auditd_t initctl_t:fifo_file write;
domains/program/unused/cups.te +5 -3
@@ -166,7 +166,11 @@ allow cupsd_t printconf_t:file { getattr read }; +ifdef(`dbusd.te', ` dbusd_client(system, cupsd) +allow cupsd_t system_dbusd_t:dbus send_msg; +allow cupsd_t userdomain:dbus send_msg; +') ifdef(`hald.te', `
@@ -208,12 +212,10 @@ dbusd_client(system, cupsd_config) allow cupsd_config_t userdomain:dbus send_msg; allow cupsd_config_t system_dbusd_t:dbus { send_msg acquire_svc }; -allow cupsd_t system_dbusd_t:dbus send_msg; +allow cupsd_t hald_t:dbus send_msg; allow userdomain cupsd_config_t:dbus send_msg; allow cupsd_config_t hald_t:dbus send_msg; allow hald_t cupsd_config_t:dbus send_msg; -allow cupsd_t userdomain:dbus send_msg; -allow cupsd_t hald_t:dbus send_msg; allow hald_t cupsd_t:dbus send_msg; ')dnl end if dbusd.te
domains/program/unused/dmidecode.te +1 -0
@@ -8,6 +8,7 @@ # Allow execution by the sysadm role sysadm_r types dmidecode_t; +role system_r types dmidecode_t; domain_auto_trans(sysadm_t, dmidecode_exec_t, dmidecode_t) uses_shlib(dmidecode_t)
domains/program/unused/ftpd.te +0 -3
@@ -9,8 +9,6 @@ # # Rules for the ftpd_t domain # -type ftp_port_t, port_type, reserved_port_type; -type ftp_data_port_t, port_type, reserved_port_type; daemon_domain(ftpd, `, auth_chkpwd') etc_domain(ftpd)
@@ -113,7 +111,6 @@ # # Type for access to anon ftp # -type ftpd_anon_t, file_type, sysadmfile, customizable; r_dir_file(ftpd_t,ftpd_anon_t) type ftpd_anon_rw_t, file_type, sysadmfile, customizable; create_dir_file(ftpd_t,ftpd_anon_rw_t)
domains/program/unused/NetworkManager.te +7 -0
@@ -53,6 +53,10 @@ ') allow NetworkManager_t initrc_t:dbus send_msg; allow initrc_t NetworkManager_t:dbus send_msg; +ifdef(`targeted_policy', ` +allow NetworkManager_t unconfined_t:dbus send_msg; +allow unconfined_t NetworkManager_t:dbus send_msg; +') ') allow NetworkManager_t usr_t:file { getattr read };
@@ -70,6 +74,7 @@ allow NetworkManager_t { etc_t etc_runtime_t }:file { getattr read }; allow NetworkManager_t proc_t:file { getattr read }; +r_dir_file(NetworkManager_t, proc_net_t) allow NetworkManager_t { domain -unrestricted }:dir search; allow NetworkManager_t { domain -unrestricted }:file { getattr read };
@@ -80,3 +85,5 @@ allow NetworkManager_t initrc_var_run_t:file { getattr read }; domain_auto_trans(NetworkManager_t, insmod_exec_t, insmod_t) +allow NetworkManager_t self:netlink_route_socket r_netlink_socket_perms; +
domains/program/unused/ntpd.te +1 -1
@@ -84,4 +84,4 @@ allow ntpd_t winbind_var_run_t:dir r_dir_perms; allow ntpd_t winbind_var_run_t:sock_file rw_file_perms; ') - +allow sysadm_t ntp_port_t:udp_socket name_bind;
domains/program/unused/publicfile.te +0 -6
@@ -6,12 +6,6 @@ # this policy depends on ucspi-tcp # -ifdef(`ftpd.te', ` -', ` -type ftp_port_t, port_type, reserved_port_type; -type ftp_data_port_t, port_type, reserved_port_type; -') - daemon_domain(publicfile) type publicfile_content_t, file_type, sysadmfile; domain_auto_trans(initrc_t, publicfile_exec_t, publicfile_t)
domains/program/unused/rshd.te +1 -3
@@ -9,7 +9,6 @@ # # Rules for the rshd_t domain. # -type rsh_port_t, port_type, reserved_port_type; daemon_sub_domain(inetd_t, rshd, `, auth_chkpwd, privuser, privrole') ifdef(`tcpd.te', `
@@ -24,8 +23,7 @@ # Use the network. can_network_server(rshd_t) -allow rshd_t reserved_port_t:tcp_socket name_bind; -dontaudit rshd_t reserved_port_type:tcp_socket name_bind; +allow rshd_t rsh_port_t:tcp_socket name_bind; can_ypbind(rshd_t)
domains/program/unused/rsync.te +0 -2
@@ -14,6 +14,4 @@ inetd_child_domain(rsync) type rsync_data_t, file_type, sysadmfile; r_dir_file(rsync_t, rsync_data_t) -ifdef(`ftpd.te', ` r_dir_file(rsync_t, ftpd_anon_t) -')
domains/program/unused/xdm.te +1 -1
@@ -69,7 +69,7 @@ # # Use capabilities. -allow xdm_t self:capability { setgid setuid sys_resource kill sys_tty_config mknod chown dac_override dac_read_search fowner fsetid ipc_owner }; +allow xdm_t self:capability { audit_control setgid setuid sys_resource kill sys_tty_config mknod chown dac_override dac_read_search fowner fsetid ipc_owner }; allow xdm_t { urandom_device_t random_device_t }:chr_file { getattr read ioctl };
domains/program/useradd.te +4 -0
@@ -98,3 +98,7 @@ allow groupadd_t self:process setrlimit; allow groupadd_t initrc_var_run_t:file r_file_perms; dontaudit groupadd_t initrc_var_run_t:file write; + +allow useradd_t default_context_t:dir search; +allow useradd_t file_context_t:dir search; +allow useradd_t file_context_t:file { getattr read };
domains/program/uucpd.te +24 -0
@@ -0,0 +1,24 @@ +#DESC uucpd - UUCP file transfer daemon +# +# Author: Dan Walsh <[email protected]> +# +# Depends: inetd.te + +################################# +# +# Rules for the uucpd_t domain. +# +# uucpd_exec_t is the type of the uucpd executable. +# + +inetd_child_domain(uucpd, tcp) +type uucpd_rw_t, file_type, sysadmfile; +type uucpd_ro_t, file_type, sysadmfile; +type uucpd_spool_t, file_type, sysadmfile; +create_dir_file(uucpd_t, uucpd_rw_t) +r_dir_file(uucpd_t, uucpd_ro_t) +allow uucpd_t sbin_t:dir search; +can_exec(uucpd_t, sbin_t) +logdir_domain(uucpd) +allow uucpd_t var_spool_t:dir search; +create_dir_file(uucpd_t, uucpd_spool_t)
file_contexts/distros.fc +3 -3
@@ -150,9 +150,9 @@ # Java, Sun Microsystems (JPackage SRPM) /usr/.*/jre/lib/i386/libdeploy.so -- system_u:object_r:texrel_shlib_t -/usr(/.*)?/Acrobat5/Reader/intellinux/plug_ins/.*\.api -- system_u:object_r:shlib_t -/usr(/.*)?/Acrobat5/Reader/intellinux/plug_ins/AcroForm\.api -- system_u:object_r:texrel_shlib_t -/usr(/.*)?/Acrobat5/Reader/intellinux/plug_ins/EScript\.api -- system_u:object_r:texrel_shlib_t +/usr(/.*)?/Reader/intellinux/plug_ins/.*\.api -- system_u:object_r:shlib_t +/usr(/.*)?/Reader/intellinux/plug_ins/AcroForm\.api -- system_u:object_r:texrel_shlib_t +/usr(/.*)?/Reader/intellinux/plug_ins/EScript\.api -- system_u:object_r:texrel_shlib_t ')
file_contexts/program/apache.fc +1 -0
@@ -1,6 +1,7 @@ # apache HOME_DIR/((www)|(web)|(public_html))(/.+)? system_u:object_r:httpd_ROLE_content_t /var/www(/.*)? system_u:object_r:httpd_sys_content_t +/srv/([^/]*/)?www(/.*)? system_u:object_r:httpd_sys_content_t /var/www/cgi-bin(/.*)? system_u:object_r:httpd_sys_script_exec_t /usr/lib/cgi-bin(/.*)? system_u:object_r:httpd_sys_script_exec_t /var/www/perl(/.*)? system_u:object_r:httpd_sys_script_exec_t
file_contexts/program/auditd.fc +6 -2
@@ -1,4 +1,8 @@ # auditd -/sbin/auditd -- system_u:object_r:auditd_exec_t /sbin/auditctl -- system_u:object_r:auditd_exec_t -/var/log/audit(/.*)? system_u:object_r:auditd_log_t +/sbin/auditd -- system_u:object_r:auditd_exec_t +/var/log/audit.log -- system_u:object_r:auditd_log_t +/var/log/audit(/.*)? system_u:object_r:auditd_log_t +/etc/auditd.conf -- system_u:object_r:auditd_etc_t +/etc/audit.rules -- system_u:object_r:auditd_etc_t +
file_contexts/program/compat.fc +55 -0
55 lines not on this page · raw message
file_contexts/program/crack.fc +1 -0
@@ -2,3 +2,4 @@ /usr/sbin/crack_[a-z]* -- system_u:object_r:crack_exec_t /var/cache/cracklib(/.*)? system_u:object_r:crack_db_t /usr/lib(64)?/cracklib_dict.* -- system_u:object_r:crack_db_t +/usr/share/cracklib(/.*)? system_u:object_r:crack_db_t
file_contexts/program/cvs.fc +2 -0
@@ -0,0 +1,2 @@ +# cvs program +/usr/bin/cvs -- system_u:object_r:cvs_exec_t
file_contexts/program/ftpd.fc +1 -0
@@ -13,3 +13,4 @@ /var/log/xferreport.* -- system_u:object_r:xferlog_t /etc/cron\.monthly/proftpd -- system_u:object_r:ftpd_exec_t /var/ftp(/.*)? system_u:object_r:ftpd_anon_t +/srv/([^/]*/)?ftp(/.*)? system_u:object_r:ftpd_anon_t
file_contexts/program/i18n_input.fc +1 -0
@@ -1,6 +1,7 @@ # i18n_input.fc /usr/sbin/htt -- system_u:object_r:i18n_input_exec_t /usr/sbin/htt_server -- system_u:object_r:i18n_input_exec_t +/usr/sbin/iiimd -- system_u:object_r:i18n_input_exec_t /usr/bin/httx -- system_u:object_r:i18n_input_exec_t /usr/bin/htt_xbe -- system_u:object_r:i18n_input_exec_t /usr/lib(64)?/im/.*\.so.* -- system_u:object_r:shlib_t
file_contexts/program/lvm.fc +1 -0
@@ -65,3 +65,4 @@ /sbin/pvremove -- system_u:object_r:lvm_exec_t /sbin/pvs -- system_u:object_r:lvm_exec_t /sbin/vgs -- system_u:object_r:lvm_exec_t +/sbin/multipathd -- system_u:object_r:lvm_exec_t
file_contexts/program/rsync.fc +1 -0
@@ -1,2 +1,3 @@ # rsync program /usr/bin/rsync -- system_u:object_r:rsync_exec_t +/srv/([^/]*/)?rsync(/.*)? system_u:object_r:ftpd_anon_t
file_contexts/program/uucpd.fc +5 -0
@@ -0,0 +1,5 @@ +# uucico program +/usr/sbin/uucico -- system_u:object_r:uucpd_exec_t +/var/spool/uucp(/.*)? system_u:object_r:uucpd_spool_t +/var/spool/uucppublic(/.*)? system_u:object_r:uucpd_spool_t +/var/log/uucp(/.*)? system_u:object_r:uucpd_log_t
file_contexts/types.fc +6 -0
@@ -478,3 +478,9 @@ /usr/lib(64)?/[^/]*thunderbird[^/]*/thunderbird-bin -- system_u:object_r:bin_t /usr/lib(64)?/[^/]*thunderbird[^/]*/run-mozilla\.sh -- system_u:object_r:bin_t /usr/lib(64)?/[^/]*thunderbird[^/]*/mozilla-xremote-client -- system_u:object_r:bin_t + +# +# /srv +# +/srv(/.*)? system_u:object_r:var_t +
macros/program/apache_macros.te +1 -1
@@ -39,7 +39,7 @@ allow httpd_$1_script_t fs_t:filesystem getattr; allow httpd_$1_script_t self:unix_stream_socket create_stream_socket_perms; -allow httpd_$1_script_t { self proc_t }:file { getattr read }; +allow httpd_$1_script_t { self proc_t }:file r_file_perms; allow httpd_$1_script_t { self proc_t }:dir r_dir_perms; allow httpd_$1_script_t { self proc_t }:lnk_file read;
macros/program/chkpwd_macros.te +1 -0
@@ -35,6 +35,7 @@ can_kerberos(auth_chkpwd) can_ldap(auth_chkpwd) can_resolve(auth_chkpwd) +allow auth_chkpwd self:netlink_audit_socket create_netlink_socket_perms; ', ` domain_auto_trans($1_t, chkpwd_exec_t, $1_chkpwd_t) allow $1_t sbin_t:dir search;
macros/program/mozilla_macros.te +4 -1
@@ -31,7 +31,10 @@ # Browse files file_browse_domain($1_mozilla_t) -can_network($1_mozilla_t) +can_network_client($1_mozilla_t) +allow $1_mozilla_t { ftp_port_t http_port_t }:tcp_socket name_connect; +#allow $1_mozilla_t port_type:tcp_socket name_connect; + uses_shlib($1_mozilla_t) read_locale($1_mozilla_t) read_sysctl($1_mozilla_t)
Makefile +3 -3
@@ -163,7 +163,7 @@ @echo "Validating file contexts files ..." $(SETFILES) -q -c $(POLICYVER) $(FC) -reload tmp/load: $(FCPATH) $(LOADPATH) +reload tmp/load: $(LOADPATH) @echo "Loading Policy ..." ifeq ($(VERS), $(KERNVERS)) $(LOADPOLICY) $(LOADPATH)
@@ -172,7 +172,7 @@ endif touch tmp/load -load: tmp/load +load: tmp/load $(FCPATH) enableaudit: policy.conf grep -v dontaudit policy.conf > policy.audit
@@ -213,8 +213,8 @@ $(FCPATH): tmp/valid_fc $(USERPATH)/system.users $(APPDIR)/customizable_types @echo "Installing file contexts files..." @mkdir -p $(CONTEXTPATH)/files - install -m 644 $(FC) $(FCPATH) install -m 644 $(HOMEDIR_TEMPLATE) $(HOMEDIRPATH) + install -m 644 $(FC) $(FCPATH) @$(GENHOMEDIRCON) -d $(TOPDIR) -t $(TYPE) $(USEPWD) $(FC): $(ALL_TUNABLES) tmp/program_used_flags.te $(FCFILES) domains/program domains/misc file_contexts/program file_contexts/misc users /etc/passwd
net_contexts +9 -3
@@ -38,10 +38,8 @@ portcon udp 892 system_u:object_r:inetd_child_port_t portcon tcp 2105 system_u:object_r:inetd_child_port_t ') -ifdef(`use_ftpd', ` portcon tcp 20 system_u:object_r:ftp_data_port_t portcon tcp 21 system_u:object_r:ftp_port_t -') ifdef(`ssh.te', `portcon tcp 22 system_u:object_r:ssh_port_t') ifdef(`inetd.te', `portcon tcp 23 system_u:object_r:telnetd_port_t')
@@ -98,7 +96,8 @@ portcon udp 636 system_u:object_r:ldap_port_t ifdef(`rlogind.te', `portcon tcp 513 system_u:object_r:rlogind_port_t') -ifdef(`rshd.te', `portcon tcp 514 system_u:object_r:rsh_port_t') +portcon tcp 514 system_u:object_r:rsh_port_t + ifdef(`lpd.te', `portcon tcp 515 system_u:object_r:printer_port_t') ifdef(`syslogd.te', ` portcon udp 514 system_u:object_r:syslogd_port_t
@@ -121,6 +120,13 @@ portcon tcp 4444 system_u:object_r:kerberos_master_port_t portcon udp 4444 system_u:object_r:kerberos_master_port_t ifdef(`spamd.te', `portcon tcp 783 system_u:object_r:spamd_port_t') +ifdef(`uucpd.te', ` +portcon tcp 540 system_u:object_r:uucpd_port_t +') +ifdef(`cvs.te', ` +portcon tcp 2401 system_u:object_r:cvs_port_t +portcon udp 2401 system_u:object_r:cvs_port_t +') ifdef(`rsync.te', ` portcon tcp 873 system_u:object_r:rsync_port_t portcon udp 873 system_u:object_r:rsync_port_t
targeted/domains/program/compat.te +9 -0
@@ -0,0 +1,9 @@ +typealias sbin_t alias setfiles_exec_t; +typealias bin_t alias mount_exec_t; +typealias sbin_t alias restorecon_exec_t; +typealias bin_t alias hostname_exec_t; +typealias sbin_t alias consoletype_exec_t; +typealias bin_t alias loadkeys_exec_t; +typealias bin_t alias dmesg_exec_t; +typealias sbin_t alias fsadm_exec_t; +typealias sbin_t alias kudzu_exec_t;
targeted/domains/unconfined.te +3 -5
@@ -15,11 +15,9 @@ # Define some type aliases to help with compatibility with # macros and domains from the "strict" policy. typealias bin_t alias su_exec_t; -typealias unconfined_t alias { kernel_t logrotate_t sendmail_t sshd_t sysadm_t rpm_t rpm_script_t xdm_t }; -define(`admin_tty_type', `{ tty_device_t devpts_t }') - -#type of rundir to communicate with dbus -type system_dbusd_var_run_t, file_type, sysadmfile; +typealias unconfined_t alias { kernel_t logrotate_t sendmail_t sshd_t secadm_t sysadm_t rpm_t rpm_script_t xdm_t }; +typeattribute tty_device_t admin_tty_type; +typeattribute devpts_t admin_tty_type; # User home directory type. type user_home_t, file_type, sysadmfile, home_type;
tunables/distro.tun +1 -1
@@ -5,7 +5,7 @@ # appropriate ifdefs. -dnl define(`distro_redhat') +define(`distro_redhat') dnl define(`distro_suse')
tunables/tunable.tun +3 -3
@@ -2,7 +2,7 @@ dnl define(`user_can_mount') # Allow rpm to run unconfined. -dnl define(`unlimitedRPM') +define(`unlimitedRPM') # Allow privileged utilities like hotplug and insmod to run unconfined. dnl define(`unlimitedUtils')
@@ -20,11 +20,11 @@ # Do not audit things that we know to be broken but which # are not security risks -dnl define(`hide_broken_symptoms') +define(`hide_broken_symptoms') # Allow user_r to reach sysadm_r via su, sudo, or userhelper. # Otherwise, only staff_r can do so. -dnl define(`user_canbe_sysadm') +define(`user_canbe_sysadm') # Allow xinetd to run unconfined, including any services it starts # that do not have a domain transition explicitly defined.
types/file.te +2 -1
@@ -318,4 +318,5 @@ allow file_type removable_t:filesystem associate; allow file_type noexattrfile:filesystem associate; - +# Type for anonymous FTP data, used by ftp and rsync +type ftpd_anon_t, file_type, sysadmfile, customizable;
types/network.te +4 -6
@@ -22,6 +22,7 @@ # # Defines used by the te files need to be defined outside of net_constraints # +type rsh_port_t, port_type, reserved_port_type; type dns_port_t, port_type, reserved_port_type; type smtp_port_t, port_type, reserved_port_type; type dhcpd_port_t, port_type, reserved_port_type;
@@ -39,12 +40,9 @@ ifdef(`use_pop', ` type pop_port_t, port_type, reserved_port_type; ') -ifdef(`ftpd.te', ` -define(`use_ftpd') -') -ifdef(`publicfile.te', ` -define(`use_ftpd') -') + +type ftp_port_t, port_type, reserved_port_type; +type ftp_data_port_t, port_type, reserved_port_type; ifdef(`dhcpd.te', `define(`use_pxe')') ifdef(`pxe.te', `define(`use_pxe')')
types/security.te +4 -4
@@ -24,20 +24,20 @@ # policy_src_t is the type of the policy source # files. # -type policy_src_t, file_type, sysadmfile; +type policy_src_t, file_type; # # default_context_t is the type applied to # /etc/selinux/*/contexts/* # -type default_context_t, file_type, sysadmfile, login_contexts; +type default_context_t, file_type, login_contexts; # # file_context_t is the type applied to # /etc/selinux/*/contexts/files # -type file_context_t, file_type, sysadmfile; +type file_context_t, file_type; # # no_access_t is the type for objects that should
@@ -49,6 +49,6 @@ # selinux_config_t is the type applied to # /etc/selinux/config # -type selinux_config_t, file_type, sysadmfile; +type selinux_config_t, file_type;
Quoted 1 line · Daniel J Walsh
Some cleanups in strict to handle turning off unlimitedRC
diff --exclude-from=exclude -N -u -r nsapolicy/domains/program/initrc.te policy-1.23.11/domains/program/initrc.te
--- nsapolicy/domains/program/initrc.te 2005-03-24 08:58:25.000000000 -0500
+++ policy-1.23.11/domains/program/initrc.te 2005-04-14 15:30:19.000000000
-0400
@@ -12,7 +12,7 @@
# initrc_exec_t is the type of the init program. # # do not use privmail for sendmail as it creates a type transition conflict -type initrc_t, ifdef(`unlimitedRC', `admin, etc_writer, fs_domain, privmem, auth_write, ') domain, privlog, privowner, privmodule, ifdef(`sendmail.te', `', `privmail,') ifdef(`distro_debian', `etc_writer, ') sysctl_kernel_writer, nscd_client_domain; +type initrc_t, fs_domain, ifdef(`unlimitedRC', `admin, etc_writer, privmem, auth_write, ') domain, privlog, privowner, privmodule, ifdef(`sendmail.te', `', `privmail,') ifdef(`distro_debian', `etc_writer, ') sysctl_kernel_writer, nscd_client_domain;
role system_r types initrc_t;
uses_shlib(initrc_t);
Note that the above is needed for the following command:
echo "raidautorun /dev/md0" | nash --quiet
Below are the relevant bits from the strace output:mknod("/dev/md0", S_IFBLK|0600, makedev(9, 0)) = 0open("/dev/md0", O_RDWR) = 0ioctl(0, 0x914, 0) = 0
What does ioctl 0x914 do? Is there a better way we can manage the device node creation? Can udev create it?
@@ -195,10 +195,8 @@
allow initrc_t tmpfs_t:chr_file rw_file_perms;
allow initrc_t tmpfs_t:dir r_dir_perms;
-ifdef(distro_redhat',
# Allow initrc domain to set the enforcing flag.
can_setenforce(initrc_t)
-')
#
# readahead asks for these
I don't think that we can count on all distributions needing init scripts that toggle between permissive and enforcing modes, so this conditional should remain in.
@@ -209,6 +207,7 @@
# for /halt /.autofsck and other flag files
file_type_auto_trans({ initrc_t sysadm_t }, root_t, etc_runtime_t, file)+file_type_auto_trans(initrc_t, device_t, fixed_disk_device_t, blk_file)
')dnl end distro_redhat
allow initrc_t system_map_t:{ file lnk_file } r_file_perms;
Probably should have a comment for this, something like the following:
# This is so that nash can create /dev/md0 for RAID device auto-detection.
Also should have ifdef(`distro_redhat' around it as only Red Hat has nash.
diff --exclude-from=exclude -N -u -r nsapolicy/domains/program/load_policy.te policy-1.23.11/domains/program/load_policy.te
--- nsapolicy/domains/program/load_policy.te 2005-04-14 15:01:53.000000000
-0400
+++ policy-1.23.11/domains/program/load_policy.te 2005-04-14
15:20:16.000000000 -0400
@@ -58,3 +58,4 @@
read_locale(load_policy_t) r_dir_file(load_policy_t, selinux_config_t)
+allow load_policy_t proc_t:file { getattr read };
I think it's best to add this to the can_loadpol() macro to make things clearer.
Quoted 3 lines
Added
audit_controlto login domains to handle pam_loginuid.soFixes for syslogng
diff --exclude-from=exclude -N -u -r nsapolicy/domains/program/syslogd.te policy-1.23.11/domains/program/syslogd.te
--- nsapolicy/domains/program/syslogd.te 2005-04-04 10:21:10.000000000
-0400
+++ policy-1.23.11/domains/program/syslogd.te 2005-04-14 15:20:16.000000000
-0400
@@ -111,4 +111,6 @@
allow syslogd_t kernel_t:system { syslog_mod syslog_console }; allow syslogd_t self:capability { sys_admin chown fsetid }; allow syslogd_t var_log_t:dir { create setattr };
+allow syslogd_t syslogd_port_t:tcp_socket name_bind;
+allow syslogd_t rsh_port_t:tcp_socket name_connect;
}
What is this about? We don't have a syslogd_port_t label on a TCP port, and AFAIK syslogd doesn't use TCP anyway.
Why would a syslogd want to connect to a rsh server?
diff --exclude-from=exclude -N -u -r nsapolicy/domains/program/unused/apache.te policy-1.23.11/domains/program/unused/apache.te
--- nsapolicy/domains/program/unused/apache.te 2005-04-07 22:22:55.000000000 -0400
+++ policy-1.23.11/domains/program/unused/apache.te 2005-04-14
15:20:16.000000000 -0400
@@ -401,3 +401,4 @@
dontaudit system_mail_t httpd_t:tcp_socket { read write };
')
+allow httpd_t var_t:file read;
I don't think that httpd_t needs to access var_t:file. If it did then it would certainly need more than just read access.
+# Don't use logdir_domain since this is a security file +type auditd_log_t, file_type, secure_file_type; +file_type_auto_trans(auditd_t, var_log_t, auditd_log_t, file) +allow auditd_t auditd_log_t:dir { setattr rw_dir_perms };
We should have the following instead:
# Do not use logdir_domain since this is a security file type auditd_log_t, file_type, secure_file_type; allow auditd_t var_log_t:dir search; rw_dir_create_file(auditd_t, auditd_log_t)
Apostrophies are bad. We want to limit where auditd_t can write to as much as possible.
Signature · 9 lines
http://www.coker.com.au/selinux/ My NSA Security Enhanced Linux packages http://www.coker.com.au/bonnie++/ Bonnie++ hard drive benchmark http://www.coker.com.au/postal/ Postal SMTP/POP benchmark http://www.coker.com.au/~russell/ My home page -- 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 26 lines · Russell Coker
Quoted 3 lines · Daniel J Walsh
Some cleanups in strict to handle turning off unlimitedRC
diff --exclude-from=exclude -N -u -r nsapolicy/domains/program/initrc.te policy-1.23.11/domains/program/initrc.te
domains/program/initrc.te 2005-04-14 15:30:19.000000000 renamed from domains/program/initrc.te 2005-03-24 08:58:25.000000000 -0500 +1
-2-0400@@ -12,7 +12,7 @@ # initrc_exec_t is the type of the init program. # # do not use privmail for sendmail as it creates a type transition conflict -type initrc_t, ifdef(`unlimitedRC', `admin, etc_writer, fs_domain, privmem, auth_write, ') domain, privlog, privowner, privmodule, ifdef(`sendmail.te', `', `privmail,') ifdef(`distro_debian', `etc_writer, ') sysctl_kernel_writer, nscd_client_domain; +type initrc_t, fs_domain, ifdef(`unlimitedRC', `admin, etc_writer, privmem, auth_write, ') domain, privlog, privowner, privmodule, ifdef(`sendmail.te', `', `privmail,') ifdef(`distro_debian', `etc_writer, ') sysctl_kernel_writer, nscd_client_domain;role
system_rtypesinitrc_t;uses_shlib(initrc_t);Note that the above is needed for the following command:
echo "raidautorun/dev/md0" | nash --quiet
Quoted 9 lines
Below are the relevant bits from the strace output:
mknod("/dev/md0", S_IFBLK|0600, makedev(9, 0))= 0open("/dev/md0", O_RDWR)= 0ioctl(0, 0x914, 0)= 0What does ioctl
0x914do? Is there a better way we can manage the device node creation? Can udev create it?
We should create a bugzilla for it.
Quoted 12 lines
domains/program/initrc.te 2005-04-14 15:30:19.000000000 renamed from domains/program/initrc.te 2005-03-24 08:58:25.000000000 -0500 +0
-2@@ -195,10 +195,8 @@ allow initrc_t tmpfs_t:chr_file rw_file_perms; allow initrc_t tmpfs_t:dir r_dir_perms; -ifdef(`distro_redhat', ` # Allow initrc domain to set the enforcing flag. can_setenforce(initrc_t) -') # # readahead asks for these
Quoted 4 lines
I don't think that we can count on all distributions needing init scripts that toggle between permissive and enforcing modes, so this conditional should remain in.
This was already within a block of ifdef(distro_redhat)
Quoted 7 lines
domains/program/initrc.te 2005-04-14 15:30:19.000000000 renamed from domains/program/initrc.te 2005-03-24 08:58:25.000000000 -0500 +1
-0@@ -209,6 +207,7 @@ # for /halt /.autofsck and other flag files file_type_auto_trans({ initrc_t sysadm_t }, root_t, etc_runtime_t, file) +file_type_auto_trans(initrc_t, device_t, fixed_disk_device_t, blk_file)')dnl end
distro_redhat
Quoted 9 lines
allow
initrc_tsystem_map_t:{ filelnk_file}r_file_perms;Probably should have a comment for this, something like the following:
# This is so that nash can create/dev/md0for RAID device auto-detection.Also should have ifdef(`distro_redhat' around it as only Red Hat has nash.
It is notice the next line.
Quoted 11 lines
diff --exclude-from=exclude -N -u -r nsapolicy/domains/program/load_policy.te policy-1.23.11/domains/program/load_policy.te
--- nsapolicy/domains/program/load_policy.te 2005-04-14 15:01:53.000000000
-0400
+++ policy-1.23.11/domains/program/load_policy.te 2005-04-14
15:20:16.000000000 -0400domains/program/initrc.te 2005-04-14 15:30:19.000000000 renamed from domains/program/initrc.te 2005-03-24 08:58:25.000000000 -0500 +1
-0@@ -58,3 +58,4 @@ read_locale(load_policy_t) r_dir_file(load_policy_t, selinux_config_t) +allow load_policy_t proc_t:file { getattr read };
Quoted 4 lines
I think it's best to add this to the
can_loadpol()macro to make things clearer.
I don't think it is necessary now that the is_selinux_enabled call has been removed.
Quoted 19 lines
Quoted 5 lines
Added
audit_controlto login domains to handle pam_loginuid.soFixes for syslogng
diff --exclude-from=exclude -N -u -r nsapolicy/domains/program/syslogd.te policy-1.23.11/domains/program/syslogd.te
--- nsapolicy/domains/program/syslogd.te 2005-04-04 10:21:10.000000000
-0400
+++ policy-1.23.11/domains/program/syslogd.te 2005-04-14 15:20:16.000000000
-0400domains/program/initrc.te 2005-04-14 15:30:19.000000000 renamed from domains/program/initrc.te 2005-03-24 08:58:25.000000000 -0500 +2
-0@@ -111,4 +111,6 @@ allow syslogd_t kernel_t:system { syslog_mod syslog_console }; allow syslogd_t self:capability { sys_admin chown fsetid }; allow syslogd_t var_log_t:dir { create setattr }; +allow syslogd_t syslogd_port_t:tcp_socket name_bind; +allow syslogd_t rsh_port_t:tcp_socket name_connect; }
Quoted 4 lines
What is this about? We don't have a
syslogd_port_tlabel on a TCP port, and AFAIK syslogd doesn't use TCP anyway.
syslogng uses tcp and it uses the rsh_port_t. The syslogd_port_t line should be removed.
Quoted 5 lines
Why would a syslogd want to connect to a rsh server?
shell 514/tcp cmd # no passwords used
syslog 514/udp
syslog-ng defaults to port 514 for tcp connections.
Quoted 30 lines
diff --exclude-from=exclude -N -u -r nsapolicy/domains/program/unused/apache.te policy-1.23.11/domains/program/unused/apache.te --- nsapolicy/domains/program/unused/apache.te 2005-04-07 22:22:55.000000000
-0400
+++ policy-1.23.11/domains/program/unused/apache.te 2005-04-14
15:20:16.000000000 -0400domains/program/initrc.te 2005-04-14 15:30:19.000000000 renamed from domains/program/initrc.te 2005-03-24 08:58:25.000000000 -0500 +1
-0@@ -401,3 +401,4 @@ dontaudit system_mail_t httpd_t:tcp_socket { read write }; ') +allow httpd_t var_t:file read;I don't think that
httpd_tneeds to access var_t:file. If it did then it would certainly need more than just read access.domains/program/initrc.te 2005-04-14 15:30:19.000000000 renamed from domains/program/initrc.te 2005-03-24 08:58:25.000000000 -0500 +4
-0+# Don't use logdir_domain since this is a security file +type auditd_log_t, file_type, secure_file_type; +file_type_auto_trans(auditd_t, var_log_t, auditd_log_t, file) +allow auditd_t auditd_log_t:dir { setattr rw_dir_perms };We should have the following instead:
# Do not use
logdir_domainsince this is a security file typeauditd_log_t,file_type,secure_file_type; allowauditd_tvar_log_t:dir search;rw_dir_create_file(auditd_t, auditd_log_t)Apostrophies are bad. We want to limit where
auditd_tcan write to as much as possible.
Signature · 4 lines
-- 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 26 lines · Russell Coker
Quoted 3 lines · Daniel J Walsh
Some cleanups in strict to handle turning off unlimitedRC
diff --exclude-from=exclude -N -u -r nsapolicy/domains/program/initrc.te policy-1.23.11/domains/program/initrc.te
domains/program/initrc.te 2005-04-14 15:30:19.000000000 renamed from domains/program/initrc.te 2005-03-24 08:58:25.000000000 -0500 +1
-2-0400@@ -12,7 +12,7 @@ # initrc_exec_t is the type of the init program. # # do not use privmail for sendmail as it creates a type transition conflict -type initrc_t, ifdef(`unlimitedRC', `admin, etc_writer, fs_domain, privmem, auth_write, ') domain, privlog, privowner, privmodule, ifdef(`sendmail.te', `', `privmail,') ifdef(`distro_debian', `etc_writer, ') sysctl_kernel_writer, nscd_client_domain; +type initrc_t, fs_domain, ifdef(`unlimitedRC', `admin, etc_writer, privmem, auth_write, ') domain, privlog, privowner, privmodule, ifdef(`sendmail.te', `', `privmail,') ifdef(`distro_debian', `etc_writer, ') sysctl_kernel_writer, nscd_client_domain;role
system_rtypesinitrc_t;uses_shlib(initrc_t);Note that the above is needed for the following command:
echo "raidautorun/dev/md0" | nash --quiet
Quoted 10 lines
Below are the relevant bits from the strace output:
mknod("/dev/md0", S_IFBLK|0600, makedev(9, 0))= 0open("/dev/md0", O_RDWR)= 0ioctl(0, 0x914, 0)= 0What does ioctl
0x914do? Is there a better way we can manage the device node creation? Can udev create it?
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=155556
--
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.