From: Guido Trentalancia <guido@trentalancia.com>
To: Hasan Rezaul-CHR010 <CHR010@motorola.com>
Cc: selinux@tycho.nsa.gov
Subject: RE: How to use sepolgen VS. policygentool
Date: Thu, 10 Dec 2009 18:11:44 +0100 [thread overview]
Message-ID: <1260465104.2868.11.camel@tesla.lan> (raw)
In-Reply-To: <D06FE0A2807BC145B0D38744789D4F5D07B95030@de01exm68.ds.mot.com>
You can compile the policy module as follows in two steps:
checkmodule -M -m mymodule.te -o mymodule.mod
semodule_package -o mymodule.pp -m mymodule.mod
semodule_package also accepts the optional "-f" parameter for specifying
file contexts.
However, I recommend that you use the Makefile provided
in /usr/share/selinux/devel and /usr/share/selinux/include.
You don't specify which distribution you are using. Just refer to your
distribution packager for further information on how to get the full
SELinux development tree mentioned above.
I hope this helps (it should answer both of your messages).
Regards,
Guido
On Wed, 2009-12-09 at 21:50 -0500, Hasan Rezaul-CHR010 wrote:
> One more question...
>
> Lets say I used audit2allow to create a custom policy as follows:
>
> cat deny.log | audit2allow -M test
> -- this will create test.te, and test.pp for me
>
> If I wanted to make additional modifications to test.te, how can I
> compile this new test.te to come up with the new test.pp ??
>
> Note: I don't seem to have the /usr/share/selinux/devel/Makefile file
> present on my setup !?! Is there some alternative way to compile the
> *.te files ?? Thanks.
>
>
>
> -----Original Message-----
> From: owner-selinux@tycho.nsa.gov [mailto:owner-selinux@tycho.nsa.gov]
> On Behalf Of Hasan Rezaul-CHR010
> Sent: Wednesday, December 09, 2009 8:18 PM
> To: Daniel J Walsh
> Cc: selinux@tycho.nsa.gov
> Subject: How to use sepolgen VS. policygentool
>
>
> 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 ?
>
> 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:
>
> 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.
>
>
> --
> 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.
>
--
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 17:11 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 [this message]
2009-12-10 19:11 ` Daniel J Walsh
2009-12-10 15:54 ` Stephen Smalley
2009-12-10 19:38 ` Daniel J Walsh
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=1260465104.2868.11.camel@tesla.lan \
--to=guido@trentalancia.com \
--cc=CHR010@motorola.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.