Skip to contentSkip to conversation

Running racoon from init_t?

DISCUSSION Paul Moore 3 participants 5 messages Mar 9, 2007 SELinux security module

lore
Share & tools
lore

Paul Moore

author
#0 lore raw

This is in regards to RHEL5 and the MLS policy.

I'm trying to run racoon at startup, from within the rc.local script, which means it is being run from init/init_t. Whenever I try to do this I see the following AVC denials:

***
type=AVC msg=audit(1173457995.784:305): avc: denied { use } for pid=2105 comm="racoon" name="console" dev=tmpfs ino=725 scontext=system_u:system_r:racoon_t:s0-s15:c0.c1023 tcontext=system_u:system_r:init_t:s0-s15:c0.c1023 tclass=fd type=AVC msg=audit(1173457995.784:305): avc: denied { use } for pid=2105 comm="racoon" name="console" dev=tmpfs ino=725 scontext=system_u:system_r:racoon_t:s0-s15:c0.c1023 tcontext=system_u:system_r:init_t:s0-s15:c0.c1023 tclass=fd type=AVC msg=audit(1173457995.784:305): avc: denied { use } for pid=2105 comm="racoon" name="console" dev=tmpfs ino=725 scontext=system_u:system_r:racoon_t:s0-s15:c0.c1023 tcontext=system_u:system_r:init_t:s0-s15:c0.c1023 tclass=fd
***

I suspect this can fixed by adding the following to the policy, suggestions?

init_use_fds(racoon_t)

Signature · 7 lines
paul moore
linux security @ hp

--
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.
#1 lore raw
Quoted 5 lines · Paul Moore

This is in regards to RHEL5 and the MLS policy.

I'm trying to run racoon at startup, from within the rc.local script, which means it is being run from init/init_t. Whenever I try to do this I see the following AVC denials:

Should be run from initrc_t (rc.local should have initrc_exec_t on it). Although the inherited fds may still have init_t on them due to being created by /sbin/init and then just inherited by the descendants.

Quoted 16 lines

***
type=AVC msg=audit(1173457995.784:305): avc: denied { use } for pid=2105 comm="racoon" name="console" dev=tmpfs ino=725 scontext=system_u:system_r:racoon_t:s0-s15:c0.c1023 tcontext=system_u:system_r:init_t:s0-s15:c0.c1023 tclass=fd type=AVC msg=audit(1173457995.784:305): avc: denied { use } for pid=2105 comm="racoon" name="console" dev=tmpfs ino=725 scontext=system_u:system_r:racoon_t:s0-s15:c0.c1023 tcontext=system_u:system_r:init_t:s0-s15:c0.c1023 tclass=fd type=AVC msg=audit(1173457995.784:305): avc: denied { use } for pid=2105 comm="racoon" name="console" dev=tmpfs ino=725 scontext=system_u:system_r:racoon_t:s0-s15:c0.c1023 tcontext=system_u:system_r:init_t:s0-s15:c0.c1023 tclass=fd
***

Quoted 3 lines

I suspect this can fixed by adding the following to the policy, suggestions?

init_use_fds(racoon_t)

I'd have expected it to pick up the right rules from being an init_daemon_domain().

Signature · 8 lines
Stephen Smalley
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.
#2 lore raw
Quoted 27 lines · Stephen Smalley
Quoted 5 lines · Paul Moore

This is in regards to RHEL5 and the MLS policy.

I'm trying to run racoon at startup, from within the rc.local script, which means it is being run from init/init_t. Whenever I try to do this I see the following AVC denials:

Should be run from initrc_t (rc.local should have initrc_exec_t on it). Although the inherited fds may still have init_t on them due to being created by /sbin/init and then just inherited by the descendants.

Quoted 16 lines

