From: Stephen Smalley <sds@tycho.nsa.gov>
To: Cheyenne Solo <ayla.cheyenne@gmail.com>
Cc: selinux@tycho.nsa.gov, Daniel J Walsh <dwalsh@redhat.com>,
"Christopher J. PeBenito" <cpebenito@tresys.com>
Subject: Re: Base module, modules.conf
Date: Thu, 05 Feb 2009 12:51:46 -0500 [thread overview]
Message-ID: <1233856306.3181.32.camel@localhost.localdomain> (raw)
In-Reply-To: <5ab9a20b0902041252l7041062fqc7202db633bb2141@mail.gmail.com>
On Wed, 2009-02-04 at 15:52 -0500, Cheyenne Solo wrote:
>
>
> On Fri, Jan 16, 2009 at 2:03 PM, Stephen Smalley <sds@tycho.nsa.gov>
> wrote:
>
> On Fri, 2009-01-16 at 12:43 -0500, Cheyenne Solo wrote:
> > Hello list,
> >
> > This is my first time writing to the list, and I'm an
> SELinux newbie.
> >
> > I'm trying to do some experiments on SELinux that require me
> to
> > replace the base module.
>
>
> Can you explain why? Often it turns out that people can in
> fact do what
> they want without replacing the base module these days
> (particularly
> given the merge of strict and targeted policies), so it would
> be good to
> first double check that you truly need to do this.
>
> You're quite right; after more fiddling and thinking I've found I can
> do what I want (and it's better to do so anyway) with the base policy
> intact. I've started using Fedora 7 so I can use the strict policy and
> its user mapping capabilities for my (A)RBAC experimentation. While I
> would still like to be able to modify the base policy, I can do
> without.
No need to regress to Fedora 7; as I said, the strict and targeted
policies have been merged into a single policy in Fedora 8 and later
such that you can map users to confined roles and even remove unconfined
altogether if you wish (although that requires care and likely isn't
required for your purposes). You really should be using a Fedora
release that is still supported, like Fedora 10.
> I have hit a different roadblock, however, dealing with custom user
> mappings: I cannot get users I've created to map to SELinux users I've
> defined. I've declared the users and their roles and types in a module
> that I have installed into the policy. When I added mappings
> to /etc/selinux/strict/seusers , either by hand or with semanage, the
> user ends up with the context
> system_u:system_r:xdm_t:SystemHigh-SystemLow. I have files in
> the /etc/selinux/strict/contexts/users/ directory for each user and
> have put the types and roles appropriately in the default_type file.
>
> How does the login process really determine these mappings, and why
> would all of my custom mappings be redirected to
> system_u:system_r:xdm_t? I am quite puzzled.
system_u:system_r:xdm_t is the context of the graphical display manager,
so if you are ending up in that context upon a graphical login, that
means that your graphical display manager did not successfully set the
context to anything for the user session. It may have logged some
errors to /var/log/messages or /var/log/secure. It shouldn't have let
you login at all in enforcing mode.
Did you follow the instructions in:
http://oss.tresys.com/projects/refpolicy/wiki/RoleCreation
The general sequence is:
1) Look up the Linux user in the seusers file, thereby obtaining a
SELinux user and a level. This is handled by the getseuserbyname()
function in libselinux.
2) Get the list of security contexts for that (SELinux user, level) pair
reachable from the caller's context. This is handled by the
get_ordered_context_list_with_level() function in libselinux.
Internally, this asks the kernel for a list of such contexts based on
policy and then orders and prunes the list based on the default_contexts
file.
There are some sample utilities (getseuser, getdefaultcon) in the
libselinux source tree that can be used to directly exercise those
functions for debugging purposes.
It would help for you to post your actual module and config files.
--
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 majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
prev parent reply other threads:[~2009-02-05 17:51 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-16 17:43 Base module, modules.conf Cheyenne Solo
2009-01-16 19:03 ` Stephen Smalley
2009-01-16 19:23 ` Dominick Grift
2009-01-16 19:52 ` Stephen Smalley
2009-01-19 20:53 ` Jacques Thomas
2009-01-20 14:26 ` Stephen Smalley
2009-01-20 15:58 ` Joe Nall
2009-01-20 19:25 ` Stephen Smalley
2009-01-20 20:31 ` Jacques Thomas
2009-02-04 20:52 ` Cheyenne Solo
2009-02-04 21:53 ` Dominick Grift
2009-02-05 17:51 ` Stephen Smalley [this message]
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=1233856306.3181.32.camel@localhost.localdomain \
--to=sds@tycho.nsa.gov \
--cc=ayla.cheyenne@gmail.com \
--cc=cpebenito@tresys.com \
--cc=dwalsh@redhat.com \
--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.