From: Daniel J Walsh <dwalsh@redhat.com>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: Hasan Rezaul-CHR010 <CHR010@motorola.com>,
selinux@tycho.nsa.gov,
"Christopher J. PeBenito" <cpebenito@tresys.com>
Subject: Re: How to use sepolgen VS. policygentool
Date: Thu, 10 Dec 2009 14:38:46 -0500 [thread overview]
Message-ID: <4B214E46.9070305@redhat.com> (raw)
In-Reply-To: <1260460494.3025.22.camel@moss-pluto.epoch.ncsc.mil>
On 12/10/2009 10:54 AM, Stephen Smalley wrote:
> On Wed, 2009-12-09 at 21:18 -0500, Hasan Rezaul-CHR010 wrote:
>> Hi All,
>>
>> I used to have the following SELinux related package versions on my
>> Linux (2.6.18) system:
>>
>> checkpolicy - 1.33.1
>> libselinux - 2.0.13
>> libsemanage - 2.0.1
>> libsepol - 2.0.3
>> libsetrans - 0.1.18
>> policycoreutils - 2.0.16
>>
>> On that machine, I used to use /usr/share/selinux/devel/policygentool
>> to create new custom policy templates, and modified them as necessary,
>> and used to run
>>
>> make -f /usr/share/selinux/devel/Makefile to compile my custom.te
>> policies to create custom.pp.
>>
>> I now have upgraded to Linux 2.6.27 on a non-popular Linux distro, and
>> as part of this upgrade, we also migrated to much newer versions of the
>> SELinux packages. They are:
>>
>> checkpolicy-2.0.19
>> libselinux-2.0.85
>> libsemanage-2.0.33
>> libsepol-2.0.37
>> policycoreutils-2.0.69
>> sepolgen-1.0.17
>>
>> My questions are :
>>
>> 1. On this new system, I don't see policygentool anymore ! Infact, I am
>> missing the whole /usr/share/selinux/devel/* directory. Can I install
>> the selinux-policy-devel package on this machine ? If so, where should
>> I get it from ? Is policygentool still supported ?
>
> policygentool and /usr/share/selinux/devel/ is specific to Fedora and
> RHEL - it isn't part of upstream SELinux or reference policy AFAIK. I
> think reference policy puts its headers
> under /usr/share/selinux/$POLICYTYPE so that you can have multiple sets
> of headers.
>
>> 2. I do see this new package "sepolgen", which I am guessing is the
>> newer replacement ? I do see that sepolgen is infact installed on my
>> system:
>
> No, sepolgen is a python module that provides the core logic for
> audit2allow. Not related to policygentool at all.
>
>> root@unknown:/root> rpm -q sepolgen
>> sepolgen-1.0.17-1_WR3.0.2as.ppc_e500v2
>> root@unknown:/root>
>> root@unknown:/root> which sepolgen
>> which: no sepolgen in
>> (/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/root/bin)
>> root@unknown:/root>
>> root@unknown:/root>
>> root@unknown:/root> cd /usr/lib/sepolgen/
>> root@unknown:/usr/lib/sepolgen> ls
>> perm_map
>> root@unknown:/usr/lib/sepolgen>
>>
>> How do I use this sepolgen thing ? I thought I could run an sepolgen
>> executable as follows: "sepolgen -t <program>"
>> But I don't see where the sepolgen executable is ??? Do I need to
>> install any other packages to use sepolgen ?
>>
>> 3. Finally, it seems that sepolgen will create a template policy based
>> on a particular process, e.g. /usr/bin/ssh
>>
>> What if I wanted to write more generic policy for restricting selinux
>> users. For example:
>>
>> neverallow user_t etc_t:file write;
>> neverallow user_t bin_t:file write;
>> neverallow user_t proc_t:file write;
>> neverallow staff_t bin_t:file write;
>> :
>> :
>>
>> what <program_name> should I supply in the sepolgen command, to
>> create a custom policy template for this purpose ?
>>
>>
>> Thanks in advance for all your help :-)
>>
>>
>>
>> --
>> 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.
I have added a command line tool sepolgen which uses the polgengui stuff to generate policy.
http://danwalsh.livejournal.com/32430.html
--
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 prev parent reply other threads:[~2009-12-10 19:38 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-17 0:15 sshd error: Failed to get default security context Larry Ross
2009-10-17 11:39 ` Daniel J Walsh
2009-10-17 18:17 ` Larry Ross
2009-10-19 13:53 ` Stephen Smalley
2009-10-19 16:49 ` Larry Ross
2009-10-19 17:13 ` Stephen Smalley
2009-10-20 1:43 ` Larry Ross
2009-10-20 11:18 ` Stephen Smalley
2009-10-27 1:16 ` Where do I get a good Policy Base ? Hasan Rezaul-CHR010
2009-10-27 8:49 ` Dominick Grift
2009-10-27 12:45 ` Christopher J. PeBenito
2009-11-10 0:01 ` Hasan Rezaul-CHR010
2009-12-10 2:18 ` How to use sepolgen VS. policygentool Hasan Rezaul-CHR010
2009-12-10 2:50 ` Hasan Rezaul-CHR010
2009-12-10 16:02 ` Stephen Smalley
2009-12-10 17:11 ` Guido Trentalancia
2009-12-10 19:11 ` Daniel J Walsh
2009-12-10 15:54 ` Stephen Smalley
2009-12-10 19:38 ` Daniel J Walsh [this message]
2009-12-15 17:43 ` Policy writing philosophy Hasan Rezaul-CHR010
2009-12-15 20:14 ` Dominick Grift
2009-12-15 20:40 ` Bandan Das
2009-12-16 14:58 ` Stephen Smalley
2009-12-16 15:30 ` Hasan Rezaul-CHR010
2009-12-16 15:47 ` Stephen Smalley
2009-12-16 15:48 ` Hasan Rezaul-CHR010
2009-12-10 19:04 ` How to use sepolgen VS. policygentool Daniel J Walsh
2009-11-11 19:37 ` Where do I get a good Policy Base ? Hasan Rezaul-CHR010
2009-11-11 22:02 ` Daniel J Walsh
2009-11-11 23:25 ` Hasan Rezaul-CHR010
2009-11-12 13:06 ` Daniel J Walsh
2009-10-18 10:33 ` sshd error: Failed to get default security context Dominick Grift
2009-10-18 18:58 ` Larry Ross
2009-10-19 14:02 ` 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=4B214E46.9070305@redhat.com \
--to=dwalsh@redhat.com \
--cc=CHR010@motorola.com \
--cc=cpebenito@tresys.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.