* Re: Where do I get a good Policy Base ?...
2009-10-27 8:49 ` Dominick Grift
@ 2009-10-27 12:45 ` Christopher J. PeBenito
2009-11-10 0:01 ` Hasan Rezaul-CHR010
2009-11-11 19:37 ` Where do I get a good Policy Base ? Hasan Rezaul-CHR010
2 siblings, 0 replies; 34+ messages in thread
From: Christopher J. PeBenito @ 2009-10-27 12:45 UTC (permalink / raw)
To: Dominick Grift; +Cc: Hasan Rezaul-CHR010, selinux
On Tue, 2009-10-27 at 09:49 +0100, Dominick Grift wrote:
> On Mon, 2009-10-26 at 21:16 -0400, Hasan Rezaul-CHR010 wrote:
> > Hi All,
> >
> > I used to have the following SELinux related package versions on my
> > Linux (2.6.18) system:
[...]
> > And I used a 'strict' Base policy from Fedora Core 6. Made the
> > modifications I needed on top of that, and I was very happy...
> >
> >
> > We get our OS packaged/delivered from a third party company, and we're
> > upgrading to Linux 2.6.27, and as part of this upgrade, we are also
> > migrating to much newer versions of the SELinux packages. They are:
[...]
> > My questions are:
> >
> > 1. I believe the "strict" policy is no longer supported in the above
> > versions of SELinux packages? Is this true ?
>
> the "strict" policy model is no longer supported. The strict and target
> policy have merged to a policy model that is called "targeted".
No, it doesn't have a specific name. However, for ease of discussion, a
system with all confined domains is still referred to as "strict",
otherwise its "targeted".
> > 2. The entire set of policies that I have fine-tuned over the years
> > under my /etc/selinux/strict/modules/active/modules/*.pp directory in
> > my previous older system, can I make any use of that ?? In other words,
> > can that stuff be re-used at all ? Or do I need to develop policy from
> > scratch again ?
>
> I am not sure about this but my opinion is that it should in most cases
> be possible to use older binary modules in newer policy. Reference
> policy should be compatible in my view.
We try hard to maintain compatibility, but FC6 is several years old, so
compatibility may have been broken, especially after the 2.x API break
for UBAC.
--
Chris PeBenito
Tresys Technology, LLC
(410) 290-1411 x150
--
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.
^ permalink raw reply [flat|nested] 34+ messages in thread
* RE: Where do I get a good Policy Base ?...
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-11-11 19:37 ` Where do I get a good Policy Base ? Hasan Rezaul-CHR010
2 siblings, 1 reply; 34+ messages in thread
From: Hasan Rezaul-CHR010 @ 2009-11-10 0:01 UTC (permalink / raw)
To: Dominick Grift; +Cc: selinux
Thanks for your answers :-)
A quick follow up question...
What would be the most appropriate Fedora selinux-policy that I can
start off with as a base to build on top of, Given:
that I have Linux 2.6.27, and I have the following latest SELinux
package versions :
> checkpolicy-2.0.19
> libselinux-2.0.85
> libsemanage-2.0.33
> libsepol-2.0.37
> policycoreutils-2.0.69
> sepolgen-1.0.17
Should I use Fedora 11 -
download.fedora.redhat.com/pub/fedora/linux/development/i386/os/Packages
/selinux-policy-3.6.6-5.fc11.noarch.rpm
Or should I use Fedora 10 -
download.fedora.redhat.com/pub/fedora/linux/updates/10/i386/selinux-poli
cy-3.5.13-45.fc10.noarch.rpm
Or should I use new RefPolicy from OpenSuSE -
ftp5.gwdg.de/pub/opensuse/repositories/security:/SELinux/openSUSE_Factor
y/noarch/selinux-policy-refpolicy-standard-2.20081210-1.8.noarch.rpm
Thanks in advance as usual for all your help.
-----Original Message-----
From: Dominick Grift [mailto:domg472@gmail.com]
Sent: Tuesday, October 27, 2009 3:50 AM
To: Hasan Rezaul-CHR010
Cc: selinux@tycho.nsa.gov
Subject: Re: Where do I get a good Policy Base ?...
On Mon, 2009-10-26 at 21:16 -0400, 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
>
> And I used a 'strict' Base policy from Fedora Core 6. Made the
> modifications I needed on top of that, and I was very happy...
>
>
> We get our OS packaged/delivered from a third party company, and we're
> upgrading to Linux 2.6.27, and as part of this upgrade, we are also
> migrating 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. I believe the "strict" policy is no longer supported in the above
> versions of SELinux packages? Is this true ?
the "strict" policy model is no longer supported. The strict and target
policy have merged to a policy model that is called "targeted". You can
configure the "targeted" policy to behave like old strict policy by
removing removing the unconfined modules and by mapping your Linux
logins to strict SELinux users.
>
> 2. The entire set of policies that I have fine-tuned over the years
> under my /etc/selinux/strict/modules/active/modules/*.pp directory
> in my previous older system, can I make any use of that ?? In other
> words, can that stuff be re-used at all ? Or do I need to develop
> policy from scratch again ?
I am not sure about this but my opinion is that it should in most cases
be possible to use older binary modules in newer policy. Reference
policy should be compatible in my view.
Please note though that is encouraged to keep the source policy for your
binary modules so that you can edit policy modules easily later.
>
> 3. What will be a good base policy for me to start policy development
> on ? Will it be refpolicy, or should I grab the base 'targeted' policy
> from fedora core 11 for example ?
This depends on your distro, but generally you should be better of with
a distro specific policy. Also keep in mind that Fedora has a active
community, frequent updates and many testers.
>
> 4. Assuming 'strict' is no longer supported in the NEW package
> versions above, and I use a base 'targeted' policy as my starting
> point... Should I be able to simply remove the "unconfined.pp" policy
> module from the base targeted policy, and that essentially turns my
> system into "strict-like" mode ? Is that advisable ?
That is the idea, yes,
>
> 5. If I do continue to use the 'targeted' base policy as is, how can I
> develop policy on top of that, to make sure I still block specific
> things that I don't want to take place. For example, I DON'T want a
> user_t to be able to write to files of type etc_t for example. How
> do I go about accomplishing this given the 'targeted' framework ? I
> know how to do this in the old 'strict' framework, not sure how to go
> about it with the targeted framework. Please shed some light or point
> me to documents...
You can write your own custom policy modules on that of the policy that
is distributed. Current policy is usually modular. Basically write a
source policy module, build it and install it using the semanage or the
semodule command.
e.g. (Fedora/RedHat):
echo "policy_module(mytest, 0.0.1)" > mytest.te; make -f
/usr/share/selinux/devel/Makefile mytest.pp; sudo semodule -i mytest.pp
sudo semodule -l | grep mytest
>
> Again, Any references or documentation links would be greatly
> appreciated.
www.selinuxproject.org/page/User_Resources
>
> Thanks in advance.
>
>
> --
> 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.
^ permalink raw reply [flat|nested] 34+ messages in thread
* How to use sepolgen VS. policygentool
2009-11-10 0:01 ` Hasan Rezaul-CHR010
@ 2009-12-10 2:18 ` Hasan Rezaul-CHR010
2009-12-10 2:50 ` Hasan Rezaul-CHR010
` (2 more replies)
0 siblings, 3 replies; 34+ messages in thread
From: Hasan Rezaul-CHR010 @ 2009-12-10 2:18 UTC (permalink / raw)
To: Daniel J Walsh; +Cc: selinux
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.
^ permalink raw reply [flat|nested] 34+ messages in thread* RE: How to use sepolgen VS. policygentool
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
` (2 more replies)
2009-12-10 15:54 ` Stephen Smalley
2009-12-10 19:04 ` How to use sepolgen VS. policygentool Daniel J Walsh
2 siblings, 3 replies; 34+ messages in thread
From: Hasan Rezaul-CHR010 @ 2009-12-10 2:50 UTC (permalink / raw)
To: Hasan Rezaul-CHR010, Daniel J Walsh; +Cc: selinux
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.
^ permalink raw reply [flat|nested] 34+ messages in thread* RE: How to use sepolgen VS. policygentool
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
2 siblings, 0 replies; 34+ messages in thread
From: Stephen Smalley @ 2009-12-10 16:02 UTC (permalink / raw)
To: Hasan Rezaul-CHR010; +Cc: Daniel J Walsh, selinux
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.
Same sequence of commands that are run by audit2allow or the Makefile:
checkmodule -M -m test.te -o test.mod
semodule_package -o test.pp -m test.mod
--
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.
^ permalink raw reply [flat|nested] 34+ messages in thread
* RE: How to use sepolgen VS. policygentool
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
2 siblings, 0 replies; 34+ messages in thread
From: Guido Trentalancia @ 2009-12-10 17:11 UTC (permalink / raw)
To: Hasan Rezaul-CHR010; +Cc: selinux
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.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: How to use sepolgen VS. policygentool
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
2 siblings, 0 replies; 34+ messages in thread
From: Daniel J Walsh @ 2009-12-10 19:11 UTC (permalink / raw)
To: Hasan Rezaul-CHR010; +Cc: selinux
On 12/09/2009 09:50 PM, 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.
Something like.
checkmodule -M -m mypol.te -o mypol.mod
semodule_package -m mypol.mod -f mypol.fc -o mypol.pp
--
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.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: How to use sepolgen VS. policygentool
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 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-10 19:04 ` How to use sepolgen VS. policygentool Daniel J Walsh
2 siblings, 2 replies; 34+ messages in thread
From: Stephen Smalley @ 2009-12-10 15:54 UTC (permalink / raw)
To: Hasan Rezaul-CHR010; +Cc: Daniel J Walsh, selinux, Christopher J. PeBenito
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.
--
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.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: How to use sepolgen VS. policygentool
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
1 sibling, 0 replies; 34+ messages in thread
From: Daniel J Walsh @ 2009-12-10 19:38 UTC (permalink / raw)
To: Stephen Smalley; +Cc: Hasan Rezaul-CHR010, selinux, Christopher J. PeBenito
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.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Policy writing philosophy...
2009-12-10 15:54 ` Stephen Smalley
2009-12-10 19:38 ` Daniel J Walsh
@ 2009-12-15 17:43 ` Hasan Rezaul-CHR010
2009-12-15 20:14 ` Dominick Grift
` (2 more replies)
1 sibling, 3 replies; 34+ messages in thread
From: Hasan Rezaul-CHR010 @ 2009-12-15 17:43 UTC (permalink / raw)
To: Stephen Smalley; +Cc: selinux
Hi All,
I have Linux 2.6.27 on a non-popular Linux distro, and I have the
following SELinux package versions :
> checkpolicy-2.0.19
> libselinux-2.0.85
> libsemanage-2.0.33
> libsepol-2.0.37
> policycoreutils-2.0.69
> sepolgen-1.0.17
I know SELinux's is governing framework is that by default everything is
DENIED, except all accesses that are explicitly allowed in the policy...
Is there anyway whatsoever to reverse that philosophy ? In other words,
is it possible to configure things and write policy in a way such that:
Only explicit things are disallowed... So whenever no explicit policy
exists for an access request it is actually ALLOWED. This way, if I
write a new task or process, I don't have to write new policy for it to
allow all the things it needs. By default things will just be allowed,
unless some of those accesses have been explicitly disallowed in policy
?
My guess is that this CANT be done... But thought I would ask anyway ?
Also can SELinux mappings be created for a Unix Group, as opposed to
mapping to individual Linux Users ?
Thanks.
--
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.
^ permalink raw reply [flat|nested] 34+ messages in thread* Re: Policy writing philosophy...
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
2 siblings, 0 replies; 34+ messages in thread
From: Dominick Grift @ 2009-12-15 20:14 UTC (permalink / raw)
To: selinux
[-- Attachment #1: Type: text/plain, Size: 1710 bytes --]
On Tue, Dec 15, 2009 at 12:43:37PM -0500, Hasan Rezaul-CHR010 wrote:
> Hi All,
>
> I have Linux 2.6.27 on a non-popular Linux distro, and I have the
> following SELinux package versions :
>
> > checkpolicy-2.0.19
> > libselinux-2.0.85
> > libsemanage-2.0.33
> > libsepol-2.0.37
> > policycoreutils-2.0.69
> > sepolgen-1.0.17
>
> I know SELinux's is governing framework is that by default everything is
> DENIED, except all accesses that are explicitly allowed in the policy...
>
> Is there anyway whatsoever to reverse that philosophy ? In other words,
> is it possible to configure things and write policy in a way such that:
>
> Only explicit things are disallowed... So whenever no explicit policy
> exists for an access request it is actually ALLOWED. This way, if I
> write a new task or process, I don't have to write new policy for it to
> allow all the things it needs. By default things will just be allowed,
> unless some of those accesses have been explicitly disallowed in policy
> ?
>
> My guess is that this CANT be done... But thought I would ask anyway ?
Fedoras' selinux-policy-minimal is supposed to be just that (well kind of). By default everything runs in a unconfined domain which is allowed all access. To restrict processes you should explicitly write policy.
>
> Also can SELinux mappings be created for a Unix Group, as opposed to
> mapping to individual Linux Users ?
No afaik.
>
> Thanks.
>
>
> --
> 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.
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: Policy writing philosophy...
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
2 siblings, 0 replies; 34+ messages in thread
From: Bandan Das @ 2009-12-15 20:40 UTC (permalink / raw)
To: Hasan Rezaul-CHR010; +Cc: selinux
On Tue, 2009-12-15 at 12:43 -0500, Hasan Rezaul-CHR010 wrote:
> Hi All,
>
> I have Linux 2.6.27 on a non-popular Linux distro, and I have the
> following SELinux package versions :
>
> > checkpolicy-2.0.19
> > libselinux-2.0.85
> > libsemanage-2.0.33
> > libsepol-2.0.37
> > policycoreutils-2.0.69
> > sepolgen-1.0.17
>
> I know SELinux's is governing framework is that by default everything
> is
> DENIED, except all accesses that are explicitly allowed in the
> policy...
>
> Is there anyway whatsoever to reverse that philosophy ? In other
> words,
> is it possible to configure things and write policy in a way such
> that:
>
> Only explicit things are disallowed... So whenever no explicit policy
> exists for an access request it is actually ALLOWED. This way, if I
> write a new task or process, I don't have to write new policy for it
> to
> allow all the things it needs. By default things will just be allowed,
> unless some of those accesses have been explicitly disallowed in
> policy
> ?
>
> My guess is that this CANT be done... But thought I would ask anyway ?
If you are asking whether SELinux can be used to configure a set of
"disablities" rather than "capabilites", I guess the answer would be no.
The reason is the question itself :) It's a different design
philosophy..
Bandan
> Also can SELinux mappings be created for a Unix Group, as opposed to
> mapping to individual Linux Users ?
>
> Thanks.
>
>
> --
> 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.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: Policy writing philosophy...
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
2 siblings, 1 reply; 34+ messages in thread
From: Stephen Smalley @ 2009-12-16 14:58 UTC (permalink / raw)
To: Hasan Rezaul-CHR010; +Cc: selinux
On Tue, 2009-12-15 at 12:43 -0500, Hasan Rezaul-CHR010 wrote:
> Hi All,
>
> I have Linux 2.6.27 on a non-popular Linux distro, and I have the
> following SELinux package versions :
>
> > checkpolicy-2.0.19
> > libselinux-2.0.85
> > libsemanage-2.0.33
> > libsepol-2.0.37
> > policycoreutils-2.0.69
> > sepolgen-1.0.17
>
> I know SELinux's is governing framework is that by default everything is
> DENIED, except all accesses that are explicitly allowed in the policy...
>
> Is there anyway whatsoever to reverse that philosophy ? In other words,
> is it possible to configure things and write policy in a way such that:
>
> Only explicit things are disallowed... So whenever no explicit policy
> exists for an access request it is actually ALLOWED. This way, if I
> write a new task or process, I don't have to write new policy for it to
> allow all the things it needs. By default things will just be allowed,
> unless some of those accesses have been explicitly disallowed in policy
> ?
>
> My guess is that this CANT be done... But thought I would ask anyway ?
Not from a mechanism point of view, no. But from a policy point of
view, you can achieve your end by initially declaring a domain as an
unconfined domain and then removing rules, or by declaring a domain as a
permissive domain and generating rules for it via audit2allow.
> Also can SELinux mappings be created for a Unix Group, as opposed to
> mapping to individual Linux Users ?
Yes - just use %groupname in the seusers configuration.
--
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.
^ permalink raw reply [flat|nested] 34+ messages in thread
* RE: Policy writing philosophy...
2009-12-16 14:58 ` Stephen Smalley
@ 2009-12-16 15:30 ` Hasan Rezaul-CHR010
2009-12-16 15:47 ` Stephen Smalley
0 siblings, 1 reply; 34+ messages in thread
From: Hasan Rezaul-CHR010 @ 2009-12-16 15:30 UTC (permalink / raw)
To: Stephen Smalley, Daniel J Walsh; +Cc: selinux
Thanks as always Stephen.
>> Also can SELinux mappings be created for a Unix Group, as opposed to
>> mapping to individual Linux Users ?
> Yes - just use %groupname in the seusers configuration.
Would you kindly give me some more details / examples, or point me to a
URL or document that I can learn more about how to achieve this ?
Thanks again.
Also, I have a Fedora 12 machine now. I was wondering, where can I get
all the ***.te files for the corresponding ***.pp files that exist ?
Thanks again.
-----Original Message-----
From: Stephen Smalley [mailto:sds@tycho.nsa.gov]
Sent: Wednesday, December 16, 2009 8:59 AM
To: Hasan Rezaul-CHR010
Cc: selinux@tycho.nsa.gov
Subject: Re: Policy writing philosophy...
On Tue, 2009-12-15 at 12:43 -0500, Hasan Rezaul-CHR010 wrote:
> Hi All,
>
> I have Linux 2.6.27 on a non-popular Linux distro, and I have the
> following SELinux package versions :
>
> > checkpolicy-2.0.19
> > libselinux-2.0.85
> > libsemanage-2.0.33
> > libsepol-2.0.37
> > policycoreutils-2.0.69
> > sepolgen-1.0.17
>
> I know SELinux's is governing framework is that by default everything
> is DENIED, except all accesses that are explicitly allowed in the
policy...
>
> Is there anyway whatsoever to reverse that philosophy ? In other
> words, is it possible to configure things and write policy in a way
such that:
>
> Only explicit things are disallowed... So whenever no explicit policy
> exists for an access request it is actually ALLOWED. This way, if I
> write a new task or process, I don't have to write new policy for it
> to allow all the things it needs. By default things will just be
> allowed, unless some of those accesses have been explicitly disallowed
> in policy ?
>
> My guess is that this CANT be done... But thought I would ask anyway ?
Not from a mechanism point of view, no. But from a policy point of
view, you can achieve your end by initially declaring a domain as an
unconfined domain and then removing rules, or by declaring a domain as a
permissive domain and generating rules for it via audit2allow.
> Also can SELinux mappings be created for a Unix Group, as opposed to
> mapping to individual Linux Users ?
Yes - just use %groupname in the seusers configuration.
--
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.
^ permalink raw reply [flat|nested] 34+ messages in thread
* RE: Policy writing philosophy...
2009-12-16 15:30 ` Hasan Rezaul-CHR010
@ 2009-12-16 15:47 ` Stephen Smalley
2009-12-16 15:48 ` Hasan Rezaul-CHR010
0 siblings, 1 reply; 34+ messages in thread
From: Stephen Smalley @ 2009-12-16 15:47 UTC (permalink / raw)
To: Hasan Rezaul-CHR010; +Cc: Daniel J Walsh, selinux
On Wed, 2009-12-16 at 10:30 -0500, Hasan Rezaul-CHR010 wrote:
> Thanks as always Stephen.
>
> >> Also can SELinux mappings be created for a Unix Group, as opposed to
> >> mapping to individual Linux Users ?
>
> > Yes - just use %groupname in the seusers configuration.
>
> Would you kindly give me some more details / examples, or point me to a
> URL or document that I can learn more about how to achieve this ?
> Thanks again.
groupadd research
useradd -g research johndoe
semanage login -a -s user_u %research
ssh -l johndoe localhost
id
> Also, I have a Fedora 12 machine now. I was wondering, where can I get
> all the ***.te files for the corresponding ***.pp files that exist ?
yumdownloader --source selinux-policy
rpm -ivh selinux-policy*.src.rpm
--
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.
^ permalink raw reply [flat|nested] 34+ messages in thread
* RE: Policy writing philosophy...
2009-12-16 15:47 ` Stephen Smalley
@ 2009-12-16 15:48 ` Hasan Rezaul-CHR010
0 siblings, 0 replies; 34+ messages in thread
From: Hasan Rezaul-CHR010 @ 2009-12-16 15:48 UTC (permalink / raw)
To: Stephen Smalley; +Cc: Daniel J Walsh, selinux
Excellent! Thanks Sir.
-----Original Message-----
From: Stephen Smalley [mailto:sds@tycho.nsa.gov]
Sent: Wednesday, December 16, 2009 9:48 AM
To: Hasan Rezaul-CHR010
Cc: Daniel J Walsh; selinux@tycho.nsa.gov
Subject: RE: Policy writing philosophy...
On Wed, 2009-12-16 at 10:30 -0500, Hasan Rezaul-CHR010 wrote:
> Thanks as always Stephen.
>
> >> Also can SELinux mappings be created for a Unix Group, as opposed
> >> to mapping to individual Linux Users ?
>
> > Yes - just use %groupname in the seusers configuration.
>
> Would you kindly give me some more details / examples, or point me to
> a URL or document that I can learn more about how to achieve this ?
> Thanks again.
groupadd research
useradd -g research johndoe
semanage login -a -s user_u %research
ssh -l johndoe localhost
id
> Also, I have a Fedora 12 machine now. I was wondering, where can I get
> all the ***.te files for the corresponding ***.pp files that exist ?
yumdownloader --source selinux-policy
rpm -ivh selinux-policy*.src.rpm
--
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.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: How to use sepolgen VS. policygentool
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 15:54 ` Stephen Smalley
@ 2009-12-10 19:04 ` Daniel J Walsh
2 siblings, 0 replies; 34+ messages in thread
From: Daniel J Walsh @ 2009-12-10 19:04 UTC (permalink / raw)
To: Hasan Rezaul-CHR010; +Cc: selinux
On 12/09/2009 09:18 PM, 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 ?
>
> 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 :-)
>
I think the problem here is upstream has not accepted all of the changes that have been put into Fedora.
sepolgen is part of the policycoreutils-gui package which has not gone upstream yet and should be pulled into another
package. You could grab the fedora src rpms and build them on your machine.
neverallow is not the opposite of allow. neverallow says to the compiler, blow up if a new policy tries to add this rule.
user_t is not allowed by default to write to any of those types.
Everything is denied by default.
--
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.
^ permalink raw reply [flat|nested] 34+ messages in thread
* RE: Where do I get a good Policy Base ?...
2009-10-27 8:49 ` Dominick Grift
2009-10-27 12:45 ` Christopher J. PeBenito
2009-11-10 0:01 ` Hasan Rezaul-CHR010
@ 2009-11-11 19:37 ` Hasan Rezaul-CHR010
2009-11-11 22:02 ` Daniel J Walsh
2 siblings, 1 reply; 34+ messages in thread
From: Hasan Rezaul-CHR010 @ 2009-11-11 19:37 UTC (permalink / raw)
To: Daniel J Walsh, Stephen Smalley; +Cc: selinux
Hi All,
I didn't get an answer to my question below :-(
-------------------------------
Thanks for your answers :-)
A quick follow up question...
What would be the most appropriate Fedora selinux-policy that I can
start off with as a base to build on top of, Given:
that I have Linux 2.6.27, and I have the following latest SELinux
package versions :
checkpolicy-2.0.19
libselinux-2.0.85
libsemanage-2.0.33
libsepol-2.0.37
policycoreutils-2.0.69
sepolgen-1.0.17
Should I use Fedora 11 -
download.fedora.redhat.com/pub/fedora/linux/development/i386/os/Packages
/selinux-policy-3.6.6-5.fc11.noarch.rpm
Or should I use Fedora 10 -
download.fedora.redhat.com/pub/fedora/linux/updates/10/i386/selinux-poli
cy-3.5.13-45.fc10.noarch.rpm
Or should I use new RefPolicy from OpenSuSE -
ftp5.gwdg.de/pub/opensuse/repositories/security:/SELinux/openSUSE_Factor
y/noarch/selinux-policy-refpolicy-standard-2.20081210-1.8.noarch.rpm
Thanks in advance as usual for all your help.
-----Original Message-----
From: Dominick Grift [mailto:domg472@gmail.com]
Sent: Tuesday, October 27, 2009 3:50 AM
To: Hasan Rezaul-CHR010
Cc: selinux@tycho.nsa.gov
Subject: Re: Where do I get a good Policy Base ?...
On Mon, 2009-10-26 at 21:16 -0400, 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
>
> And I used a 'strict' Base policy from Fedora Core 6. Made the
> modifications I needed on top of that, and I was very happy...
>
>
> We get our OS packaged/delivered from a third party company, and we're
> upgrading to Linux 2.6.27, and as part of this upgrade, we are also
> migrating 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. I believe the "strict" policy is no longer supported in the above
> versions of SELinux packages? Is this true ?
the "strict" policy model is no longer supported. The strict and target
policy have merged to a policy model that is called "targeted". You can
configure the "targeted" policy to behave like old strict policy by
removing removing the unconfined modules and by mapping your Linux
logins to strict SELinux users.
>
> 2. The entire set of policies that I have fine-tuned over the years
> under my /etc/selinux/strict/modules/active/modules/*.pp directory
> in my previous older system, can I make any use of that ?? In other
> words, can that stuff be re-used at all ? Or do I need to develop
> policy from scratch again ?
I am not sure about this but my opinion is that it should in most cases
be possible to use older binary modules in newer policy. Reference
policy should be compatible in my view.
Please note though that is encouraged to keep the source policy for your
binary modules so that you can edit policy modules easily later.
>
> 3. What will be a good base policy for me to start policy development
> on ? Will it be refpolicy, or should I grab the base 'targeted' policy
> from fedora core 11 for example ?
This depends on your distro, but generally you should be better of with
a distro specific policy. Also keep in mind that Fedora has a active
community, frequent updates and many testers.
>
> 4. Assuming 'strict' is no longer supported in the NEW package
> versions above, and I use a base 'targeted' policy as my starting
> point... Should I be able to simply remove the "unconfined.pp" policy
> module from the base targeted policy, and that essentially turns my
> system into "strict-like" mode ? Is that advisable ?
That is the idea, yes,
>
> 5. If I do continue to use the 'targeted' base policy as is, how can I
> develop policy on top of that, to make sure I still block specific
> things that I don't want to take place. For example, I DON'T want a
> user_t to be able to write to files of type etc_t for example. How
> do I go about accomplishing this given the 'targeted' framework ? I
> know how to do this in the old 'strict' framework, not sure how to go
> about it with the targeted framework. Please shed some light or point
> me to documents...
You can write your own custom policy modules on that of the policy that
is distributed. Current policy is usually modular. Basically write a
source policy module, build it and install it using the semanage or the
semodule command.
e.g. (Fedora/RedHat):
echo "policy_module(mytest, 0.0.1)" > mytest.te; make -f
/usr/share/selinux/devel/Makefile mytest.pp; sudo semodule -i mytest.pp
sudo semodule -l | grep mytest
>
> Again, Any references or documentation links would be greatly
> appreciated.
www.selinuxproject.org/page/User_Resources
>
> Thanks in advance.
>
>
> --
> 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.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: Where do I get a good Policy Base ?...
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
0 siblings, 1 reply; 34+ messages in thread
From: Daniel J Walsh @ 2009-11-11 22:02 UTC (permalink / raw)
To: Hasan Rezaul-CHR010; +Cc: Stephen Smalley, selinux
On 11/11/2009 02:37 PM, Hasan Rezaul-CHR010 wrote:
> Hi All,
>
> I didn't get an answer to my question below :-(
>
>
F12 policy.
> -------------------------------
>
> Thanks for your answers :-)
>
> A quick follow up question...
>
> What would be the most appropriate Fedora selinux-policy that I can
> start off with as a base to build on top of, Given:
>
> that I have Linux 2.6.27, and I have the following latest SELinux
> package versions :
>
> checkpolicy-2.0.19
> libselinux-2.0.85
> libsemanage-2.0.33
> libsepol-2.0.37
> policycoreutils-2.0.69
> sepolgen-1.0.17
>
> Should I use Fedora 11 -
> download.fedora.redhat.com/pub/fedora/linux/development/i386/os/Packages
> /selinux-policy-3.6.6-5.fc11.noarch.rpm
>
> Or should I use Fedora 10 -
> download.fedora.redhat.com/pub/fedora/linux/updates/10/i386/selinux-poli
> cy-3.5.13-45.fc10.noarch.rpm
>
> Or should I use new RefPolicy from OpenSuSE -
> ftp5.gwdg.de/pub/opensuse/repositories/security:/SELinux/openSUSE_Factor
> y/noarch/selinux-policy-refpolicy-standard-2.20081210-1.8.noarch.rpm
>
>
> Thanks in advance as usual for all your help.
>
>
>
>
> -----Original Message-----
> From: Dominick Grift [mailto:domg472@gmail.com]
> Sent: Tuesday, October 27, 2009 3:50 AM
> To: Hasan Rezaul-CHR010
> Cc: selinux@tycho.nsa.gov
> Subject: Re: Where do I get a good Policy Base ?...
>
> On Mon, 2009-10-26 at 21:16 -0400, 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
>>
>> And I used a 'strict' Base policy from Fedora Core 6. Made the
>> modifications I needed on top of that, and I was very happy...
>>
>>
>> We get our OS packaged/delivered from a third party company, and we're
>
>> upgrading to Linux 2.6.27, and as part of this upgrade, we are also
>> migrating 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. I believe the "strict" policy is no longer supported in the above
>> versions of SELinux packages? Is this true ?
>
> the "strict" policy model is no longer supported. The strict and target
> policy have merged to a policy model that is called "targeted". You can
> configure the "targeted" policy to behave like old strict policy by
> removing removing the unconfined modules and by mapping your Linux
> logins to strict SELinux users.
>
>>
>> 2. The entire set of policies that I have fine-tuned over the years
>> under my /etc/selinux/strict/modules/active/modules/*.pp directory
>> in my previous older system, can I make any use of that ?? In other
>> words, can that stuff be re-used at all ? Or do I need to develop
>> policy from scratch again ?
>
> I am not sure about this but my opinion is that it should in most cases
> be possible to use older binary modules in newer policy. Reference
> policy should be compatible in my view.
>
> Please note though that is encouraged to keep the source policy for your
> binary modules so that you can edit policy modules easily later.
>>
>> 3. What will be a good base policy for me to start policy development
>> on ? Will it be refpolicy, or should I grab the base 'targeted' policy
>
>> from fedora core 11 for example ?
>
> This depends on your distro, but generally you should be better of with
> a distro specific policy. Also keep in mind that Fedora has a active
> community, frequent updates and many testers.
>
>>
>> 4. Assuming 'strict' is no longer supported in the NEW package
>> versions above, and I use a base 'targeted' policy as my starting
>> point... Should I be able to simply remove the "unconfined.pp" policy
>> module from the base targeted policy, and that essentially turns my
>> system into "strict-like" mode ? Is that advisable ?
>
> That is the idea, yes,
>
>>
>> 5. If I do continue to use the 'targeted' base policy as is, how can I
>
>> develop policy on top of that, to make sure I still block specific
>> things that I don't want to take place. For example, I DON'T want a
>> user_t to be able to write to files of type etc_t for example. How
>> do I go about accomplishing this given the 'targeted' framework ? I
>> know how to do this in the old 'strict' framework, not sure how to go
>> about it with the targeted framework. Please shed some light or point
>> me to documents...
>
> You can write your own custom policy modules on that of the policy that
> is distributed. Current policy is usually modular. Basically write a
> source policy module, build it and install it using the semanage or the
> semodule command.
>
> e.g. (Fedora/RedHat):
>
> echo "policy_module(mytest, 0.0.1)" > mytest.te; make -f
> /usr/share/selinux/devel/Makefile mytest.pp; sudo semodule -i mytest.pp
> sudo semodule -l | grep mytest
>
>>
>> Again, Any references or documentation links would be greatly
>> appreciated.
>
> www.selinuxproject.org/page/User_Resources
>>
>> Thanks in advance.
>>
>>
>> --
>> 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.
^ permalink raw reply [flat|nested] 34+ messages in thread
* RE: Where do I get a good Policy Base ?...
2009-11-11 22:02 ` Daniel J Walsh
@ 2009-11-11 23:25 ` Hasan Rezaul-CHR010
2009-11-12 13:06 ` Daniel J Walsh
0 siblings, 1 reply; 34+ messages in thread
From: Hasan Rezaul-CHR010 @ 2009-11-11 23:25 UTC (permalink / raw)
To: Daniel J Walsh; +Cc: selinux
Thanks Dan,
I cant seem to find a good place to download the selinux-policy rpm for
Fedora 12. Can you point me to an URL link, or tell me how/where I can
obtain it ?
In general, when looking for what policy to use as a base, is it more
important to stay consistent about the Linux Kernel version, or is it
more important to make sure the versions of selinux-packages are
consistent ? I am guessing it's the latter.
Thanks.
-----Original Message-----
From: Daniel J Walsh [mailto:dwalsh@redhat.com]
Sent: Wednesday, November 11, 2009 4:02 PM
To: Hasan Rezaul-CHR010
Cc: Stephen Smalley; selinux@tycho.nsa.gov
Subject: Re: Where do I get a good Policy Base ?...
On 11/11/2009 02:37 PM, Hasan Rezaul-CHR010 wrote:
> Hi All,
>
> I didn't get an answer to my question below :-(
>
>
F12 policy.
> -------------------------------
>
> Thanks for your answers :-)
>
> A quick follow up question...
>
> What would be the most appropriate Fedora selinux-policy that I can
> start off with as a base to build on top of, Given:
>
> that I have Linux 2.6.27, and I have the following latest SELinux
> package versions :
>
> checkpolicy-2.0.19
> libselinux-2.0.85
> libsemanage-2.0.33
> libsepol-2.0.37
> policycoreutils-2.0.69
> sepolgen-1.0.17
>
> Should I use Fedora 11 -
> download.fedora.redhat.com/pub/fedora/linux/development/i386/os/Packag
> es /selinux-policy-3.6.6-5.fc11.noarch.rpm
>
> Or should I use Fedora 10 -
> download.fedora.redhat.com/pub/fedora/linux/updates/10/i386/selinux-po
> li
> cy-3.5.13-45.fc10.noarch.rpm
>
> Or should I use new RefPolicy from OpenSuSE -
> ftp5.gwdg.de/pub/opensuse/repositories/security:/SELinux/openSUSE_Fact
> or
> y/noarch/selinux-policy-refpolicy-standard-2.20081210-1.8.noarch.rpm
>
>
> Thanks in advance as usual for all your help.
>
>
>
>
> -----Original Message-----
> From: Dominick Grift [mailto:domg472@gmail.com]
> Sent: Tuesday, October 27, 2009 3:50 AM
> To: Hasan Rezaul-CHR010
> Cc: selinux@tycho.nsa.gov
> Subject: Re: Where do I get a good Policy Base ?...
>
> On Mon, 2009-10-26 at 21:16 -0400, 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
>>
>> And I used a 'strict' Base policy from Fedora Core 6. Made the
>> modifications I needed on top of that, and I was very happy...
>>
>>
>> We get our OS packaged/delivered from a third party company, and
>> we're
>
>> upgrading to Linux 2.6.27, and as part of this upgrade, we are also
>> migrating 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. I believe the "strict" policy is no longer supported in the above
>> versions of SELinux packages? Is this true ?
>
> the "strict" policy model is no longer supported. The strict and
> target policy have merged to a policy model that is called "targeted".
> You can configure the "targeted" policy to behave like old strict
> policy by removing removing the unconfined modules and by mapping your
> Linux logins to strict SELinux users.
>
>>
>> 2. The entire set of policies that I have fine-tuned over the years
>> under my /etc/selinux/strict/modules/active/modules/*.pp directory
>> in my previous older system, can I make any use of that ?? In other
>> words, can that stuff be re-used at all ? Or do I need to develop
>> policy from scratch again ?
>
> I am not sure about this but my opinion is that it should in most
> cases be possible to use older binary modules in newer policy.
> Reference policy should be compatible in my view.
>
> Please note though that is encouraged to keep the source policy for
> your binary modules so that you can edit policy modules easily later.
>>
>> 3. What will be a good base policy for me to start policy development
>> on ? Will it be refpolicy, or should I grab the base 'targeted'
>> policy
>
>> from fedora core 11 for example ?
>
> This depends on your distro, but generally you should be better of
> with a distro specific policy. Also keep in mind that Fedora has a
> active community, frequent updates and many testers.
>
>>
>> 4. Assuming 'strict' is no longer supported in the NEW package
>> versions above, and I use a base 'targeted' policy as my starting
>> point... Should I be able to simply remove the "unconfined.pp" policy
>> module from the base targeted policy, and that essentially turns my
>> system into "strict-like" mode ? Is that advisable ?
>
> That is the idea, yes,
>
>>
>> 5. If I do continue to use the 'targeted' base policy as is, how can
>> I
>
>> develop policy on top of that, to make sure I still block specific
>> things that I don't want to take place. For example, I DON'T want a
>> user_t to be able to write to files of type etc_t for example. How
>> do I go about accomplishing this given the 'targeted' framework ? I
>> know how to do this in the old 'strict' framework, not sure how to go
>> about it with the targeted framework. Please shed some light or point
>> me to documents...
>
> You can write your own custom policy modules on that of the policy
> that is distributed. Current policy is usually modular. Basically
> write a source policy module, build it and install it using the
> semanage or the semodule command.
>
> e.g. (Fedora/RedHat):
>
> echo "policy_module(mytest, 0.0.1)" > mytest.te; make -f
> /usr/share/selinux/devel/Makefile mytest.pp; sudo semodule -i
> mytest.pp sudo semodule -l | grep mytest
>
>>
>> Again, Any references or documentation links would be greatly
>> appreciated.
>
> www.selinuxproject.org/page/User_Resources
>>
>> Thanks in advance.
>>
>>
>> --
>> 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.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: Where do I get a good Policy Base ?...
2009-11-11 23:25 ` Hasan Rezaul-CHR010
@ 2009-11-12 13:06 ` Daniel J Walsh
0 siblings, 0 replies; 34+ messages in thread
From: Daniel J Walsh @ 2009-11-12 13:06 UTC (permalink / raw)
To: Hasan Rezaul-CHR010; +Cc: selinux
On 11/11/2009 06:25 PM, Hasan Rezaul-CHR010 wrote:
> Thanks Dan,
>
> I cant seem to find a good place to download the selinux-policy rpm for
> Fedora 12. Can you point me to an URL link, or tell me how/where I can
> obtain it ?
>
> In general, when looking for what policy to use as a base, is it more
> important to stay consistent about the Linux Kernel version, or is it
> more important to make sure the versions of selinux-packages are
> consistent ? I am guessing it's the latter.
>
> Thanks.
>
>
> -----Original Message-----
> From: Daniel J Walsh [mailto:dwalsh@redhat.com]
> Sent: Wednesday, November 11, 2009 4:02 PM
> To: Hasan Rezaul-CHR010
> Cc: Stephen Smalley; selinux@tycho.nsa.gov
> Subject: Re: Where do I get a good Policy Base ?...
>
> On 11/11/2009 02:37 PM, Hasan Rezaul-CHR010 wrote:
>> Hi All,
>>
>> I didn't get an answer to my question below :-(
>>
>>
> F12 policy.
>
>
>> -------------------------------
>>
>> Thanks for your answers :-)
>>
>> A quick follow up question...
>>
>> What would be the most appropriate Fedora selinux-policy that I can
>> start off with as a base to build on top of, Given:
>>
>> that I have Linux 2.6.27, and I have the following latest SELinux
>> package versions :
>>
>> checkpolicy-2.0.19
>> libselinux-2.0.85
>> libsemanage-2.0.33
>> libsepol-2.0.37
>> policycoreutils-2.0.69
>> sepolgen-1.0.17
>>
>> Should I use Fedora 11 -
>> download.fedora.redhat.com/pub/fedora/linux/development/i386/os/Packag
>> es /selinux-policy-3.6.6-5.fc11.noarch.rpm
>>
>> Or should I use Fedora 10 -
>> download.fedora.redhat.com/pub/fedora/linux/updates/10/i386/selinux-po
>> li
>> cy-3.5.13-45.fc10.noarch.rpm
>>
>> Or should I use new RefPolicy from OpenSuSE -
>> ftp5.gwdg.de/pub/opensuse/repositories/security:/SELinux/openSUSE_Fact
>> or
>> y/noarch/selinux-policy-refpolicy-standard-2.20081210-1.8.noarch.rpm
>>
>>
>> Thanks in advance as usual for all your help.
>>
>>
>>
>>
>> -----Original Message-----
>> From: Dominick Grift [mailto:domg472@gmail.com]
>> Sent: Tuesday, October 27, 2009 3:50 AM
>> To: Hasan Rezaul-CHR010
>> Cc: selinux@tycho.nsa.gov
>> Subject: Re: Where do I get a good Policy Base ?...
>>
>> On Mon, 2009-10-26 at 21:16 -0400, 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
>>>
>>> And I used a 'strict' Base policy from Fedora Core 6. Made the
>>> modifications I needed on top of that, and I was very happy...
>>>
>>>
>>> We get our OS packaged/delivered from a third party company, and
>>> we're
>>
>>> upgrading to Linux 2.6.27, and as part of this upgrade, we are also
>>> migrating 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. I believe the "strict" policy is no longer supported in the above
>>> versions of SELinux packages? Is this true ?
>>
>> the "strict" policy model is no longer supported. The strict and
>> target policy have merged to a policy model that is called "targeted".
>> You can configure the "targeted" policy to behave like old strict
>> policy by removing removing the unconfined modules and by mapping your
>
>> Linux logins to strict SELinux users.
>>
>>>
>>> 2. The entire set of policies that I have fine-tuned over the years
>>> under my /etc/selinux/strict/modules/active/modules/*.pp directory
>>> in my previous older system, can I make any use of that ?? In other
>>> words, can that stuff be re-used at all ? Or do I need to develop
>>> policy from scratch again ?
>>
>> I am not sure about this but my opinion is that it should in most
>> cases be possible to use older binary modules in newer policy.
>> Reference policy should be compatible in my view.
>>
>> Please note though that is encouraged to keep the source policy for
>> your binary modules so that you can edit policy modules easily later.
>>>
>>> 3. What will be a good base policy for me to start policy development
>
>>> on ? Will it be refpolicy, or should I grab the base 'targeted'
>>> policy
>>
>>> from fedora core 11 for example ?
>>
>> This depends on your distro, but generally you should be better of
>> with a distro specific policy. Also keep in mind that Fedora has a
>> active community, frequent updates and many testers.
>>
>>>
>>> 4. Assuming 'strict' is no longer supported in the NEW package
>>> versions above, and I use a base 'targeted' policy as my starting
>>> point... Should I be able to simply remove the "unconfined.pp" policy
>
>>> module from the base targeted policy, and that essentially turns my
>>> system into "strict-like" mode ? Is that advisable ?
>>
>> That is the idea, yes,
>>
>>>
>>> 5. If I do continue to use the 'targeted' base policy as is, how can
>>> I
>>
>>> develop policy on top of that, to make sure I still block specific
>>> things that I don't want to take place. For example, I DON'T want a
>>> user_t to be able to write to files of type etc_t for example. How
>>> do I go about accomplishing this given the 'targeted' framework ? I
>>> know how to do this in the old 'strict' framework, not sure how to go
>
>>> about it with the targeted framework. Please shed some light or point
>
>>> me to documents...
>>
>> You can write your own custom policy modules on that of the policy
>> that is distributed. Current policy is usually modular. Basically
>> write a source policy module, build it and install it using the
>> semanage or the semodule command.
>>
>> e.g. (Fedora/RedHat):
>>
>> echo "policy_module(mytest, 0.0.1)" > mytest.te; make -f
>> /usr/share/selinux/devel/Makefile mytest.pp; sudo semodule -i
>> mytest.pp sudo semodule -l | grep mytest
>>
>>>
>>> Again, Any references or documentation links would be greatly
>>> appreciated.
>>
>> www.selinuxproject.org/page/User_Resources
>>>
>>> Thanks in advance.
>>>
>>>
>>> --
>>> 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.
>>
>>
>
Latest F12 packages are in koji, here is a link:
http://koji.fedoraproject.org/koji/buildinfo?buildID=140508
The Fedora Kernel can handle multiple different policies, so I am not sure I understand the question.
--
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.
^ permalink raw reply [flat|nested] 34+ messages in thread