SELinux Policy Editor and CAP_SYS_BOOT
I have the need to enable (and make work) the shutdown and halt accounts. I set a password for these accounts and tried to use them and got the expected "you must be root" a collegue pointed out that I might need the CAP_SYS_BOOT capability turned on. After an hour of Googling on something that relates to CAP_SYS_BOOT and makes sense within the context of SELinux.
I came up with a reference in the old SELinux Policy Editor page that indicates you could set a "boot system call" check-box
To check this allows the current domain to use the "reboot" system call. This corresponds to the capability "CAP_SYS_BOOT" in Linux system.
The page also go on to say that SELinux Policy Editor is for 2.4 Kernel only ...
Can someone give me some info on making this work?
Nix
Signature · 11 lines
Nick Gray Senior Systems Engineer Bruzenak Inc Office: 512-331-7998 Cell: 512-630-7009 -- 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 6 lines · Nick
I have the need to enable (and make work) the shutdown and halt accounts. I set a password for these accounts and tried to use them and got the expected "you must be root" a collegue pointed out that I might need the
CAP_SYS_BOOTcapability turned on. After an hour of Googling on something that relates toCAP_SYS_BOOTand makes sense within the context of SELinux.
And the purpose of these accounts is what? Console user can already shutdown via consolehelper.
To use the capability, you must pass both the Linux check (i.e. have uid
0) and the SELinux check (i.e. your domain must have an allow xxx_t self:capability sys_boot;). What identity are these accounts assigned? Do they even work with SELinux in permissive mode? If not, then your issue isn't SELinux-related. Otherwise, you would need to define a role and domain with the necessary permissions, and define the accounts in policy/users with the corresponding role.
Quoted 7 lines
I came up with a reference in the old SELinux Policy Editor page that indicates you could set a "boot system call" check-box
To check this allows the current domain to use the "reboot" system call. This corresponds to the capability "CAP_SYS_BOOT" in Linux system.The page also go on to say that SELinux Policy Editor is for 2.4 Kernel only ...
Is that the Hitachi policy tool? I've heard about it, but never looked at it. But even that wouldn't change the fact that you need to define a role/domain for these accounts.
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.
Quoted 10 lines · Stephen Smalley
Quoted 6 lines · Nick
I have the need to enable (and make work) the shutdown and halt accounts. I set a password for these accounts and tried to use them and got the expected "you must be root" a collegue pointed out that I might need the
CAP_SYS_BOOTcapability turned on. After an hour of Googling on something that relates toCAP_SYS_BOOTand makes sense within the context of SELinux.And the purpose of these accounts is what? Console user can already shutdown via consolehelper.
The purpose of the built-in halt and shutdown accounts were originally to give someone, you trust enough to be able to know when to shutdown the system, but not enough to let him login, the ability to shut down a server. A secondary function of these was a remote shutdown that didn't require any thought on the users part! You gave him/her the password and said, "If you need to shut the machine down for any reason, telnet into the machine with "this" account and it will shut itself down. In this manner, you didn't have to give the user physical access to the server.
Console helper is new to me, but it sounds like it might perform the same function, Thanks
Quoted 7 lines
To use the capability, you must pass both the Linux check (i.e. have uid
0) and the SELinux check (i.e. your domain must have an allowxxx_tself:capabilitysys_boot;). What identity are these accounts assigned? Do they even work with SELinux in permissive mode? If not, then your issue isn't SELinux-related. Otherwise, you would need to define a role and domain with the necessary permissions, and define the accounts in policy/users with the corresponding role.
No, I don't think it is SELinux related per se, I was thinking that perhaps this had been addressed as part of SELinux since the capabilities are a security oriented feature that allow root accesses to ordinary users. It would be a good idea to wrap this in some sort of protection. I am not sure how widely used this is. If you do a man on "capabilities" you will find some info, but not really enough to get you going. There are a couple instructions which form a sort of API, but that is it. Apparently LinSec makes use of it.
The problem with posting things to the fedora list is most users there are still trying to get their CD to work or solve a video card problem. The volume of traffic is so high that that you lose any response to a message within a day without a search. Since the level of competency is so much higher here, I think that security related issues, particularly the ones we would like to see addressed by SELinux would be appropriate to the list.
Quoted 10 lines
Quoted 7 lines
I came up with a reference in the old SELinux Policy Editor page that indicates you could set a "boot system call" check-box
To check this allows the current domain to use the "reboot" system call. This corresponds to the capability "CAP_SYS_BOOT" in Linux system.The page also go on to say that SELinux Policy Editor is for 2.4 Kernel only ...
Is that the Hitachi policy tool? I've heard about it, but never looked at it.
Yes the link is http://www.selinux.hitachi-sk.co.jp/en/tool/selpe/selpe-
top.html
Quoted 2 lines
But even that wouldn't change the fact that you need to define a
role/domain for these accounts.
Understood
--
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 · Nick
Console helper is new to me, but it sounds like it might perform the same function
No, I don't think it matches your goals based on your description, as it is strictly focused on allowing console users to run system programs, not remote shutdown.
Quoted 8 lines
No, I don't think it is SELinux related per se, I was thinking that perhaps this had been addressed as part of SELinux since the capabilities are a security oriented feature that allow root accesses to ordinary users. It would be a good idea to wrap this in some sort of protection. I am not sure how widely used this is. If you do a man on "capabilities" you will find some info, but not really enough to get you going. There are a couple instructions which form a sort of API, but that is it. Apparently LinSec makes use of it.
At present, you have to pass both sets of checks, the ordinary Linux capability check (which is presently tied to uid 0 in the absence of filesystem capabilities) and the SELinux capability permission check. In order to safely drop the ordinary Linux capability check and use SELinux to completely manage capabilities (based on roles and domains), we would need to tighten the security policy further, going beyond even what is in the strict policy today, and we would need to make sure that all application assumptions about uid 0 have been replaced with appropriate SELinux checks. That may happen someday (and some people are already experimenting with it on the outside), but we didn't want to rush into it, as it can easily lead to a vulnerability. Other systems that have completely overridden the ordinary Linux check with their own logic have been known to be vulnerable in the past.
Quoted 7 lines
The problem with posting things to the fedora list is most users there are still trying to get their CD to work or solve a video card problem. The volume of traffic is so high that that you lose any response to a message within a day without a search. Since the level of competency is so much higher here, I think that security related issues, particularly the ones we would like to see addressed by SELinux would be appropriate to the list.
There is a fedora-selinux-list, which is focused on the Fedora SELinux integration. Not to chase you off to it, but it may be helpful.
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.
Quoted 6 lines · Nick
I have the need to enable (and make work) the shutdown and halt accounts. I set a password for these accounts and tried to use them and got the expected "you must be root" a collegue pointed out that I might need the
CAP_SYS_BOOTcapability turned on. After an hour of Googling on something that relates toCAP_SYS_BOOTand makes sense within the context of SELinux.
init_t has capability sys_boot as it is the domain that instructs the kernel to reboot in normal situations. The administrator merely asks the init process to perform the reboot.
Signature · 9 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.