Skip to contentSkip to conversation

too many sysadmfile?

DISCUSSION Chris PeBenito 2 participants 3 messages Jun 9, 2004 – Jun 11, 2004 SELinux security module

lore
Share & tools
lore
#0 lore raw

One thing that hasn't sat well with me for a long time is that just about all file_types are sysadmfile in the strict policy. To me, this sounds like an excessive amount of access for sysadm_t (with exception of the unrestricted_admin tunable being on).

Its true that since sysadm_t can already relabel almost everything, it makes this change moot from a security perspective, since it can relabel a file to something it can modify. However, by limiting normal access, it affords some protection against accidental overwrites and deletions, and from malicious programs a sysadmin might accidentally run. In my opinion, the packagers (rpm_t, etc) should be the only ones with access all file_types.

I haven't looked into it much, but my idea is eliminate sysadmfile except where its obviously warranted, such as in /etc/* types. Then change the sysadmfile policy in admin_domain to something like:

ifdef(unrestricted_admin', create_dir_notdevfile($1_t,{ file_type -device_type -shadow_t }) ',`
create_dir_notdevfile($1_t,sysadmfile)
')

Or maybe use a boolean could be used, instead of a tunable. Then change the relabeling rule to:

# Relabel all files except shadow_t.
allow $1_t { file_type -shadow_t }:dir { getattr read search relabelfrom relabelto }; allow $1_t { file_type -shadow_t }:file_class_set { getattr relabelfrom relabelto };

Comments?

Signature · 8 lines
Chris PeBenito
<[email protected]>
Developer,
Hardened Gentoo Linux
Embedded Gentoo Linux
 
Public Key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xE6AF9243
Key fingerprint = B0E6 877A 883F A57A 8E6A  CB00 BC8E E42D E6AF 9243
#1 lore raw
Quoted 7 lines · Chris PeBenito

Its true that since sysadm_t can already relabel almost everything, it makes this change moot from a security perspective, since it can relabel a file to something it can modify. However, by limiting normal access, it affords some protection against accidental overwrites and deletions, and from malicious programs a sysadmin might accidentally run. In my opinion, the packagers (rpm_t, etc) should be the only ones with access all file_types.

Well... yes... True in theory, but... ;)

The other side of the coin is system manageability - let's say that rpm_t is able to write all file types, but the admin can't.

Now, assume you do this: "rpm -Fvh prog1.rpm prog2.rpm". and that the two
RPMs have pre-req chains so you have to do both, and that create .rpmold (or worse, .rpmnew) files when they install with diferent foo_t labels.

How many times do you need to 'newrole' to deal with all the .rpmnew files?

In the real world, the additional security it buys is limited, because the admin *can* manage to newrole to each foo_t (unless you run with very strict compartmentalization and can afford enough admins so you can give each one only a few foo_t). Those sites are probably the sort of military/spook systems where newrole has been modified(*) to require a counter-password from the SSO or similar on each newrole.. ;)

In any other environment, all it does is annoy the sysadmin and potentially make them not bother installing a patch because the resulting afternoon of newrole hell convinces them not to do it...

(*) IBM's AIX documents how to create a two-password logon sequence, where for user A to get on, they have to enter A's password, and then B has to enter B's password - amybody willing to admit to a pam module or similar hook for login/ su/newrole?

#2 lore raw
Quoted 7 lines · On Wed, 2004-06-09 at 14:37, [email protected] wrote:
Quoted 3 lines · Chris PeBenito

In my
opinion, the packagers (rpm_t, etc) should be the only ones with access all file_types.

Well... yes... True in theory, but... ;)

Quoted 8 lines

The other side of the coin is system manageability - let's say that rpm_t is able to write all file types, but the admin can't.

Now, assume you do this: "rpm -Fvh prog1.rpm prog2.rpm". and that the two
RPMs have pre-req chains so you have to do both, and that create .rpmold (or worse, .rpmnew) files when they install with diferent foo_t labels.

How many times do you need to 'newrole' to deal with all the .rpmnew files?

Its been a long time since I've used rpm, but where do these files usually occur? I'd think in /etc for the most part, where types would be sysadminfiles. Possible manageability problems is why I suggested getting the full access back via a boolean.

Signature · 8 lines
Chris PeBenito
<[email protected]>
Developer,
Hardened Gentoo Linux
Embedded Gentoo Linux
 
Public Key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xE6AF9243
Key fingerprint = B0E6 877A 883F A57A 8E6A  CB00 BC8E E42D E6AF 9243