Skip to contentSkip to conversation

/selinux/enforce permissions

DISCUSSION Russell Coker 2 participants 5 messages Oct 7, 2003 SELinux security module

lore
Share & tools
lore
#0 lore raw

Wouldn't it make sense to have the permissions 0644 for /selinux/enforce?

Or maybe even 0666 would do? After all either SE Linux is controlling it, or it doesn't matter too much...

Signature · 10 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.
#1 lore raw
Quoted 4 lines · Russell Coker

Wouldn't it make sense to have the permissions 0644 for /selinux/enforce?

Or maybe even 0666 would do? After all either SE Linux is controlling it, or it doesn't matter too much...

What rationale do you have for opening up access to it further? Least privilege and defense in depth suggest that 0600 is the right mode for /selinux/enforce and /selinux/load, even though you also have to pass the SELinux permission checks as well.

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.
#2 lore raw
Quoted 10 lines · Stephen Smalley
Quoted 4 lines · Russell Coker

Wouldn't it make sense to have the permissions 0644 for /selinux/enforce?

Or maybe even 0666 would do? After all either SE Linux is controlling it, or it doesn't matter too much...

What rationale do you have for opening up access to it further? Least privilege and defense in depth suggest that 0600 is the right mode for /selinux/enforce and /selinux/load, even though you also have to pass the SELinux permission checks as well.

The old SE Linux allowed the avc_enforcing() system call from any context, and when the machine was not in enforcing mode avc_toggle() could be run from any UID. If we want to preserve the same functionality as old SE Linux then we want mode 0644.

Detecting whether SE Linux is in enforcing mode is quite easy, you can try dmesg, if it can't do anything then you are enforcing mode. If dmesg does work then it will usually tell you enough to either determine whether it's in enforcing mode or the tests you need to perform to determine whether you are in enforcing mode. So 0644 does not seem to give away anything that can't be obtained in other ways.

I wasn't entirely serious about mode 0666, although that would be required to give the same functionality as the old SE Linux.

Signature · 10 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.
#3 lore raw
Quoted 4 lines · Russell Coker

The old SE Linux allowed the avc_enforcing() system call from any context, and when the machine was not in enforcing mode avc_toggle() could be run from any UID. If we want to preserve the same functionality as old SE Linux then we want mode 0644.

What functionality depended on that behavior? Doesn't seem worth retaining to me.

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.
#4 lore raw
Quoted 8 lines · Stephen Smalley
Quoted 4 lines · Russell Coker

The old SE Linux allowed the avc_enforcing() system call from any context, and when the machine was not in enforcing mode avc_toggle() could be run from any UID. If we want to preserve the same functionality as old SE Linux then we want mode 0644.

What functionality depended on that behavior? Doesn't seem worth retaining to me.

Running "avc_enforcing" from any UID was very convenient, it saved doing the other strange things that you might have to do to determine the state of the machine (and also saved having to su to do it).

I guess I could just do:
alias avc_enforcing="dmesg 2> /dev/null|wc -l"

Signature · 10 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.