Skip to contentSkip to conversation

New policy diff

PATCH Daniel J Walsh 3 participants 6 messages Sep 29, 2004 – Sep 30, 2004 SELinux security module

lore
Share & tools
lore
#0 lore raw

Added policy for vpnc.
Mailman location on redhat is changing.
More fixes for xinetd apps

domains/program/syslogd.te +1 -0
diff --exclude-from=exclude -N -u -r nsapolicy/domains/program/syslogd.te policy-1.17.23/domains/program/syslogd.te
@@ -98,3 +98,4 @@
 
 dontaudit syslogd_t kernel_t:fd use;
 dontaudit syslogd_t kernel_t:file read;
+dontaudit syslogd_t unlabeled_t:file read;
domains/program/unused/comsat.te +4 -1
diff --exclude-from=exclude -N -u -r nsapolicy/domains/program/unused/comsat.te policy-1.17.23/domains/program/unused/comsat.te
@@ -1,6 +1,7 @@
 #DESC comsat - biff server
 #
 # Author:  Dan Walsh <[email protected]>
+# Depends: inetd.te
 #
 
 #################################
@@ -11,4 +12,6 @@
 #
 
 type comsat_port_t, port_type;
-inetd_child_domain(comsat)
+inetd_child_domain( comsat, udp )
+allow comsat_t initrc_var_run_t:file { read lock };
+dontaudit comsat_t initrc_var_run_t:file write;
domains/program/unused/ftpd.te +2 -0
diff --exclude-from=exclude -N -u -r nsapolicy/domains/program/unused/ftpd.te policy-1.17.23/domains/program/unused/ftpd.te
@@ -44,6 +44,8 @@
 rw_dir_create_file(ftpd_t, var_lock_t)
 allow ftpd_t ftp_port_t:tcp_socket name_bind;
 can_tcp_connect(userdomain, ftpd_t)
