All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Justin P. mattock" <justinmattock@gmail.com>
To: Alan Rouse <alan.rouse@ericsson.com>
Cc: Stephen Smalley <sds@tycho.nsa.gov>,
	Dominick Grift <domg472@gmail.com>,
	"'selinux@tycho.nsa.gov'" <selinux@tycho.nsa.gov>
Subject: Re: SELinux Policy in OpenSUSE 11.2
Date: Thu, 18 Feb 2010 15:17:33 -0800	[thread overview]
Message-ID: <4B7DCA8D.8010708@gmail.com> (raw)
In-Reply-To: <5A5E55DF96F73844AF7DFB0F48721F0F529A780AEE@EUSAACMS0703.eamcs.ericsson.se>

On 02/18/2010 01:53 PM, Alan Rouse wrote:
> Justin, could you share what you did to reach that state?  Your last email yesterday left me with the impression that you were rebuilding some tools from source...  What tools, what versions?  What booleans did you disable?
>


sure.. (hopefully I don't get you confused)
from looking at the policy suse gives,
a monolithic policy. While running the one that they provide I noticed
the system is running as system_u:system_r:system_t
(or whatever it is)
I'm sure you can use this, but for me
I like to either run in staff_r, sysadm_r or user_r(roles).
(if under a corporate environment user_r would be the safest).

If wanting to run under these roles you would need to define these 
roles, and users under policy/users, or if using a binary policy you 
would use /usr/sbin/semanage user * and so forth.

I couldn't find the source from suse(although I'm sure its there), so I 
just grabbed a copy from tresys.(if the source is available then you 
just need to add the user and the roles in policy/users or if using a 
binary policy use semanage(in this case I wanted the system to run as
name:user_r:user_t.)

while building the source from tresys I sometimes will hit a syntex 
error(this time I did) with checkpolicy and/or checkmodule(something 
with flex-2.35*) so downgrading flex to 2.5.4a and building checkpolicy 
with this version for some reason or another fixes the syntax error(keep 
in mind I only used that flex version for checkpolicy/checkmodule, then 
removed that version and put back the original, after checkpolicy was 
built).
keep in mind this error seems to be random so if you don't hit this
then you don't need to rebuild chekpolicy/checkmodule.

then after being able to build and install the policy  then I focused in 
on the booleans, I set(although am not sure if they fixed the errors 
with avahi)where these:

allow_polyinstantiation=on
init_upstart=on(although I think they use sysvinit(notsure))
xdm_sysadm_login=on(this is for sysadm_r role(if I wanted the main 
context as name:sysadm_r:sysadm_t))
xserver_object_manager=on (although I dont see the SELinux
extension in Xorg.0.log)

keep in mind I don't think these booleans fixed the errors I think after
I had relabeled then the errors were fixed(but could be wrong).
(NOTE: relabeling with older versions of refpolicy will break, because 
there is no ext4 support so just use fixfiles)

then once I was able to get a clean boot(even with the "targeted" dbus 
issue)
I focused in on the login context:
name:user_r:user_t

this can be done in:
/etc/pam.d/{login,gdm,xdm}

adding:
session required pam_selinux.so close
session required pam_selinux.so open
(suse has nothing of this in there files,
or atleast I didn't see them)

gets me to login as:
name:user_r:user_t
(with monolithic you can change your login/user context
by adjust default_contexts to what context you want,
binary policy you would have to use semanage)

now after being able to have a clean boot,
and login context I then started to define the allow rules
(with binary policy you use audit2allow -dM modulename
then semodule -i modulename to install)

with monolithic because I'm lazy I just stick all allow rules in 
xserver.te in a real production environment you would have to
individually place each allow rule in it's appropriate *.te file
i.g. all hal allow rules goe into hal.te etc...
(with selinux_policy_default you have a file called local.te where all
of these go into).

so after adding all allow rules from dmesg/messages(audit2allow)
I then added all allow rules from /var/log/audit/audit.log
(there probably is a tool, but haven't figured what it is yet)

then after no more denials(with booting, and the apps I wanted to use) I 
was able to boot in full enforcement.
(keep in mind you might need to do a make enableaudit to grab some
noaudit rules that are preventing the system from running).

hope this helps, and hope I didn't get you confused
if you need any info let me know either me, or somebody else
will help you out.

Justin P. Mattock





















--
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.

  reply	other threads:[~2010-02-18 23:17 UTC|newest]

Thread overview: 113+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-16 14:55 SELinux Policy in OpenSUSE 11.2 Alan Rouse
2010-02-16 15:22 ` Dominick Grift
2010-02-16 18:04   ` Alan Rouse
2010-02-16 18:35     ` Dominick Grift
2010-02-16 18:52     ` Dominick Grift
2010-02-16 19:28     ` Stephen Smalley
2010-02-16 20:06       ` Justin P. mattock
2010-02-16 19:10 ` Stephen Smalley
2010-02-16 19:19   ` Alan Rouse
2010-02-16 19:38     ` Stephen Smalley
2010-02-16 21:30       ` Alan Rouse
2010-02-16 22:52         ` Dominick Grift
2010-02-17  3:36           ` Justin P. mattock
2010-02-17  7:16           ` Justin P. mattock
2010-02-17 13:43             ` Stephen Smalley
2010-02-17 15:35               ` Justin P. mattock
2010-02-17 16:34             ` Alan Rouse
2010-02-17 16:58               ` Stephen Smalley
2010-02-17 18:34                 ` Alan Rouse
2010-02-17 18:50                   ` Justin P. mattock
2010-02-17 18:58                   ` Stephen Smalley
2010-02-17 19:39                     ` Alan Rouse
2010-02-17 19:47                     ` Justin P. mattock
2010-02-17 20:00                       ` Stephen Smalley
2010-02-17 20:03                         ` Alan Rouse
2010-02-17 20:12                           ` Dominick Grift
2010-02-17 20:18                           ` Stephen Smalley
2010-02-17 20:17                             ` Alan Rouse
2010-02-17 20:25                             ` Stephen Smalley
     [not found]                               ` <5A5E55DF96F73844AF7DFB0F48721F0F529A7802A0@EUSAACMS0703.eamcs.ericsson.se>
     [not found]                                 ` <1266438910.4945.137.camel@moss-pluto.epoch.ncsc.mil>
2010-02-17 20:49                                   ` Alan Rouse
2010-02-17 21:09                                     ` Stephen Smalley
2010-02-17 21:11                                       ` Alan Rouse
2010-02-17 21:29                                         ` Stephen Smalley
2010-02-17 21:37                                           ` Stephen Smalley
2010-02-17 21:48                                             ` Alan Rouse
2010-02-18 14:16                                               ` Stephen Smalley
2010-02-18 21:28                                                 ` Stephen Smalley
2010-02-18 16:03                                               ` Stephen Smalley
2010-02-18 17:36                                                 ` Alan Rouse
2010-02-18 17:53                                                   ` Stephen Smalley
2010-02-18 18:21                                                     ` Alan Rouse
2010-02-19 14:49                                                       ` Stephen Smalley
2010-02-19 15:29                                                         ` Alan Rouse
2010-02-19 17:46                                                           ` Stephen Smalley
2010-02-19 20:23                                                             ` Alan Rouse
2010-02-19 21:06                                                               ` Stephen Smalley
2010-02-19 21:10                                                                 ` Alan Rouse
     [not found]                                           ` <5A5E55DF96F73844AF7DFB0F48721F0F529A780365@EUSAACMS0703.eamcs.ericsson.se>
2010-02-18 14:12                                             ` Stephen Smalley
2010-02-18 14:45                                               ` Alan Rouse
2010-02-17 20:08                         ` Alan Rouse
2010-02-18 21:40                           ` Justin P. mattock
2010-02-18 21:53                             ` Alan Rouse
2010-02-18 23:17                               ` Justin P. mattock [this message]
2010-02-19 14:35                                 ` Stephen Smalley
2010-02-19 15:43                                   ` Justin P. mattock
2010-02-19 15:58                                 ` Alan Rouse
2010-02-19 16:26                                   ` Justin P. mattock
2010-02-19 14:28                             ` Stephen Smalley
2010-02-19 15:48                               ` Justin P. mattock
2010-02-19 18:46                               ` Justin P. mattock
2010-02-19 21:08                                 ` Alan Rouse
2010-02-19 21:19                                   ` Dominick Grift
2010-02-19 21:22                                   ` Justin P. mattock
2010-02-19 21:25                                   ` Stephen Smalley
2010-02-19 21:30                                     ` Alan Rouse
2010-02-19 21:37                                       ` Stephen Smalley
2010-02-19 21:53                                         ` Alan Rouse
2010-02-22 14:10                                           ` Stephen Smalley
     [not found]                                             ` <5A5E55DF96F73844AF7DFB0F48721F0F52E41FF16B@EUSAACMS0703.eamcs.ericsson.se>
     [not found]                                               ` <1266850844.15933.38.camel@moss-pluto.epoch.ncsc.mil>
2010-02-22 17:39                                                 ` Alan Rouse
2010-02-22 17:56                                                   ` Stephen Smalley
2010-02-22 19:12                                                     ` Alan Rouse
2010-02-22 19:37                                                       ` Stephen Smalley
2010-02-19 23:48                                         ` Justin P. mattock
2010-02-22  1:29                                         ` Justin P. mattock
2010-02-19 21:47                                     ` Justin P. mattock
2010-02-22 14:00                                       ` Stephen Smalley
2010-02-22 19:27                                         ` Justin Mattock
     [not found]                                           ` <dd18b0c31002221129s4be9b56cha13b7be39c2cba36@mail.gmail.com>
2010-02-22 19:57                                             ` Justin P. mattock
2010-02-22 20:24                                               ` Stephen Smalley
2010-02-22 21:25                                                 ` Justin Mattock
2010-02-22 21:42                                                   ` Stephen Smalley
2010-02-22 22:10                                                   ` Justin P. mattock
2010-02-22 22:35                                                     ` Justin Mattock
2010-02-23  6:17                                                       ` Justin P. mattock
2010-02-23 13:40                                                         ` Stephen Smalley
2010-02-23 14:13                                                           ` Justin P. mattock
2010-02-23 15:56                                                           ` Alan Rouse
2010-02-23 16:10                                                             ` Stephen Smalley
2010-02-23 17:41                                                               ` Justin P. mattock
2010-02-23 18:01                                                                 ` Stephen Smalley
2010-02-23 18:30                                                                   ` Justin P. mattock
2010-02-23 18:42                                                                     ` Stephen Smalley
2010-02-23 18:58                                                                       ` Justin P. mattock
2010-02-23 19:00                                                                         ` Stephen Smalley
2010-02-23 19:03                                                                           ` Justin Mattock
2010-02-23 20:37                                                                             ` Justin P. mattock
2010-02-22 17:58                                       ` Alan Rouse
2010-02-22 18:23                                         ` Justin P. mattock
2010-02-22 18:31                                           ` Alan Rouse
2010-02-22 18:49                                             ` Justin P. mattock
     [not found]                     ` <5A5E55DF96F73844AF7DFB0F48721F0F529A780232@EUSAACMS0703.eamcs.ericsson.se>
2010-02-17 19:58                       ` Stephen Smalley
2010-02-17 20:09                         ` Justin P. mattock
2010-02-17 20:21                           ` Stephen Smalley
2010-02-17 23:22                             ` Justin P. mattock
2010-02-18 15:17                               ` Alan Rouse
2010-02-18 18:33                                 ` Justin P. mattock
2010-02-18 18:44                                   ` Alan Rouse
2010-02-17 13:35         ` Stephen Smalley
2010-02-17 15:14           ` Alan Rouse
2010-02-17 15:33             ` Stephen Smalley
  -- strict thread matches above, loose matches on Subject: below --
2010-02-17 14:04 Thomas
2010-04-29  6:43 Justin P. Mattock
2010-04-29  7:01 ` Justin P. Mattock

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=4B7DCA8D.8010708@gmail.com \
    --to=justinmattock@gmail.com \
    --cc=alan.rouse@ericsson.com \
    --cc=domg472@gmail.com \
    --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.