From: Daniel J Walsh <dwalsh@redhat.com>
To: Ivan Gyurdiev <ivg2@cornell.edu>,
Stephen Smalley <sds@tycho.nsa.gov>,
SE Linux <selinux@tycho.nsa.gov>
Subject: Re: Why cron doesn't work in strict policy
Date: Tue, 07 Feb 2006 09:34:59 -0500 [thread overview]
Message-ID: <43E8B013.8000000@redhat.com> (raw)
In-Reply-To: <43E7C804.3040507@cornell.edu>
Ivan Gyurdiev wrote:
>
>>
>> cron ---> getseuserbyname(system_u)
>> selinux <--- (user_u, s0)
>> cron ---> get_default_context_with_level(user_u, s0)
>> selinux <--- (user_u:user_r:user_xserver_t) (????)
>> cron ---> security_compute_av(user_u:user_r:user_xserver_t,
>> system_u:object_r:system_cron_spool_t)
>> selinux <-- not allowed
>>
>> The problem comes from system_u being mapped to __default__ in the
>> seusers file, although I have no idea why (user_u, s0) would return
>> default context of user_xserver_t either.
> So for using system cronfiles, the getseuserbyname() call needs to be
> skilled (since you've already decided on the user - system_u, user.c:
> line 87). Not sure about level. Alternatively you can query using root.
Seems to me we have two choices. One is to change cron to default to
"root" when there is no username or to add system_u to the seusers file.
Right now cron has the following code in it.
if (get_security_context(pw == NULL ? "system_u" : uname,
crontab_fd,
&u->scontext, tabname) != 0) {
free_user(u);
u = NULL;
goto done;
}
get_security_context()
...
if (getseuserbyname(name, &seuser, &level) == 0) {
retval=get_default_context_with_level(seuser, level, NULL,
&scontext);
free(seuser);
free(level);
if (retval) {
...
Which causes cron jobs on strict policy and I would guess MLS to run at
user_u since system_u is not defined and would run at level s0.
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
next parent reply other threads:[~2006-02-07 14:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <43E7C52E.601@cornell.edu>
[not found] ` <43E7C804.3040507@cornell.edu>
2006-02-07 14:34 ` Daniel J Walsh [this message]
2006-02-07 14:40 ` Why cron doesn't work in strict policy Ivan Gyurdiev
2006-02-07 14:43 ` Stephen Smalley
2006-02-07 14:40 ` Daniel J Walsh
2006-02-07 14:42 ` Ivan Gyurdiev
2006-02-07 14:55 ` Stephen Smalley
2006-02-07 15:02 ` Ivan Gyurdiev
2006-02-07 15:23 ` Daniel J Walsh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=43E8B013.8000000@redhat.com \
--to=dwalsh@redhat.com \
--cc=ivg2@cornell.edu \
--cc=sds@tycho.nsa.gov \
--cc=selinux@tycho.nsa.gov \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.