+# Allows it to check exec privs on daemon
+can_exec(inetd_t, ftpd_exec_t)
 }
 ifdef(`inetd.te', `
 if (!ftpd_is_daemon) {
domains/program/unused/hotplug.te +4 -1
diff --exclude-from=exclude -N -u -r nsapolicy/domains/program/unused/hotplug.te policy-1.17.23/domains/program/unused/hotplug.te
@@ -42,7 +42,10 @@
 allow hotplug_t { bin_t sbin_t }:dir search;
 allow hotplug_t { bin_t sbin_t }:lnk_file read;
 can_exec(hotplug_t, { hotplug_exec_t bin_t sbin_t ls_exec_t shell_exec_t hotplug_etc_t etc_t })
-ifdef(`hostname.te', `can_exec(hotplug_t, hostname_exec_t)')
+ifdef(`hostname.te', `
+can_exec(hotplug_t, hostname_exec_t)
+dontaudit hostname_t hotplug_t:fd { use };
+')
 ifdef(`netutils.te', `
 ifdef(`distro_redhat', `
 # for arping used for static IP addresses on PCMCIA ethernet
domains/program/unused/ktalkd.te +2 -1
diff --exclude-from=exclude -N -u -r nsapolicy/domains/program/unused/ktalkd.te policy-1.17.23/domains/program/unused/ktalkd.te
@@ -11,4 +11,5 @@
 #
 
 type ktalkd_port_t, port_type;
-inetd_child_domain(ktalkd)
+inetd_child_domain(ktalkd, udp)
+allow inetd_t ktalkd_port_t:udp_socket name_bind;
domains/program/unused/vpnc.te +31 -0
diff --exclude-from=exclude -N -u -r nsapolicy/domains/program/unused/vpnc.te policy-1.17.23/domains/program/unused/vpnc.te
@@ -0,0 +1,31 @@
+#DESC vpnc
+#
+# Author:  Dan Walsh <[email protected]>
+#
+
+#################################
+#
+# Rules for the vpnc_t domain, et al.
+#
+# vpnc_t is the domain for the vpnc program.
+# vpnc_exec_t is the type of the vpnc executable.
+#
+daemon_domain(vpnc)
+
+# for SSP
+allow vpnc_t { random_device_t urandom_device_t }:chr_file read;
+
+# Use the network.
+can_network(vpnc_t)
+can_ypbind(vpnc_t)
+
+# Use capabilities.
+allow vpnc_t self:capability { net_admin ipc_lock net_bind_service net_raw };
+
+allow vpnc_t devpts_t:dir search;
+allow vpnc_t etc_t:file { getattr read };
+allow vpnc_t tun_tap_device_t:chr_file { ioctl read write };
+allow vpnc_t vpnc_t:rawip_socket create_socket_perms;
+allow vpnc_t vpnc_t:unix_dgram_socket create_socket_perms;
+allow vpnc_t vpnc_t:unix_stream_socket create_socket_perms;
+allow vpnc_t admin_tty_type:chr_file rw_file_perms;
file_contexts/program/mailman.fc +8 -12
diff --exclude-from=exclude -N -u -r nsapolicy/file_contexts/program/mailman.fc policy-1.17.23/file_contexts/program/mailman.fc
@@ -1,27 +1,23 @@
 # mailman list server
 /var/log/mailman(/.*)?		   system_u:object_r:mailman_log_t
+/usr/lib/mailman/cron/.*	-- system_u:object_r:mailman_queue_exec_t
+usr/lib/mailman/bin/mailmanctl -- system_u:object_r:mailman_mail_exec_t
+
 ifdef(`distro_debian', `
 /usr/lib/cgi-bin/mailman/.* -- system_u:object_r:mailman_cgi_exec_t
-/usr/lib/mailman/cron/.*	-- system_u:object_r:mailman_queue_exec_t
 /usr/lib/mailman/mail/wrapper -- system_u:object_r:mailman_mail_exec_t
 /usr/mailman/mail/wrapper 	-- system_u:object_r:mailman_mail_exec_t
 /var/lib/mailman(/.*)?	   system_u:object_r:mailman_data_t
 /var/lib/mailman/archives(/.*)?	system_u:object_r:mailman_archive_t
-/usr/lib/mailman/bin/mailmanctl -- system_u:object_r:mailman_mail_exec_t
 /etc/cron\.daily/mailman 	-- system_u:object_r:mailman_queue_exec_t
 /etc/cron\.monthly/mailman 	-- system_u:object_r:mailman_queue_exec_t
 ')
+
 ifdef(`distro_redhat', `
-/var/mailman/cgi-bin/.*		-- system_u:object_r:mailman_cgi_exec_t
-/var/mailman/data(/.*)?		   system_u:object_r:mailman_data_t
+/usr/lib/mailman/cgi-bin/.* -- system_u:object_r:mailman_cgi_exec_t
+/var/mailman(/.*)?		   system_u:object_r:mailman_data_t
 /var/mailman/locks(/.*)?	   system_u:object_r:mailman_lock_t
-/var/mailman/cron		-d system_u:object_r:bin_t
-/var/mailman/cron/.+		-- system_u:object_r:mailman_queue_exec_t
 /var/mailman/archives(/.*)?	   system_u:object_r:mailman_archive_t
-/var/mailman/scripts/mailman 	-- system_u:object_r:mailman_mail_exec_t
-/var/mailman/bin/qrunner     	-- system_u:object_r:mailman_queue_exec_t
-/var/mailman/bin/mailmanctl     -- system_u:object_r:mailman_mail_exec_t
-/var/mailman/mail/mailman 	-- system_u:object_r:mailman_mail_exec_t
-/var/mailman/Mailman(/.*?)	   system_u:object_r:lib_t
-/var/mailman/pythonlib(/.*?)	   system_u:object_r:lib_t
+/usr/lib/mailman/scripts/mailman -- system_u:object_r:mailman_mail_exec_t
+/usr/lib/mailman/bin/qrunner     -- system_u:object_r:mailman_queue_exec_t
 ')
file_contexts/program/mozilla.fc +1 -0
diff --exclude-from=exclude -N -u -r nsapolicy/file_contexts/program/mozilla.fc policy-1.17.23/file_contexts/program/mozilla.fc
@@ -17,4 +17,5 @@
 /usr/lib(64)?/mozilla[^/]*/mozilla-.* --	system_u:object_r:mozilla_exec_t
 /usr/lib(64)?/firefox[^/]*/mozilla-.* --	system_u:object_r:mozilla_exec_t
 /usr/lib(64)?/[^/]*firefox[^/]*/firefox-bin --	system_u:object_r:mozilla_exec_t
+/usr/lib(64)?/[^/]*firefox[^/]*/firefox --	system_u:object_r:bin_t
 /etc/mozpluggerrc system_u:object_r:mozilla_conf_t
file_contexts/program/rhgb.fc +1 -2
diff --exclude-from=exclude -N -u -r nsapolicy/file_contexts/program/rhgb.fc policy-1.17.23/file_contexts/program/rhgb.fc
@@ -1,3 +1,2 @@
 /usr/bin/rhgb		--	system_u:object_r:rhgb_exec_t
-#/etc/dbus-1(/.*)?		system_u:object_r:etc_dbusd_t
-/etc/rhgb		-d	system_u:object_r:mnt_t
+/etc/rhgb(/.*)?		-d	system_u:object_r:mnt_t
file_contexts/program/rpm.fc +2 -0
diff --exclude-from=exclude -N -u -r nsapolicy/file_contexts/program/rpm.fc policy-1.17.23/file_contexts/program/rpm.fc
@@ -32,6 +32,8 @@
 /usr/share/system-config-language/system-config-language -- system_u:object_r:bin_t
 /usr/share/system-config-mouse/system-config-mouse -- system_u:object_r:bin_t
 /usr/share/system-config-netboot/system-config-netboot.py -- system_u:object_r:bin_t
+/usr/share/system-config-netboot/pxeos.py -- system_u:object_r:bin_t
+/usr/share/system-config-netboot/pxeboot.py -- system_u:object_r:bin_t
 /usr/share/system-config-nfs/system-config-nfs.py -- system_u:object_r:bin_t
 /usr/share/system-config-rootpassword/system-config-rootpassword -- system_u:object_r:bin_t
 /usr/share/system-config-samba/system-config-samba.py -- system_u:object_r:bin_t
file_contexts/program/vpnc.fc +2 -0
diff --exclude-from=exclude -N -u -r nsapolicy/file_contexts/program/vpnc.fc policy-1.17.23/file_contexts/program/vpnc.fc
@@ -0,0 +1,2 @@
+# vpnc
+/usr/sbin/vpnc		--	system_u:object_r:vpnc_exec_t
macros/program/inetd_macros.te +4 -1
diff --exclude-from=exclude -N -u -r nsapolicy/macros/program/inetd_macros.te policy-1.17.23/macros/program/inetd_macros.te
@@ -38,8 +38,11 @@
 var_run_domain($1)
 
 # Use sockets inherited from inetd.
+ifelse($2, udp, `
+allow $1_t inetd_t:udp_socket rw_socket_perms;
+', `
 allow $1_t inetd_t:tcp_socket rw_stream_socket_perms;
-
+')
 # for identd
 allow $1_t self:netlink_tcpdiag_socket r_netlink_socket_perms;
 allow $1_t self:capability { setuid setgid };
macros/program/mozilla_macros.te +1 -9
diff --exclude-from=exclude -N -u -r nsapolicy/macros/program/mozilla_macros.te policy-1.17.23/macros/program/mozilla_macros.te
@@ -80,15 +80,7 @@
 #
 if (mozilla_readhome || mozilla_writehome) {
 r_dir_file($1_mozilla_t, $1_home_t)
-
-ifdef(`gpg.te', `
-dontaudit $1_mozilla_t $1_gpg_secret_t:dir { getattr };
-')
-ifdef(`screen.te', `
-dontaudit $1_mozilla_t $1_home_screen_t:file { getattr };
-')
-dontaudit $1_mozilla_t $1_home_ssh_t:dir { getattr };
-
+dontaudit $1_mozilla_t homedirfile:{ file dir } getattr;
 file_type_auto_trans($1_mozilla_t, tmp_t, $1_tmp_t)
 } else {
 file_type_auto_trans($1_mozilla_t, tmp_t, $1_mozilla_rw_t)
macros/program/screen_macros.te +1 -1
diff --exclude-from=exclude -N -u -r nsapolicy/macros/program/screen_macros.te policy-1.17.23/macros/program/screen_macros.te
@@ -26,7 +26,7 @@
 typealias $1_home_t alias $1_home_screen_t;
 ', `
 type $1_screen_t, domain, privlog, privfd;
-type $1_home_screen_t, file_type, sysadmfile;
+type $1_home_screen_t, file_type, homedirfile, sysadmfile;
 
 # Transition from the user domain to this domain.
 domain_auto_trans($1_t, screen_exec_t, $1_screen_t)
macros/program/sendmail_macros.te +1 -1
diff --exclude-from=exclude -N -u -r nsapolicy/macros/program/sendmail_macros.te policy-1.17.23/macros/program/sendmail_macros.te
@@ -44,7 +44,7 @@
 
 ifelse(`$1', `sysadm', `
 allow $1_mail_t proc_t:dir { getattr search };
-allow $1_mail_t proc_t:{ lnk_file file } { getattr read };
+allow $1_mail_t proc_t:file { getattr read };
 allow $1_mail_t sysctl_kernel_t:file { getattr read };
 allow $1_mail_t etc_runtime_t:file { getattr read };
 ', `
macros/program/spamassassin_macros.te +1 -1
diff --exclude-from=exclude -N -u -r nsapolicy/macros/program/spamassassin_macros.te policy-1.17.23/macros/program/spamassassin_macros.te
@@ -80,7 +80,7 @@
 dontaudit $1_spamassassin_t { sysctl_t sysctl_kernel_t }:dir search;
 
 # The type of ~/.spamassassin
-type $1_home_spamassassin_t, file_type, sysadmfile;
+type $1_home_spamassassin_t, file_type, homedirfile, sysadmfile;
 create_dir_file($1_t, $1_home_spamassassin_t)
 allow $1_t $1_home_spamassassin_t:notdevfile_class_set { relabelfrom relabelto };
 allow $1_t $1_home_spamassassin_t:dir { relabelfrom relabelto };
net_contexts +3 -4
diff --exclude-from=exclude -N -u -r nsapolicy/net_contexts policy-1.17.23/net_contexts
@@ -30,7 +30,6 @@
 portcon udp 37 system_u:object_r:inetd_port_t
 portcon tcp 113 system_u:object_r:inetd_port_t
 portcon udp 512 system_u:object_r:biff_port_t
-portcon udp 517 system_u:object_r:inetd_port_t
 portcon tcp 891 system_u:object_r:inetd_port_t
 portcon udp 891 system_u:object_r:inetd_port_t
 portcon tcp 892 system_u:object_r:inetd_port_t
@@ -95,9 +94,9 @@
 ifdef(`syslogd.te', `
 portcon udp 514 system_u:object_r:syslogd_port_t
 ')
-ifdef(`talk.te', `
-portcon udp 517 system_u:object_r:talk_port_t
-portcon udp 518 system_u:object_r:ntalk_port_t
+ifdef(`ktalkd.te', `
+portcon udp 517 system_u:object_r:ktalkd_port_t
+portcon udp 518 system_u:object_r:ktalkd_port_t
 ')
 ifdef(`cups.te', `
 portcon tcp 631 system_u:object_r:ipp_port_t
targeted/domains/unconfined.te +2 -1
diff --exclude-from=exclude -N -u -r nsapolicy/targeted/domains/unconfined.te policy-1.17.23/targeted/domains/unconfined.te
@@ -12,7 +12,8 @@
 
 # Define some type aliases to help with compatibility with
 # macros and domains from the "strict" policy.
-typealias unconfined_t alias { kernel_t init_t initrc_t sysadm_t rpm_t rpm_script_t };
+typealias bin_t alias su_exec_t;
+typealias unconfined_t alias { kernel_t init_t initrc_t sysadm_t rpm_t rpm_script_t logrotate_t };
 typealias var_lib_t alias { rpm_var_lib_t };
 type mount_t, domain;
 type initrc_devpts_t, ptyfile;
tunables/distro.tun +1 -1
diff --exclude-from=exclude -N -u -r nsapolicy/tunables/distro.tun policy-1.17.23/tunables/distro.tun
@@ -5,7 +5,7 @@
 # appropriate ifdefs.
 
 
-dnl define(`distro_redhat')
+define(`distro_redhat')
 
 dnl define(`distro_suse')
 
tunables/tunable.tun +10 -10
diff --exclude-from=exclude -N -u -r nsapolicy/tunables/tunable.tun policy-1.17.23/tunables/tunable.tun
@@ -1,42 +1,42 @@
 # Allow all domains to connect to nscd
-dnl define(`nscd_all_connect')
+define(`nscd_all_connect')
 
 # Allow users to control network interfaces (also needs USERCTL=true)
 dnl define(`user_net_control')
 
 # Allow users to execute the mount command
-dnl define(`user_can_mount')
+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')
+define(`unlimitedUtils')
 
 # Support NFS home directories
-dnl define(`nfs_home_dirs')
+define(`nfs_home_dirs')
 
 # Allow users to run games
-dnl define(`use_games')
+define(`use_games')
 
 # Allow ypbind to run with NIS
-dnl define(`allow_ypbind')
+define(`allow_ypbind')
 
 # Allow rc scripts to run unconfined, including any daemon
 # started by an rc script that does not have a domain transition
 # explicitly defined.
-dnl define(`unlimitedRC')
+define(`unlimitedRC')
 
 # Allow sysadm_t to directly start daemons
 define(`direct_sysadm_daemon')
 
 # 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.
#1 lore raw
Quoted 3 lines · Daniel J Walsh

Added policy for vpnc.
Mailman location on redhat is changing.
More fixes for xinetd apps

can_exec(hotplug_t, hostname_exec_t)
dontaudit hostname_t hotplug_t:fd { use };

If hostname_exec_t is executed in domain hotplug_t then the dontaudit rule will never be needed.

+usr/lib/mailman/bin/mailmanctl -- system_u:object_r:mailman_mail_exec_t

Typo, missing leading '/'.

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.
#2 lore raw
Quoted 9 lines · Russell Coker
Quoted 5 lines · Daniel J Walsh

Added policy for vpnc.
Mailman location on redhat is changing.
More fixes for xinetd apps

Quoted 6 lines

can_exec(hotplug_t, hostname_exec_t)
dontaudit hostname_t hotplug_t:fd { use };

If hostname_exec_t is executed in domain hotplug_t then the dontaudit rule will never be needed.

Yes, I saw that, but there seems to be a way though transitions where hostname_t gets kicked off from hotplug_t (dhcpc_t or something), and there is a fd being used (Terminal?).

Quoted 5 lines

+usr/lib/mailman/bin/mailmanctl -- system_u:object_r:mailman_mail_exec_t

Typo, missing leading '/'.

Oops please fix.

--
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.

#3 lore raw
In reply to Daniel J Walsh

Isn't this sufficient?

allow inetd_t ftpd_exec_t:file execute;

Quoted 18 lines · Daniel J Walsh

Added policy for vpnc.
Mailman location on redhat is changing.
More fixes for xinetd apps

______________________________________________________________________
diff --exclude-from=exclude -N -u -r nsapolicy/domains/program/unused/ftpd.te policy-1.17.23/domains/program/unused/ftpd.te

domains/program/unused/ftpd.te +2 -0
@@ -44,6 +44,8 @@
 rw_dir_create_file(ftpd_t, var_lock_t)
 allow ftpd_t ftp_port_t:tcp_socket name_bind;
 can_tcp_connect(userdomain, ftpd_t)
+# Allows it to check exec privs on daemon
+can_exec(inetd_t, ftpd_exec_t)
 }
 ifdef(`inetd.te', `
 if (!ftpd_is_daemon) {
Signature · 7 lines
James Carter <[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.
#4 lore raw
Quoted 13 lines · James Carter

Isn't this sufficient?

allow inetd_t ftpd_exec_t:file execute;

Quoted 5 lines · Daniel J Walsh

Added policy for vpnc.
Mailman location on redhat is changing.
More fixes for xinetd apps

Quoted 18 lines
Quoted 11 lines

______________________________________________________________________
diff --exclude-from=exclude -N -u -r nsapolicy/domains/program/unused/ftpd.te policy-1.17.23/domains/program/unused/ftpd.te

domains/program/unused/ftpd.te +2 -0
@@ -44,6 +44,8 @@
 rw_dir_create_file(ftpd_t, var_lock_t)
 allow ftpd_t ftp_port_t:tcp_socket name_bind;
 can_tcp_connect(userdomain, ftpd_t)
+# Allows it to check exec privs on daemon
+can_exec(inetd_t, ftpd_exec_t)
 }
Quoted 4 lines

ifdef(inetd.te',
if (!ftpd_is_daemon) {

Yes

--
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.

#5 lore raw

Merged.

I actually went with this:
allow inetd_t ftpd_exec_t:file x_file_perms;

Also, I didn't merge the sendmail_macros.te chunk, because it was a reversal of Russell's patch from last Friday.

Quoted 39 lines · Daniel J Walsh
Quoted 13 lines · James Carter

Isn't this sufficient?

allow inetd_t ftpd_exec_t:file execute;

Quoted 5 lines · Daniel J Walsh

Added policy for vpnc.
Mailman location on redhat is changing.
More fixes for xinetd apps

Quoted 18 lines
Quoted 11 lines

______________________________________________________________________
diff --exclude-from=exclude -N -u -r nsapolicy/domains/program/unused/ftpd.te policy-1.17.23/domains/program/unused/ftpd.te

domains/program/unused/ftpd.te +2 -0
@@ -44,6 +44,8 @@
 rw_dir_create_file(ftpd_t, var_lock_t)
 allow ftpd_t ftp_port_t:tcp_socket name_bind;
 can_tcp_connect(userdomain, ftpd_t)
+# Allows it to check exec privs on daemon
+can_exec(inetd_t, ftpd_exec_t)
 }
Quoted 4 lines

ifdef(inetd.te',
if (!ftpd_is_daemon) {

Yes

--
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.

Signature · 7 lines
James Carter <[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.