policy metadata
PATCH 1/1 policy metadata
Hi,
While Debianizing all the SE 2.5 stuff, I got pretty fed up with answering 100+ questions about whether or not to install individual policy files. So I've been working on a few new options for installing the Debian SELinux policy.
The main idea is to add information to each .te file about which Debian packages use it. I went with the semi-RFC822 style formatting in use and called it "X-Debian-Packages:".
Since this is a 1-line change to more than 120 files, it'd be nice if it could be merged upstream to reduce the size of our policy diffs. The metadata may be useful too for other systems which might use similar package names, or at least it will give a hint about what the software is if you're unsure. And since this is just a change to the comments, it should be minimally intrusive.
Now Debian users have several choices for policy installation. One, "Automatic", simply installs all .te files which reference an installed package. This is what I imagine the vast majority of people will use. It's far easier (especially with the rapidly growing number of .te files) to trust the system to get it mostly right, and then tweak it a bit by manually adding or removing files. If you don't like this idea, you have several other options, such as "Manual" and "Don't Touch".
I tried to make sure this patch didn't contain any other changes in my
local policy, it was produced with the following command:
diff -ur {policy-1.0,selinux-policy-1.0}/domains/program/ | grepdiff --output-matching=hunk 'X-Debian-Packages' | egrep -v '^\+#[[:space:]]*Depends: '
and then a little bit of hand-editing and recountdiff.
domains/program/checkpolicy.te +1 -0
@@ -1,6 +1,7 @@ #DESC Checkpolicy - SELinux policy compliler # # Authors: Frank Mayer, [email protected] +# X-Debian-Packages: checkpolicy # ###########################
domains/program/chkpwd.te +1 -0
@@ -1,4 +1,5 @@ #DESC Chkpwd - PAM password checking programs +# X-Debian-Packages: libpam-modules # # Domains for the /sbin/.*_chkpwd utilities. #
domains/program/crond.te +1 -2
@@ -4,8 +4,7 @@ # for system cron jobs. The domains for user cron jobs # are in macros/program/crond_macros.te. # - -# +# X-Debian-Packages: cron # Authors: Jonathan Crowley (MITRE) <[email protected]>, # Stephen Smalley <[email protected]> and Timothy Fraser #
domains/program/crontab.te +2 -0
@@ -2,6 +2,8 @@ # # Domains for the crontab program. # +# X-Debian-Packages: cron +# # Type for the crontab executable. type crontab_exec_t, file_type, sysadmfile, exec_type;
domains/program/fsadm.te +1 -0
@@ -1,6 +1,7 @@ #DESC Fsadm - Disk and file system administration # # Authors: Stephen Smalley <[email protected]> and Timothy Fraser +# X-Debian-Packages: util-linux e2fsprogs xfsprogs reiserfsprogs parted raidtools2 mount # #################################
domains/program/getty.te +1 -0
@@ -1,6 +1,7 @@ #DESC Getty - Manage ttys # # Authors: Stephen Smalley <[email protected]> and Timothy Fraser +# X-Debian-Packages: util-linux fbgetty mingetty mgetty rungetty # #################################
domains/program/ifconfig.te +1 -0
@@ -1,6 +1,7 @@ #DESC Ifconfig - Configure network interfaces # # Authors: Stephen Smalley <[email protected]> and Timothy Fraser +# X-Debian-Packages: net-tools # #################################
domains/program/initrc.te +1 -0
@@ -1,6 +1,7 @@ #DESC Initrc - System initialization scripts # # Authors: Stephen Smalley <[email protected]> and Timothy Fraser +# X-Debian-Packages: sysvinit policycoreutils # #################################
domains/program/init.te +1 -0
@@ -1,6 +1,7 @@ #DESC Init - Process initialization # # Authors: Stephen Smalley <[email protected]> and Timothy Fraser +# X-Debian-Packages: sysvinit # #################################
domains/program/klogd.te +1 -0
@@ -1,6 +1,7 @@ #DESC Klogd - Kernel log daemon # # Authors: Stephen Smalley <[email protected]> and Timothy Fraser +# X-Debian-Packages: klogd # #################################
domains/program/ldconfig.te +1 -0
@@ -1,6 +1,7 @@ #DESC Ldconfig - Configure dynamic linker bindings # # Author: Russell Coker <[email protected]> +# X-Debian-Packages: libc6 # #################################
domains/program/load_policy.te +1 -0
@@ -1,6 +1,7 @@ #DESC LoadPolicy - SELinux policy loading utilities # # Authors: Frank Mayer, [email protected] +# X-Debian-Packages: policycoreutils # ###########################
domains/program/login.te +1 -0
@@ -2,6 +2,7 @@ # # Authors: Stephen Smalley <[email protected]> and Timothy Fraser # Macroised by Russell Coker <[email protected]> +# X-Debian-Packages: login # #################################
domains/program/logrotate.te +1 -0
@@ -1,6 +1,7 @@ #DESC Logrotate - Rotate log files # # Authors: Stephen Smalley <[email protected]> and Timothy Fraser +# X-Debian-Packages: logrotate # #################################
domains/program/modutil.te +1 -0
@@ -1,6 +1,7 @@ #DESC Modutil - Dynamic module utilities # # Authors: Stephen Smalley <[email protected]> and Timothy Fraser +# X-Debian-Packages: modutils # #################################
domains/program/mount.te +1 -0
@@ -3,6 +3,7 @@ # Macros for mount # # Author: Brian May <[email protected]> +# X-Debian-Packages: mount # # based on the work of: # Mark Westerman [email protected]
domains/program/netutils.te +1 -0
@@ -1,6 +1,7 @@ #DESC Netutils - Network utilities # # Authors: Stephen Smalley <[email protected]> +# X-Debian-Packages: netbase iputils arping tcpdump # #
domains/program/newrole.te +1 -0
@@ -2,6 +2,7 @@ # # Authors: Anthony Colatrella (NSA) # Maintained by Stephen Smalley <[email protected]> +# X-Debian-Packages: policycoreutils # #################################
domains/program/passwd.te +1 -0
@@ -1,6 +1,7 @@ #DESC Passwd - Password utilities # # Authors: Stephen Smalley <[email protected]> and Timothy Fraser +# X-Debian-Packages: passwd # #################################
domains/program/setfiles.te +1 -0
@@ -1,6 +1,7 @@ #DESC Setfiles - SELinux filesystem labeling utilities # # Authors: Russell Coker <[email protected]> +# X-Debian-Packages: policycoreutils # #################################
domains/program/ssh.te +1 -0
@@ -2,6 +2,7 @@ # # Authors: Anthony Colatrella (NSA) <[email protected]> # Modified by: Russell Coker <[email protected]> +# X-Debian-Packages: ssh # type ssh_port_t, port_type;
domains/program/su.te +1 -0
@@ -1,6 +1,7 @@ #DESC Su - Run shells with substitute user and group # # Domains for the su program. +# X-Debian-Packages: login # # su_exec_t is the type of the su executable.
domains/program/syslogd.te +1 -0
@@ -1,6 +1,7 @@ #DESC Syslogd - System log daemon # # Authors: Stephen Smalley <[email protected]> and Timothy Fraser +# X-Debian-Packages: sysklogd # #################################
domains/program/tmpreaper.te +1 -0
@@ -1,6 +1,7 @@ #DESC Tmpreaper - Monitor and maintain temporary files # # Author: Russell Coker <[email protected]> +# X-Debian-Packages: tmpreaper # #################################
domains/program/unused/acct.te +1 -0
@@ -1,6 +1,7 @@ #DESC Acct - BSD process accounting # # Author: Russell Coker <[email protected]> +# X-Debian-Packages: acct # #################################
domains/program/unused/amanda.te +1 -0
@@ -3,6 +3,7 @@ # This policy file sets the rigths for amanda client started by inetd_t # and amrecover # +# X-Debian-Packages: amanda-common amanda-server # Author : Carsten Grohmann <[email protected]> # # License : GPL
domains/program/unused/amavis.te +1 -0
@@ -1,6 +1,7 @@ #DESC Amavis - Anti-virus # # Author: Brian May <[email protected]> +# X-Debian-Packages: amavis-ng amavisd-new amavisd-new-milter amavisd-new-milter-helper # #################################
domains/program/unused/apache.te +2 -0
@@ -1,5 +1,7 @@ #DESC Apache - Web server # +# X-Debian-Packages: apache2-common apache +# ############################################################################### # # Policy file for running the Apache web server
domains/program/unused/apmd.te +1 -0
@@ -2,6 +2,7 @@ # # Authors: Stephen Smalley <[email protected]> and Timothy Fraser # Russell Coker <[email protected]> +# X-Debian-Packages: apmd # #################################
domains/program/unused/atd.te +1 -0
@@ -2,6 +2,7 @@ # # Authors: Stephen Smalley <[email protected]> and Timothy Fraser # Russell Coker <[email protected]> +# X-Debian-Packages: atd # #################################
domains/program/unused/authbind.te +1 -0
@@ -1,6 +1,7 @@ #DESC Authbind - Program to bind to low ports as non-root # # Authors: Russell Coker <[email protected]> +# X-Debian-Packages: authbind # #################################
domains/program/unused/automount.te +1 -0
@@ -2,6 +2,7 @@ # # Authors: Stephen Smalley <[email protected]> # Modified by Russell Coker <[email protected]> +# X-Debian-Packages: amd am-utils autofs # #################################
domains/program/unused/backup.te +1 -0
@@ -1,6 +1,7 @@ #DESC Backup - Backup scripts # # Author: Russell Coker <[email protected]> +# X-Debian-Packages: dpkg # #################################
domains/program/unused/bootloader.te +1 -0
@@ -1,6 +1,7 @@ #DESC Bootloader - Lilo boot loader/manager # # Author: Russell Coker <[email protected]> +# X-Debian-Packages: lilo # #################################
domains/program/unused/calamaris.te +1 -0
@@ -1,6 +1,7 @@ #DESC Calamaris - Squid log analysis # # Author: Russell Coker <[email protected]> +# X-Debian-Packages: calamaris # #################################
domains/program/unused/cardmgr.te +1 -0
@@ -2,6 +2,7 @@ # # Authors: Stephen Smalley <[email protected]> and Timothy Fraser # Russell Coker <[email protected]> +# X-Debian-Packages: pcmcia-cs # #################################
domains/program/unused/chroot.te +1 -0
@@ -1,6 +1,7 @@ #DESC Chroot - Establish chroot environments # # Author: Russell Coker <[email protected]> +# X-Debian-Packages: # type chroot_exec_t, file_type, sysadmfile, exec_type;
domains/program/unused/clamav.te +1 -0
@@ -1,6 +1,7 @@ #DESC CLAM - Anti-virus program # # Author: Brian May <[email protected]> +# X-Debian-Packages: clamav # #################################
domains/program/unused/courier.te +1 -0
@@ -1,6 +1,7 @@ #DESC Courier - POP and IMAP servers # # Author: Russell Coker <[email protected]> +# X-Debian-Packages: courier-base # # Type for files created during execution of courier.
domains/program/unused/crack.te +1 -0
@@ -1,6 +1,7 @@ #DESC Crack - Password cracking application # # Author: Russell Coker <[email protected]> +# X-Debian-Packages: crack # #################################
domains/program/unused/cups.te +1 -0
@@ -1,6 +1,7 @@ #DESC Cups - Common Unix Printing System # # Created cups policy from lpd policy: Russell Coker <[email protected]> +# X-Debian-Packages: cupsys cupsys-client cupsys-bsd ################################# #
domains/program/unused/ddt-client.te +1 -0
@@ -1,6 +1,7 @@ #DESC DDT - Dynamic DNS client # # Author: Russell Coker <[email protected]> +# X-Debian-Packages: ddt-client # # ddt is a dynamic DNS system based on Postgresql for the server.
domains/program/unused/devfsd.te +1 -0
@@ -1,6 +1,7 @@ #DESC Devfsd - Control daemon for devfs device file system # # Author: Russell Coker <[email protected]> +# X-Debian-Packages: devfsd # #################################
domains/program/unused/dhcpc.te +1 -0
@@ -2,6 +2,7 @@ # # Authors: Wayne Salamon (NAI Labs) <[email protected]> # Russell Coker <[email protected]> +# X-Debian-Packages: pump dhcp-client udhcpc # #################################
domains/program/unused/dhcpd.te +1 -0
@@ -3,6 +3,7 @@ # Author: Russell Coker <[email protected]> # based on the dhcpc_t policy from: # Wayne Salamon (NAI Labs) <[email protected]> +# X-Debian-Packages: dhcp dhcp3-server # #################################
domains/program/unused/dictd.te +1 -0
@@ -1,6 +1,7 @@ #DESC Dictd - Dictionary daemon # # Authors: Russell Coker <[email protected]> +# X-Debian-Packages: dictd # #################################
domains/program/unused/dpkg.te +1 -0
@@ -1,6 +1,7 @@ #DESC Dpkg - Debian package manager # # Author: Russell Coker <[email protected]> +# X-Debian-Packages: dpkg # #################################
domains/program/unused/fingerd.te +1 -0
@@ -1,6 +1,7 @@ #DESC Fingerd - Finger daemon # # Author: Russell Coker <[email protected]> +# X-Debian-Packages: fingerd cfingerd efingerd ffingerd # #################################
domains/program/unused/ftpd.te +1 -0
@@ -2,6 +2,7 @@ # # Authors: Stephen Smalley <[email protected]> and Timothy Fraser # Russell Coker <[email protected]> +# X-Debian-Packages: proftpd-common bsd-ftpd ftpd vsftpd # #################################
domains/program/unused/games.te +1 -0
@@ -1,6 +1,7 @@ #DESC Games - Miscellaneous games # # Author: Russell Coker <[email protected]> +# X-Debian-Packages: bsdgames # # type for shared data from games
domains/program/unused/gatekeeper.te +1 -0
@@ -1,6 +1,7 @@ #DESC Gatekeeper - OpenH.323 voice over IP gate-keeper # # Author: Russell Coker <[email protected]> +# X-Debian-Packages: opengate openh323gk # #################################
domains/program/unused/gnome-pty-helper.te +1 -0
@@ -1,6 +1,7 @@ #DESC Gnome Terminal - Helper program for GNOME x-terms # # Domains for the gnome-pty-helper program. +# X-Debian-Packages: gnome-terminal # # Type for the gnome-pty-helper executable.
domains/program/unused/gpg.te +1 -0
@@ -1,6 +1,7 @@ #DESC GPG - Gnu Privacy Guard (PGP replacement) # # Authors: Russell Coker <[email protected]> +# X-Debian-Packages: gnupg # # Type for gpg or pgp executables.
domains/program/unused/gpm.te +1 -0
@@ -1,6 +1,7 @@ #DESC Gpm - General Purpose Mouse driver # # Authors: Stephen Smalley <[email protected]> and Timothy Fraser +# X-Debian-Packages: gpm # #################################
domains/program/unused/hotplug.te +1 -0
@@ -1,6 +1,7 @@ #DESC Hotplug - Hardware event manager # # Author: Russell Coker <[email protected]> +# X-Debian-Packages: hotplug # #################################
domains/program/unused/hwclock.te +1 -0
@@ -2,6 +2,7 @@ # # Author: David A. Wheeler <[email protected]> # Russell Coker <[email protected]> +# X-Debian-Packages: util-linux # #################################
domains/program/unused/inetd.te +1 -0
@@ -2,6 +2,7 @@ # # Authors: Stephen Smalley <[email protected]> and Timothy Fraser # re-written with daemon_domain by Russell Coker <[email protected]> +# X-Debian-Packages: netkit-inetd openbsd-inetd xinetd # #################################
domains/program/unused/ipchains.te +1 -0
@@ -2,6 +2,7 @@ # # Authors: Justin Smith <[email protected]> # Russell Coker <[email protected]> +# X-Debian-Packages: ipchains iptables # #
domains/program/unused/ipsec.te +1 -0
@@ -3,6 +3,7 @@ # Authors: Mark Westerman [email protected] # massively butchered by paul krumviede <[email protected]> # further massaged by Chris Vance <[email protected]> +# X-Debian-Packages: freeswan # ######################################## #
domains/program/unused/ircd.te +1 -0
@@ -1,6 +1,7 @@ #DESC Ircd - IRC server # # Author: Russell Coker <[email protected]> +# X-Debian-Packages: ircd dancer-ircd ircd-hybrid ircd-irc2 ircd-ircu # #################################
domains/program/unused/irc.te +1 -0
@@ -1,6 +1,7 @@ #DESC Irc - IRC client # # Domains for the irc program. +# X-Debian-Packages: tinyirc ircii # # irc_exec_t is the type of the irc executable.
domains/program/unused/kcheckpass.te +1 -0
@@ -1,6 +1,7 @@ #DESC Kcheckpass - Program to check password for KDE # # Author: Russell Coker <[email protected]> +# X-Debian-Packages: kdebase-bin # #################################
domains/program/unused/lpd.te +1 -0
@@ -3,6 +3,7 @@ # Authors: Stephen Smalley <[email protected]> and Timothy Fraser # Modified by David A. Wheeler <[email protected]> for LPRng (Red Hat 7.1) # Modified by Russell Coker <[email protected]> +# X-Debian-Packages: lpr # #################################
domains/program/unused/lpr.te +1 -0
@@ -1,6 +1,7 @@ #DESC Lpr - Print client # # Authors: Stephen Smalley <[email protected]> and Timothy Fraser +# X-Debian-Packages: lpr lprng #
domains/program/unused/mailman.te +1 -0
@@ -1,6 +1,7 @@ #DESC Mailman - GNU Mailman mailing list manager # # Author: Russell Coker <[email protected]> +# X-Debian-Packages: mailman type mailman_data_t, file_type, sysadmfile; type mailman_archive_t, file_type, sysadmfile;
domains/program/unused/mrtg.te +1 -0
@@ -1,6 +1,7 @@ #DESC MRTG - Network traffic graphing # # Author: Russell Coker <[email protected]> +# X-Debian-Packages: mrtg # #################################
domains/program/unused/mta.te +1 -0
@@ -1,6 +1,7 @@ #DESC MTA - Mail agents # # Author: Russell Coker <[email protected]> +# X-Debian-Packages: postfix exim sendmail sendmail-wide # # policy for all mail servers, including allowing user to send mail from the # command-line and for cron jobs to use sendmail -t
domains/program/unused/mysqld.te +1 -0
@@ -1,6 +1,7 @@ #DESC Mysqld - Database server # # Author: Russell Coker <[email protected]> +# X-Debian-Packages: mysql-server # #################################
domains/program/unused/named.te +1 -0
@@ -2,6 +2,7 @@ # # Authors: Yuichi Nakamura <[email protected]>, # Russell Coker +# X-Debian-Packages: bind bind9 # #
domains/program/unused/nessusd.te +1 -0
@@ -1,6 +1,7 @@ #DESC Nessus network scanning daemon # # Author: Russell Coker <[email protected]> +# X-Debian-Packages: nessus # #################################
domains/program/unused/netsaint.te +1 -0
@@ -1,6 +1,7 @@ #DESC Net Saint - network monitoring server # # Author: Russell Coker <[email protected]> +# X-Debian-Packages: netsaint # #################################
domains/program/unused/netscape.te +1 -0
@@ -1,6 +1,7 @@ #DESC Netscape - Web browser # # Authors: Stephen Smalley <[email protected]> and Timothy Fraser +# X-Debian-Packages: mozilla # # Type for the netscape, mozilla or other browser executables.
domains/program/unused/nscd.te +1 -0
@@ -1,6 +1,7 @@ #DESC NSCD - Name service cache daemon cache lookup of user-name # # Author: Russell Coker <[email protected]> +# X-Debian-Packages: nscd # #################################
domains/program/unused/nsd.te +1 -0
@@ -1,6 +1,7 @@ #DESC Authoritative only name server # # Author: Russell Coker +# X-Debian-Packages: nsd # #
domains/program/unused/ntpd.te +1 -0
@@ -1,6 +1,7 @@ #DESC NTPD - Time synchronisation daemon # # Author: Russell Coker <[email protected]> +# X-Debian-Packages: ntp ntp-simple # #################################
domains/program/unused/oav-update.te +1 -0
@@ -1,6 +1,7 @@ #DESC Oav - Anti-virus update program # # Author: Brian May <[email protected]> +# X-Debian-Packages: # type oav_update_var_lib_t, file_type, sysadmfile;
domains/program/unused/openca-ca.te +1 -0
@@ -1,6 +1,7 @@ #DESC OpenCA - Open Certificate Authority # # Author: Brian May <[email protected]> +# X-Debian-Packages: # #################################
domains/program/unused/pamconsole.te +1 -0
@@ -1,3 +1,4 @@ #DESC Pamconsole - PAM console +# X-Debian-Packages: # # pam_console_apply
domains/program/unused/perdition.te +1 -0
@@ -1,6 +1,7 @@ #DESC Perdition POP and IMAP proxy # # Author: Russell Coker <[email protected]> +# X-Debian-Packages: perdition # #################################
domains/program/unused/ping.te +1 -0
@@ -1,6 +1,7 @@ #DESC Ping - Send ICMP messages to network hosts # # Author: David A. Wheeler <[email protected]> +# X-Debian-Packages: iputils-ping netkit-ping iputils-arping arping hping2 # #################################
domains/program/unused/portmap.te +1 -0
@@ -2,6 +2,7 @@ # # Authors: Stephen Smalley <[email protected]> and Timothy Fraser # Russell Coker <[email protected]> +# X-Debian-Packages: portmap #
domains/program/unused/portslave.te +1 -0
@@ -1,6 +1,7 @@ #DESC Portslave - Terminal server software # # Author: Russell Coker <[email protected]> +# X-Debian-Packages: portslave # #################################
domains/program/unused/postfix.te +1 -0
@@ -1,6 +1,7 @@ #DESC Postfix - Mail server # # Author: Russell Coker <[email protected]> +# X-Debian-Packages: postfix # # Type for files created during execution of postfix.
domains/program/unused/postgresql.te +1 -0
@@ -1,6 +1,7 @@ #DESC Postgresql - Database server # # Author: Russell Coker <[email protected]> +# X-Debian-Packages: postgresql # #################################
domains/program/unused/pppd.te +1 -0
@@ -1,6 +1,7 @@ #DESC PPPD - PPP daemon # # Author: Russell Coker +# X-Debian-Packages: ppp # #################################
domains/program/unused/procmail.te +1 -0
@@ -1,6 +1,7 @@ #DESC Procmail - Mail delivery agent for mail servers # # Author: Russell Coker <[email protected]> +# X-Debian-Packages: procmail # #################################
domains/program/unused/qmail.te +1 -0
@@ -1,5 +1,6 @@ #DESC Qmail - Mail server # # Author: Russell Coker <[email protected]> +# X-Debian-Packages: qmail-src qmail #
domains/program/unused/quota.te +1 -0
@@ -1,6 +1,7 @@ #DESC Quota - File system quota management utilities # # Author: Russell Coker <[email protected]> +# X-Debian-Packages: quota quotatool # #################################
domains/program/unused/radius.te +1 -0
@@ -1,6 +1,7 @@ #DESC RADIUS - Radius server # # Author: Russell Coker <[email protected]> +# X-Debian-Packages: radiusd-cistron radiusd-livingston xtradius yardradius radiusd-freeradius # #################################
domains/program/unused/radvd.te +1 -0
@@ -1,6 +1,7 @@ #DESC Radv - IPv6 route advisory daemon # # Author: Russell Coker <[email protected]> +# X-Debian-Packages: radvd # #################################
domains/program/unused/rlogind.te +1 -0
@@ -1,6 +1,7 @@ #DESC Rlogind - Remote login daemon # # Authors: Stephen Smalley <[email protected]> and Timothy Fraser +# X-Debian-Packages: rsh-client rsh-redone-client # #################################
domains/program/unused/rpcd.te +1 -0
@@ -2,6 +2,7 @@ # # Authors: Stephen Smalley <[email protected]> and Timothy Fraser # Russell Coker <[email protected]> +# X-Debian-Packages: # #################################
domains/program/unused/rpm.te +1 -0
@@ -1,5 +1,6 @@ #DESC RPM - Red Hat package management # +# X-Debian-Packages: ################################# # # Rules for running the Redhat Package Manager (RPM) tools.
domains/program/unused/rshd.te +1 -0
@@ -1,6 +1,7 @@ #DESC RSHD - RSH daemon # # Authors: Stephen Smalley <[email protected]> and Timothy Fraser +# X-Debian-Packages: rsh-server rsh-redone-server # #################################
domains/program/unused/samba.te +1 -0
@@ -1,6 +1,7 @@ #DESC SAMBA - SMB file server # # Author: Ryan Bergauer ([email protected]) +# X-Debian-Packages: samba # #################################
domains/program/unused/scannerdaemon.te +1 -0
@@ -1,6 +1,7 @@ #DESC Scannerdaemon - Virus scanner daemon # # Author: Brian May <[email protected]> +# X-Debian-Packages: # #################################
domains/program/unused/screen.te +1 -0
@@ -1,5 +1,6 @@ #DESC screen - Program to detach sessions # +# X-Debian-Packages: screen # Domains for the screen program. #
domains/program/unused/selopt.te +1 -0
@@ -1,5 +1,6 @@ #DESC Selopt - SELinux ip labeling utilities # +# X-Debian-Packages: ################################# # # Rules for the SELOPT packet labeling domains.
domains/program/unused/sendmail.te +1 -0
@@ -1,6 +1,7 @@ #DESC Sendmail - Mail server # # Authors: Stephen Smalley <[email protected]> and Timothy Fraser +# X-Debian-Packages: sendmail sendmail-wide # #################################
domains/program/unused/slapd.te +1 -0
@@ -1,6 +1,7 @@ #DESC Slapd - OpenLDAP server # # Author: Russell Coker <[email protected]> +# X-Debian-Packages: slapd # #################################
domains/program/unused/snmpd.te +1 -0
@@ -1,6 +1,7 @@ #DESC SNMPD - Simple Network Management Protocol daemon # # Author: Russell Coker <[email protected]> +# X-Debian-Packages: snmpd # #################################
domains/program/unused/snort.te +1 -0
@@ -2,6 +2,7 @@ # # Author: Shaun Savage <[email protected]> # Modified by Russell Coker <[email protected]> +# X-Debian-Packages: snort-common # daemon_domain(snort)
domains/program/unused/sound.te +1 -0
@@ -1,6 +1,7 @@ #DESC Sound - Sound utilities # # Authors: Mark Westerman <[email protected]> +# X-Debian-Packages: esound # ################################# #
domains/program/unused/speedmgmt.te +1 -0
@@ -1,6 +1,7 @@ #DESC Speedmgmt - Alcatel speedtouch USB ADSL modem # # Author: Russell Coker <[email protected]> +# X-Debian-Packages: kernel-patch-2.4-speedtouch # #################################
domains/program/unused/squid.te +1 -0
@@ -1,6 +1,7 @@ #DESC Squid - Web cache # # Author: Russell Coker <[email protected]> +# X-Debian-Packages: squid # #################################
domains/program/unused/sxid.te +1 -0
@@ -1,6 +1,7 @@ #DESC Sxid - SUID/SGID program monitoring # # Author: Russell Coker <[email protected]> +# X-Debian-Packages: sxid # #################################
domains/program/unused/sysstat.te +1 -0
@@ -1,6 +1,7 @@ #DESC Sysstat - Sar and similar programs # # Authors: Russell Coker <[email protected]> +# X-Debian-Packages: sysstat # #################################
domains/program/unused/tcpd.te +1 -0
@@ -2,6 +2,7 @@ # # Authors: Stephen Smalley <[email protected]> and Timothy Fraser # Russell Coker <[email protected]> +# X-Debian-Packages: tcpd # #################################
domains/program/unused/tftpd.te +1 -0
@@ -1,6 +1,7 @@ #DESC TFTP - UDP based file server for boot loaders # # Author: Russell Coker <[email protected]> +# X-Debian-Packages: tftpd atftpd # #################################
domains/program/unused/traceroute.te +1 -0
@@ -2,6 +2,7 @@ # # Author: Russell Coker <[email protected]> # based on the work of David A. Wheeler <[email protected]> +# X-Debian-Packages: traceroute lft # #################################
domains/program/unused/transproxy.te +1 -0
@@ -1,6 +1,7 @@ #DESC Transproxy - Transparent proxy for web access # # Author: Russell Coker <[email protected]> +# X-Debian-Packages: transproxy # #################################
domains/program/unused/usbmodules.te +1 -0
@@ -1,6 +1,7 @@ #DESC USBModules - List kernel modules for USB devices # # Author: Russell Coker <[email protected]> +# X-Debian-Packages: # #################################
domains/program/unused/utempter.te +1 -0
@@ -1,6 +1,7 @@ #DESC Utempter - Privileged helper for utmp/wtmp updates # # Authors: Stephen Smalley <[email protected]> and Timothy Fraser +# X-Debian-Packages: # #################################
domains/program/unused/vmware.te +1 -0
@@ -7,6 +7,7 @@ # modifications by NAI Labs. # # Domain is for the VMWare admin programs and daemons. +# X-Debian-Packages: # # Next two domains are create by the daemon_domain() macro. # The vmware_t domain is for running VMWare daemons
domains/program/unused/watchdog.te +1 -0
@@ -1,6 +1,7 @@ #DESC Watchdog - Software watchdog daemon # # Author: Russell Coker <[email protected]> +# X-Debian-Packages: watchdog # #################################
domains/program/unused/xauth.te +1 -0
@@ -1,6 +1,7 @@ #DESC Xauth - X authority file utility # # Domains for the xauth program. +# X-Debian-Packages: xbase-clients # Author: Russell Coker <[email protected]> #
domains/program/unused/xdm.te +1 -0
@@ -2,6 +2,7 @@ # # Authors: Mark Westerman [email protected] # Russell Coker <[email protected]> +# X-Debian-Packages: gdm xdm wdm kdm # # Some wdm-specific changes by Tom Vogt <[email protected]> #
domains/program/unused/xfs.te +1 -0
@@ -2,6 +2,7 @@ # # Authors: Stephen Smalley <[email protected]> and Timothy Fraser # Russell Coker <[email protected]> +# X-Debian-Packages: xfs # #################################
domains/program/unused/xserver.te +1 -0
@@ -1,6 +1,7 @@ #DESC XServer - X Server # # Authors: Stephen Smalley <[email protected]> and Timothy Fraser +# X-Debian-Packages: xserver-common xserver-xfree86 # # Type for the executable used to start the X server, e.g. Xwrapper.
domains/program/unused/ypbind.te +1 -0
@@ -2,6 +2,7 @@ # # Authors: Stephen Smalley <[email protected]> and Timothy Fraser # Russell Coker <[email protected]> +# X-Debian-Packages: nis # #################################
domains/program/useradd.te +1 -0
@@ -2,6 +2,7 @@ # # Authors: Chris Vance <[email protected]> David Caplan <[email protected]> # Russell Coker <[email protected]> +# X-Debian-Packages: passwd # #################################
Quoted 8 lines · Colin Walters
While Debianizing all the SE 2.5 stuff, I got pretty fed up with answering 100+ questions about whether or not to install individual policy files. So I've been working on a few new options for installing the Debian SELinux policy.
The main idea is to add information to each .te file about which Debian packages use it. I went with the semi-RFC822 style formatting in use and called it "X-Debian-Packages:".
I am not still not clear on how this extra information will be used to help solve the above problem...
Signature · 6 lines
Brian May <[email protected]> -- 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 2 lines · Brian May
I am not still not clear on how this extra information will be used to help solve the above problem...
I've attached my policy-remove-unwanted script, as well as the Debconf .templates file. Hopefully that makes things clearer...
Do you have any specific questions?
#!/bin/bash
# Install SELinux policy files
# Loosely based on a Perl remove-unwanted-policy by Russell Coker. # Copyright (C) 2003 Colin Walters <[email protected]>
# 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; either version 2, or (at # your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA # 02111-1307 USA.
set -e
method="$1"
shift
test -n "$method" || (echo "usage: $0 METHOD"; exit 1)
if test "$method" = "Don't touch"; then
exit 0
fi
### Utility functions
shell () {
echo
echo "Installation suspended. Be sure to type \"exit\" when you are finished." ${SHELL:-/bin/sh}
}
havepkg () {
pkg=$1
if test -z "$DPKG_IS_SLOW_AS_HELL"; then
dpkg -s "$pkg" 2>/dev/null | egrep -q '[[:space:]]installed' 1>/dev/null 2>&1
else
test -f /var/lib/dpkg/info/"$pkg".list
fi
return
}querypolicy () {
file="$1"
description="$2"
debs="$3"
default="$4"
if [ -n "$description" ]; then
printf "Include \"%s\" (%s) in policy?\n" "$description" "$file"
else
printf "Include \"%s\" in policy?\n" "$file"
fi
if [ -n "$debs" ]; then
if [ "$debs" = "NODEBLINE" ]; then
printf " (File does not have an X-Debian-Packages: header)\n"
else
printf " (References known installed packages: %s)\n" "$debs"
fi
else
printf " (Does not reference any known installed packages)\n"
fi
printf " Yes/No/Display/Background "
case "$default" in
y) printf "[Y/n/d/b]? ";;
*) printf "[y/N/d/b]? ";;
esac
read ans
case $(echo "$ans" | tr '[A-Z]' '[a-z]') in
y*) return 0;;
n*) return 1;;
d|D*) sensible-pager "$file"; querypolicy "$file" "$description" "$debs" "$default"; return;;
b|B) shell; querypolicy "$file" "$description" "$debs" "$default";;
*) if test "$default" = "y"; then return 0; else return 1; fi;;
esac
return 1
}### Begin script
cd /usr/share/selinux/policy/
current=$(cd current && find domains/program -type f 2>/dev/null)
# Loop over all the files in domains/program, and query the user about
# each one.
delpolicy=
for file in $current; do
if ! egrep -q "^$file\\$" ignorediff 2>/dev/null; then
origfile="$file"
file="current/$file"
if head -1 "$file" | egrep -q '^#DESC'; then
description=$(head -1 "$file" | sed -r -e 's/^#DESC[[:space:]]*//')
have_debline=
if egrep -q '^#[[:space:]]*X-Debian-Packages:' "$file"; then
have_debline=yes
debs=$(egrep '^#[[:space:]]*X-Debian-Packages:' "$file" | \
sed -r -e 's/^.*X-Debian-Packages:[[:space:]]*//' -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
fi
instdebs=
for pkg in $debs; do
if havepkg $pkg; then instdebs="$instdebs $pkg"; break; fi
done
instdebs=$(echo $instdebs | sed -r -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
remove=no
case "$method" in
Automatic)
if [ -z "$have_debline" ]; then
if ! querypolicy "$file" "$description" "NODEBLINE" "y"; then
remove=yes
fi
else
if [ -z "$instdebs" ]; then
remove=yes
fi
fi;;
Semi-Automatic)
if [ -z "$instdebs" ] || ! querypolicy "$file" "$description" "$instdebs" "y"; then
remove=yes
fi;;
Manual)
if ! querypolicy "$file" "$description" "$instdebs" "n"; then
remove=yes
fi;;
*) printf "Internal error; unknown method type \"%s\"!\n" "$method"; exit 1;;
esac
if [ "$remove" = "yes" ]; then
delpolicy="$delpolicy $origfile"
printf "Removing \"%s\"\n" "$file"
else
printf "Keeping \"%s\"\n" "$file"
fi
fi
fi
done# Record which files they didn't want in "delfiles". : > delfiles
for file in $delpolicy; do
rm "current/$file"
echo "$file" >> delfiles
done
Template: selinux-policy-default/policy_installation_method
Type: select
Choices: Automatic, Semi-Automatic, Manual, Don't Touch
Default: Semi-Automatic
Description: Choose a policy installation method.
There are several available methods by which you can install new SELinux policy files. If you choose "Automatic", all policy files which match known installed Debian packages will be automatically installed. You will get a notice of which policy files were installed.
.
For more control, you may choose "Semi-Automatic" (the default), which is like "Automatic" in that it only works on policy files which match installed Debian packages; however, it will prompt you before installing a policy file.
.
The "Manual" option will enable prompting for all available policy files.
.
Finally, "Don't Touch" will totally disable all prompting. You will be responsible for maintaining the policy yourself.
Quoted 9 lines · Colin Walters
While Debianizing all the SE 2.5 stuff, I got pretty fed up with answering 100+ questions about whether or not to install individual policy files. So I've been working on a few new options for installing the Debian SELinux policy.
The main idea is to add information to each .te file about which Debian packages use it. I went with the semi-RFC822 style formatting in use and called it "X-Debian-Packages:".
Quoted 6 lines
Since this is a 1-line change to more than 120 files, it'd be nice if it could be merged upstream to reduce the size of our policy diffs. The metadata may be useful too for other systems which might use similar package names, or at least it will give a hint about what the software is if you're unsure. And since this is just a change to the comments, it should be minimally intrusive.
This patch has been merged into our 2.5/6 policy tree, and has been committed to the sourceforge CVS tree.
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.