***
type=AVC msg=audit(1173457995.784:305): avc: denied { use } for pid=2105 comm="racoon" name="console" dev=tmpfs ino=725 scontext=system_u:system_r:racoon_t:s0-s15:c0.c1023 tcontext=system_u:system_r:init_t:s0-s15:c0.c1023 tclass=fd type=AVC msg=audit(1173457995.784:305): avc: denied { use } for pid=2105 comm="racoon" name="console" dev=tmpfs ino=725 scontext=system_u:system_r:racoon_t:s0-s15:c0.c1023 tcontext=system_u:system_r:init_t:s0-s15:c0.c1023 tclass=fd type=AVC msg=audit(1173457995.784:305): avc: denied { use } for pid=2105 comm="racoon" name="console" dev=tmpfs ino=725 scontext=system_u:system_r:racoon_t:s0-s15:c0.c1023 tcontext=system_u:system_r:init_t:s0-s15:c0.c1023 tclass=fd
***

Quoted 6 lines
Quoted 3 lines

I suspect this can fixed by adding the following to the policy, suggestions?

init_use_fds(racoon_t)

I'd have expected it to pick up the right rules from being an init_daemon_domain().

Actually, I'd tend to think that should be dontaudit'd - it doesn't have a legitimate need to access the console, right? Then SELinux will just close the descriptor silently and replace it with a ref to the null device.

Signature · 8 lines
Stephen Smalley
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.
author
#3 lore raw
Quoted 7 lines · Stephen Smalley
Quoted 6 lines · Stephen Smalley
Quoted 4 lines · Paul Moore

I suspect this can fixed by adding the following to the policy, suggestions?

init_use_fds(racoon_t)

Quoted 7 lines
Quoted 2 lines

I'd have expected it to pick up the right rules from being an init_daemon_domain().

Actually, I'd tend to think that should be dontaudit'd - it doesn't have a legitimate need to access the console, right? Then SELinux will just close the descriptor silently and replace it with a ref to the null device.

That sounds reasonable as any configuration done in in this context will have to be from a configuration file and not from stdin.

Signature · 7 lines
paul moore
linux security @ hp

--
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
In reply to Stephen Smalley
Quoted 32 lines · Stephen Smalley
Quoted 31 lines · Stephen Smalley
Quoted 5 lines · Paul Moore

This is in regards to RHEL5 and the MLS policy.

I'm trying to run racoon at startup, from within the rc.local script, which means it is being run from init/init_t. Whenever I try to do this I see the following AVC denials:

Should be run from initrc_t (rc.local should have initrc_exec_t on it). Although the inherited fds may still have init_t on them due to being created by /sbin/init and then just inherited by the descendants.

Quoted 19 lines

***
type=AVC msg=audit(1173457995.784:305): avc: denied { use } for pid=2105 comm="racoon" name="console" dev=tmpfs ino=725 scontext=system_u:system_r:racoon_t:s0-s15:c0.c1023 tcontext=system_u:system_r:init_t:s0-s15:c0.c1023 tclass=fd type=AVC msg=audit(1173457995.784:305): avc: denied { use } for pid=2105 comm="racoon" name="console" dev=tmpfs ino=725 scontext=system_u:system_r:racoon_t:s0-s15:c0.c1023 tcontext=system_u:system_r:init_t:s0-s15:c0.c1023 tclass=fd type=AVC msg=audit(1173457995.784:305): avc: denied { use } for pid=2105 comm="racoon" name="console" dev=tmpfs ino=725 scontext=system_u:system_r:racoon_t:s0-s15:c0.c1023 tcontext=system_u:system_r:init_t:s0-s15:c0.c1023 tclass=fd
***

I suspect this can fixed by adding the following to the policy, suggestions?

init_use_fds(racoon_t)

Quoted 7 lines
Quoted 2 lines

I'd have expected it to pick up the right rules from being an init_daemon_domain().

Actually, I'd tend to think that should be dontaudit'd - it doesn't have a legitimate need to access the console, right? Then SELinux will just close the descriptor silently and replace it with a ref to the null device.

I agree. Actually there's a noticeable amount of services that allow this already. If the service has rules that allow the console access, we can leave the init fd inheritance for now (making note to revisit it). But if it doesn't use the console, we can remove the init_use_fds() and have the fds be dontaudited through the init_daemon_domain() interface. Make sense?

Signature · 9 lines
Chris PeBenito
Tresys Technology, LLC
(410) 290-1411 x150


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