Skip to contentSkip to conversation

Security settings for fcron

DISCUSSION Russell Coker 2 participants 3 messages Aug 5, 2002 1 message not in the archive SELinux security module

lore
Share & tools
lore
#0 lore raw

I have written a patch for fcron to add SE Linux support. This patch makes it check the security type label on crontab files to ensure that they are of a suitable type for the cron job in question (IE if an administrator accidentally makes your crontab file writable by someone else then the cron job will not run [1]). It also makes the cron jobs run in the correct identity, role, and domain (so that your cron jobs get the same security limitations as your login sessions).

I have not published the patches yet because they still don't work properly (but I would be happy to send them privately to anyone who wants to look at them - especially the fcron people to make sure that I'm not doing anything silly).

One problem that I am having is determining the distinction between system cron jobs and system-administrator cron jobs.

System cron jobs are those such as the /etc/cron.{daily,weekly,monthly} jobs in Debian. They are provided as part of the OS to maintain applications, and they are designed to run as the identity "system_u", as the role "system_r", and the domain "system_crond_t" giving the context system_u:system_r:system_crond_t. Cron jobs applied by the administrator via "fcrontab -e" should be run in the same fashion as regular cron jobs applied by "crontab -e", in the context "root:sysadm_r:sysadm_crond_t".

The code to put the cron job in the correct domain is trivial. For me to determine how to recognise the difference between the two is really difficult (in fact I'm not even certain it's possible).

Henrique and Thibault, I would appreciate any advice you can offer.

Also if you go to #selinux on irc.openprojects.net you will find the details for how to login to my SE play machine if you want to experiment with SE Linux and get a feel for what needs to be done.

[1] This feature implemented in the regular crond prevented my SE play machine cose from being cracked in one instance.

Signature · 3 lines
I do not get viruses because I do not use MS software.
If you use Outlook then please do not put my email address in your
address-book so that WHEN you get a virus it won't use my address in the
Quoted 1 line

From field.

--
You have received this message because you are subscribed to the selinux 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

Am Montag, 5. August 2002 16:28 schrieb Russell Coker:

Quoted 10 lines

One problem that I am having is determining the distinction between system cron jobs and system-administrator cron jobs.

System cron jobs are those such as the /etc/cron.{daily,weekly,monthly} jobs in Debian. They are provided as part of the OS to maintain applications, and they are designed to run as the identity "system_u", as the role "system_r", and the domain "system_crond_t" giving the context system_u:system_r:system_crond_t. Cron jobs applied by the administrator via "fcrontab -e" should be run in the same fashion as regular cron jobs applied by "crontab -e", in the context "root:sysadm_r:sysadm_crond_t".

I read the crond rules this weekend too. I mean you distrinction is right.

But the system_crond_t is too powerfull (can_exec_any) I think. Isn't it better to wite each system cronjob an own domain with the transition he needs?

Carsten

--
You have received this message because you are subscribed to the selinux list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw
Quoted 9 lines · Carsten Grohmann

Am Montag, 5. August 2002 16:28 schrieb Russell Coker:

Quoted 2 lines

One problem that I am having is determining the distinction between system cron jobs and system-administrator cron jobs.

I read the crond rules this weekend too. I mean you distrinction is right.

But the system_crond_t is too powerfull (can_exec_any) I think. Isn't it better to wite each system cronjob an own domain with the transition he needs?

can_exec_any() doesn't give much real power. It's the access to /var/log that gives system_crond_t it's power.

There are a number of domains for cron jobs, the ntp cron job runs as ntpd_t, there's logrotate_t, sxid_t, and a few others.

Signature · 3 lines
I do not get viruses because I do not use MS software.
If you use Outlook then please do not put my email address in your
address-book so that WHEN you get a virus it won't use my address in the
Quoted 1 line

From field.

--
You have received this message because you are subscribed to the selinux list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.