Error in installing RefPolicy possibly some conflict?
Hi Every one,
I am getting the following error message, while trying to install Refpolicy. If some one can help me, prior to this, i installed refpolicy, but at startup, the system hanged. The output is trancated, and only the final part, which creates the problem is copied here for reference purposes.
Thanks
JG
install -m 644 tmp/system.users /etc/selinux/refpolicy/users/system.users Validating refpolicy file_contexts. /sbin/setfiles -q -c /etc/selinux/refpolicy/policy/policy.21 file_contexts libsepol.context_from_record: type unconfined_execmem_exec_t is not defined libsepol.context_from_record: could not create context structure
libsepol.context_from_string: could not create context structure
libsepol.sepol_context_to_sid: could not convert system_u:object_r:unconfined_execmem_exec_t to sidfile_contexts: line 1170 has invalid context system_u:object_r:unconfined_execmem_exec_t
make: *** [/etc/selinux/refpolicy/contexts/files/file_contexts] Error 1
___________________________________________________________
New Yahoo! Mail is the ultimate force in competitive emailing. Find out more at the Yahoo! Mail Championships. Plus: play games and win prizes.
http://uk.rd.yahoo.com/evt=44106/*http://mail.yahoo.net/uk
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 8 lines · JanuGerman
Hi Every one,
I am getting the following error message, while trying to install Refpolicy. If some one can help me, prior to this, i installed refpolicy, but at startup, the system hanged. The output is trancated, and only the final part, which creates the problem is copied here for reference purposes.
What distribution are you using as your base? The distributions that have SELinux support (Debian, Fedora, Gentoo, RHEL) already include reference policy, so you don't need to rebuild it from scratch unless you are making major changes.
Did you just use the defaults for policy/modules.conf (i.e. generated via make conf) and for build.conf settings? In the latter case, you need to set the build.conf settings appropriately whether by editing that file or by specifying new values on the make command line.
Signature · 8 lines
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 [email protected] with the words "unsubscribe selinux" without quotes as the message.
Thanks for the reply.
I am using Fedora core 6. Prior to installing refpolicy, there was no source code avialable in the /etc/selinux/... for SELinux policy, making it hard for me to experiment with refpolicy modules.
Therefore, i installed, refpolicy sources and tried to follow the way, given on the teresys website for making and installing a refpolicy module.
While doing so, i installed alot of other softwares, like APOL, seedit in the hope to get refpolicy running.
If you can kindly give me an exmaple, for running refpolicy with default fedora core 6 distribution.
Thanks.
MA
Quoted 23 lines · --- Stephen Smalley
Quoted 3 lines · JanuGerman
Hi Every one,
I am getting the following error message, while
trying
Quoted 1 line
to install Refpolicy. If some one can help me,
prior
Quoted 1 line
to this, i installed refpolicy, but at startup,
the
Quoted 1 line
system hanged. The output is trancated, and only
the
Quoted 1 line
final part, which creates the problem is copied
here
Quoted 1 line
for reference purposes.
What distribution are you using as your base? The distributions that
have SELinux support (Debian, Fedora, Gentoo, RHEL) already include
reference policy, so you don't need to rebuild it from scratch unless
you are making major changes.
Quoted 14 lines
Did you just use the defaults for
policy/modules.conf(i.e. generated
via make conf) and for build.conf settings? In the latter case, you
need to set the build.conf settings appropriately whether by editing
that file or by specifying new values on the make command line.Signature · 2 lines
Stephen Smalley National Security Agency
___________________________________________________________
New Yahoo! Mail is the ultimate force in competitive emailing. Find out more at the Yahoo! Mail Championships. Plus: play games and win prizes.
http://uk.rd.yahoo.com/evt=44106/*http://mail.yahoo.net/uk
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 6 lines · JanuGerman
Thanks for the reply.
I am using Fedora core 6. Prior to installing refpolicy, there was no source code avialable in the
/etc/selinux/... for SELinux policy, making it hard for me to experiment with refpolicy modules.
Yes, as I think I already explained (and as is discussed in the Fedora SELinux wiki pages, http://fedoraproject.org/wiki/SELinux/, and FAQ,
http://docs.fedoraproject.org/selinux-faq-fc5/), Fedora Core 5 and later use reference policy and loadable policy modules, eliminating the need for the base policy sources to perform local customizations.
But this doesn't prevent you from creating your own modules. yum install selinux-policy-devel and follow the instructions in the FAQ.
If you do need the full policy sources, you can grab the .src.rpm like you would for any other package. No different than any other Fedora package.
You can build an upstream tarball from oss.tresys.com, but if you follow that route, you need to know what you are doing.
Please read the available resources before asking questions.
Fedora-specific questions can be posted to [email protected] after subscribing there.
Signature · 8 lines
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 [email protected] with the words "unsubscribe selinux" without quotes as the message.
Conditional Policy using Reference Policy
In reply to JanuGermanHi every one,
I am trying to configure SELinux conditional policy using the Reference policy mechanism. Unfortunately, it does not take effect but, the module compiled successfuly. Which means that there was no boolean variable in the /selinux/booleans/. Plus, i wanted to ask, is this the correct way to enforce a conditional policy. The objective of this simple policy is that "any application can read/write but cannot delete this file, provided the boolean variable is set"
Secondly, there are some commands given in the litrature for committing the values of the booleans to make them effective like change_bool variable 1, and echo 1 > /selinux/commit_pending_bools. The question is that whether these commands are not avialable any more?
The module files are as follows:
Thanks,
JG
myapp.te:
policy_module(myapp,1.0)
type myapp_t;domain_type(myapp_t)
myapp.if:
interface(myapp_open_cond',
gen_requires(`
type myapp_t; bool test;
')
if (test) {
allow $1 myapp_t:file rw_file_perms;
}')
myapp.fc:
/root/testfile -- gen_context(system_u:object_r:myapp_t,s0)
___________________________________________________________
The all-new Yahoo! Mail goes wherever you go - free your email address from your Internet provider. http://uk.docs.yahoo.com/nowyoucan.html
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Re: Conditional Policy using Reference Policy
Quoted 23 lines · JanuGerman
Hi every one,
I am trying to configure SELinux conditional policy using the Reference policy mechanism. Unfortunately, it does not take effect but, the module compiled successfuly. Which means that there was no boolean variable in the /selinux/booleans/. Plus, i wanted to ask, is this the correct way to enforce a conditional policy. The objective of this simple policy is that "any application can read/write but cannot delete this file, provided the boolean variable is set"
Secondly, there are some commands given in the litrature for committing the values of the booleans to make them effective like
change_boolvariable 1, and echo 1 > /selinux/commit_pending_bools. The question is that whether these commands are not avialable any more?The module files are as follows:
Thanks,
JG
Quoted 5 lines
myapp.te:
policy_module(myapp,1.0)
typemyapp_t;domain_type(myapp_t)
Your .te file only defines a type and declares it to be a domain type. It doesn't define the boolean, nor does it define any allow rules for the type you have defined.
Quoted 11 lines
myapp.if:
interface(myapp_open_cond',gen_requires(` type myapp_t; bool test; ') if (test) { allow $1 myapp_t:file rw_file_perms; }')
The optional .if (interface) file is to define interfaces provided by your module for other modules to call. But as no other module calls this interface, it is never used. I think you instead wanted to declare the boolean (not in a requires block, but as a definition with a default value) and put the conditional allow rule into your .te file. You don't need an .if file unless your module needs to be called by other modules.
Quoted 3 lines
myapp.fc:
/root/testfile--gen_context(system_u:object_r:myapp_t,s0)
This doesn't make sense because myapp_t was defined as a domain type, i.e. a type for a process, not a file. I'd suggest doing some more reading of the online documentation for refpolicy and looking at existing .te files as examples, and possibly using SLIDE
(http://oss.tresys.com/projects/slide) to help you create your module. There is also a book, SELinux by Example, that you may find helpful.
Signature · 8 lines
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 [email protected] with the words "unsubscribe selinux" without quotes as the message.
Re: Conditional Policy using Reference Policy
In reply to JanuGermanQuoted 4 lines · JanuGerman
I am trying to configure SELinux conditional policy using the Reference policy mechanism. Unfortunately, it does not take effect but, the module compiled successfuly.
You haven't declared the boolean. Also, the policy is in an interface, so if nothing calls it, then you won't get a compile failure if the Boolean does not exist.
Quoted 6 lines
Which means that there was no boolean variable in the /selinux/booleans/. Plus, i wanted to ask, is this the correct way to enforce a conditional policy. The objective of this simple policy is that "any application can read/write but cannot delete this file, provided the boolean variable is set"
With the current policy it means that any domain that calls this interface will be able to read and write the file if the Boolean is true.
Quoted 6 lines
Secondly, there are some commands given in the litrature for committing the values of the booleans to make them effective like
change_boolvariable 1, and echo 1 > /selinux/commit_pending_bools. The question is that whether these commands are not avialable any more?
change_bool and show_bool were renamed to setsebool and getsebool, respectively. You can still echo 0 and 1 to the entries in /selinux/booleans/* and /selinux/commit_pending_bools.
Quoted 5 lines
myapp.te:
policy_module(myapp,1.0)
typemyapp_t;domain_type(myapp_t)
Since you are trying to make a type for a file, you would want file_type() instead of domain_type().
Quoted 4 lines
myapp.if:
interface(myapp_open_cond',
gen_requires(`
This should be gen_require (no s at the end).
Quoted 12 lines
type myapp_t; bool test; ') if (test) { allow $1 myapp_t:file rw_file_perms; }')
myapp.fc:
/root/testfile--gen_context(system_u:object_r:myapp_t,s0)
Signature · 9 lines
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 [email protected] with the words "unsubscribe selinux" without quotes as the message.
Re: Conditional Policy using Reference Policy
Thanks.
Quoted 3 lines
Since you are trying to make a type for a file, you would want
file_type()instead ofdomain_type().
file_type is not working and giving the following
error message:
myapp.te:6:ERROR 'syntax error' at token 'file_type' on line 77316:file_type(testfile_t);
I removed this statement, and compiled the module successfuly and now the boolean variable appears in the /selinux/booleans/.
"cat" command shows that the value of the boolean variable is "0 0", but still any applicaiton/binary e.g. "vi" can access it, although the boolean variable is false. I was not able to solve this, does this means that the default context set for the file and for the binaries/applications take precedence?
I have already set the context of the file in the
myapp.fc
Best,
JG
___________________________________________________________
The all-new Yahoo! Mail goes wherever you go - free your email address from your Internet provider. http://uk.docs.yahoo.com/nowyoucan.html
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.