All of lore.kernel.org
 help / color / mirror / Atom feed
* Core policy
@ 2003-02-24 18:55 Wayne Salamon
  2003-02-24 19:59 ` Russell Coker
  2003-02-24 20:08 ` Clem Skorupka
  0 siblings, 2 replies; 24+ messages in thread
From: Wayne Salamon @ 2003-02-24 18:55 UTC (permalink / raw)
  To: SE Linux

  I would like some feedback from the list in order to begin paring back
the SELinux example policy for a smaller 'core'. The idea is that other
portions of the policy considered non-core will be in a directory whose
files are not built into the core by default.

Here is a list of policy files that may considered the core policy.
However, this policy needs some work in order to build, but I'm trying to
get a feel for what users typically run on their systems.

The inclusion of a file should be determined by the needs of the system
and what programs are expected to be run, and other needs of the system
software (network interfaces, for example). The base platform is assumed
to be a capable Linux workstation with few optional services.

The X Windows related domains have been listed separately.

domains/program (with corresponding file_contexts/program)
==========================================================
apache.te	Apache Web server; may need to be simplified to allow only
		serving Web pages without CGI, etc.
apmd.te		Automatic Power Management daemon
atd.te 		Atd server
automount.te	Automount daemon
bootloader.te	Lilo boot loader/manager
cardmgr.te	PCMCIA control programs
checkpolicy.te	SELinux policy compliler
chkpwd.te	PAM password checking programs
crond.te	Crond daemon
crontab.te	Crontab manipulation programs
cups.te		Common Unix Printing System
devfsd.te	Control daemon for devfs device file system
dhcpc.te	DHCP client
fsadm		Disk and file system administration
getty.te	Manage ttys
gpm.te		General Purpose Mouse driver
hotplug.te	Hardware event manager
hwclock.te	Hardware clock manager
ifconfig.te	Configure network interfaces
inetd.te	Internet services daemon
init.te		Process initialization
initrc.te	System initialization scripts
ipchains.te	IP packet filter administration
klogd.te	Kernel log daemon
ldconfig.te	Configure dynamic linker bindings
load_policy.te	Policy loading utilities
login.te	Local/remote login utilities
logrotate.te	Rotate log files
lpr.te		Print client
modutil.te	Dynamic module utilities
mount.te	Filesystem mount utilities
netscape.te	Web browser (most of the policy is in a macros file)
netutils.te	Network utilities (could be removed)
newrole.te	SELinux utility to run a shell with a new role
pamconsole.te	PAM console
passwd.te	Password utilities
ping.te		Send ICMP messages to network hosts
portmap.te	Maintain RPC program number map
portslave.te	Terminal server software (not sure about this one)
pppd.te		PPP daemon
procmail.te	Mail delivery agent for mail servers (may be removed)
pump.te		DHCP client
rlogind.te	Remote login daemon (can remove; shouldn't run rlogin anyway)
rpcd.te		RPC daemon (not sure; how often do client workstations export
		RPC services)
rpm.te		Red Hat package management
rshd.te		RSH daemon (can remove; shouldn't run rsh anyway)
selopt.te	SELinux ip labeling utilities (can be removed; should only
		be installed when experimenting with labeled packets)
setfiles.te	SELinux filesystem labeling utilities
sound.te	Sound utilities
ssh.te		SSH daemon and ssh command
su.te		Run shells with substitute user and group (most of the policy
		is contained in su_macros.te
sxid.te		SUID/SGID program monitoring
syslogd.te	System log daemon
tmpreaper.te	Monitor and maintain temporary files
usbmodules.te	List kernel modules for USB devices
useradd.te	Manage system user accounts
utempter.te	Privileged helper for utmp/wtmp updates


X Windows potential core domains
==================================================
xauth.te	X authority file utility
xdm.te		X Display Manager
xfs.te		X font server
xserver.te	X Server

Macros
======
The use of macros has grown to be a large problem. The current policy makes use
of macros that call other macros which call macros. Some macros should be
eliminated; every_domain, every_test_domain for example. Others should be
pared down to least privilege; the xx_file_perms and xx_dir_perms for example.
The use of parameterized macros makes it very difficult to analyze the policy
source files. Also, there are several instances of rules being duplicated
in the generated policy due to macro usage.

-- 
Wayne Salamon
wsalamon@tislabs.com


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 24+ messages in thread
* RE: Core policy
@ 2003-02-24 19:43 Westerman, Mark
  0 siblings, 0 replies; 24+ messages in thread
From: Westerman, Mark @ 2003-02-24 19:43 UTC (permalink / raw)
  To: 'Wayne Salamon', SE Linux



I agree with Wayne, 
There needs some real work done on policy managemnet. 
Core policy and addons seem to be a good idea.

>Macros
>======
> The use of macros has grown to be a large problem. 
> ......
> The use of parameterized macros makes it very difficult to analyze the
policy
> source files. Also, there are several instances of rules being duplicated
> in the generated policy due to macro usage.

In tring to run conversions on the policy file to xml I run into problem
with the macro usage. 


Mark Westerman

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 24+ messages in thread
* Re: Core policy
@ 2003-02-25 15:41 Stephen D. Smalley
  2003-02-25 16:15 ` Wayne Salamon
  2003-02-25 21:54 ` Russell Coker
  0 siblings, 2 replies; 24+ messages in thread
From: Stephen D. Smalley @ 2003-02-25 15:41 UTC (permalink / raw)
  To: selinux, wsalamon


Wayne Salamon wrote:
> The use of macros has grown to be a large problem. The current policy makes 
use
> of macros that call other macros which call macros. Some macros should be
> eliminated; every_domain, every_test_domain for example. Others should be
> pared down to least privilege; the xx_file_perms and xx_dir_perms for example.
> The use of parameterized macros makes it very difficult to analyze the policy
> source files. Also, there are several instances of rules being duplicated
> in the generated policy due to macro usage.

In addition to the problem of overly permissive macros, there are also
a number of problems caused by the use of type attributes such as
'domain' and 'file_type' (as well as the other attributes like pidfile)
in allow rules.  Although there are legitimate cases where this is
appropriate (e.g. allowing init to kill all processes, allowing
setfiles to relabel all files), there is a tendency to misuse type
attributes that map to a very large set of domains/types in allow rules
that should only be applied to a more specific set.  This prevents
people from creating new domains or types that are rigorously isolated
from the rest of the system (unless they omit these attributes from
those domains or types, which then requires them to explicitly
enumerate the legitimate cases that are normally handled by those
attributes and causes problems with assertions that expect those
attributes to include certain functional classes of types).  It would
be helpful to audit the existing macros and domains for such rules and
to consider how we can refine them, e.g. defining new attributes for
more specific sets, explicitly enumerating the sets in certain cases,
eliminating the rule entirely if it isn't truly necessary.

With regard to macros, I think that they are helpful when they provide
a useful abstraction and are carefully limited to that abstraction
(i.e. no granting of permissions only weakly related to that
abstraction).  For example, domain_auto_trans and file_type_auto_trans
provide useful abstractions of the higher level concepts of domain
transitions and file type transitions, although we should audit them to
ensure that they are not being overly permissive.  They would actually
have been incorporated into the base language as primitives except for
the fact that there is some potential variance in the specific set of
permissions that you may want to grant in certain cases (the macros
merely express the common case).  In contrast, every_domain does not
provide any useful abstraction and merely conceals many permissions.
Some of its finer-grained macros might be ok (e.g.
general_domain_access) while others need to be split up further or
eliminated entirely.  Likewise, can_exec_any should likely be
eliminated entirely.

--
Stephen Smalley, NSA
sds@epoch.ncsc.mil


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 24+ messages in thread
* Re: Core policy
@ 2003-02-25 15:50 Stephen D. Smalley
  0 siblings, 0 replies; 24+ messages in thread
From: Stephen D. Smalley @ 2003-02-25 15:50 UTC (permalink / raw)
  To: ragnor, wsalamon, russell; +Cc: selinux


Russell Coker wrote:
> I suggest that we make the second line of each .te file contain a comment 
> stating which category it is in, with the possibility of policy being in 
> multiple categories.

While this seems reasonable to me, I'd suggest that we first identify
the core policy components, cleanly separate out the non-core
components, and perform a thorough audit and reduction of the core
macros and domains.  Then, we can incrementally work on a similar audit
and reduction of each of the non-core policy components, including
categorizing them and determining their interdependencies.

--
Stephen Smalley, NSA
sds@epoch.ncsc.mil


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 24+ messages in thread
* Re: Core policy
@ 2003-02-25 16:48 Stephen D. Smalley
  0 siblings, 0 replies; 24+ messages in thread
From: Stephen D. Smalley @ 2003-02-25 16:48 UTC (permalink / raw)
  To: wsalamon; +Cc: selinux


Wayne Salamon wrote:
>   I agree with the above. The macros that I was (mostly) referring to are
> the ones in macros/program. The idea behind these seems to have
> parameterized domain/type definitions. I'm not convinced they're a good
> idea, and many have dependencies to types defined in other .te files.

Creating derived domains (and associated derived types) from the
calling domain is actually good practice, as it allows you to maintain
separation between the user domains.  Otherwise, you end up with an
initial separation between the user domains that can be easily
circumvented through shared program domains that have the same accesses
to the same types.  I'd agree that all of the macros (including the
global macros as well as the program macros) need a thorough audit and
reduction, but I don't think you truly want to eliminate the use of
program macros for instantiating program domains.

--
Stephen Smalley, NSA
sds@epoch.ncsc.mil


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2003-02-26 16:08 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-24 18:55 Core policy Wayne Salamon
2003-02-24 19:59 ` Russell Coker
2003-02-24 22:51   ` Tom
2003-02-25  3:33     ` Brian May
2003-02-25  7:45     ` Russell Coker
2003-02-25  8:29       ` Tom
2003-02-25 14:40         ` Jesse Pollard
2003-02-26 13:36   ` Wayne Salamon
2003-02-26 16:08     ` Leslie J. French
2003-02-24 20:08 ` Clem Skorupka
2003-02-24 21:12   ` Russell Coker
2003-02-24 21:29     ` Frank Mayer
2003-02-25 11:35       ` Wayne Salamon
2003-02-25 13:42         ` Frank Mayer
2003-02-25 14:04         ` Frank Mayer
2003-02-25 16:32         ` Russell Coker
2003-02-24 22:19     ` Dale Amon
2003-02-26 14:06   ` Wayne Salamon
  -- strict thread matches above, loose matches on Subject: below --
2003-02-24 19:43 Westerman, Mark
2003-02-25 15:41 Stephen D. Smalley
2003-02-25 16:15 ` Wayne Salamon
2003-02-25 21:54 ` Russell Coker
2003-02-25 15:50 Stephen D. Smalley
2003-02-25 16:48 Stephen D. Smalley

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.