Turn off "dontaudit" rules in monolithic policy
I have a custom monolithic build based on RHEL6 policy. I get this error when try to turn off dontaudit rules:
$ semodule -DB
libsemanage.semanage_link_sandbox: Could not access sandbox base file /etc/selinux/targeted/modules/bmp/base.pp. (No such file or directory)
Is there other way to turn off dontaudit rules in a monilithic policy?
Many thanks,
--Hung Truong
ERROR 'type staff_java_t is not within scope' at token
I have this rule in my policy:
gen_require(`
type staff_java_t;
type cdvoip_sysadmcat_pki_cdvaserver_pem_t;')
allow staff_java_t cdvoip_sysadmcat_pki_cdvaserver_pem_t: file { read open };
and get error 'type staff_java_t is not within scope' when compile it.
policy/modules/cdvoip/cdvoip_sysadmcat.te":306:ERROR 'type staff_java_t is not within scope' at token ';' on line 1684769:
/usr/bin/checkpolicy: loading policy configuration from policy.conf
allow staff_java_t cdvoip_sysadmcat_pki_cdvaserver_pem_t: file { read open };
checkpolicy: error(s) encountered while parsing configuration
make: *** [/home/cdvadmin/workspace/cdvoip/rpms/BUILDROOT/selinux-policy-3.7.19-155el6.4.x86_64/etc/selinux/targeted/policy/policy.24] Error 1
Does anyone know why I get this error and how to fix it? BTW, if it does matter, I modified the *.spec file to build a monolithic and strict policy.
Many thanks,
Hung Truong
Re: ERROR 'type staff_java_t is not within scope' at token
In reply to Dominick GriftQuoted 10 lines · Dominick Grift
Quoted 3 lines
Does anyone know why I get this error and how to fix it? BTW, if it does matter, I modified the *.spec file to build a monolithic and strict policy.
I think this policy needs to be nested properly
Its a dependency thing
so for example:
Quoted 9 lines
optional_policy(`
java_per_role_template(staff, staff_r, staff_t)optional_policy(`
allowstaff_java_tcdvoip_sysadmcat_pki_cdvaserver_pem_t: fileread_file_perms;
')
')
Actually the whole concept of optional policy should does not apply to monolitic policy but i guess the compiler still wants it somehow
--
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: ERROR 'type staff_java_t is not within scope' at token
In reply to Hung TruongQuoted 45 lines · Hung Truong
I have this rule in my policy:
gen_require(`
type staff_java_t; type cdvoip_sysadmcat_pki_cdvaserver_pem_t;')
allow
staff_java_tcdvoip_sysadmcat_pki_cdvaserver_pem_t: file { read open };and get error 'type
staff_java_tis not within scope' when compile it.policy/modules/cdvoip/cdvoip_sysadmcat.te":306:ERROR 'type
staff_java_tis not within scope' at token ';' on line 1684769:
/usr/bin/checkpolicy: loading policy configuration from policy.confallow
staff_java_tcdvoip_sysadmcat_pki_cdvaserver_pem_t: file { read open };checkpolicy: error(s) encountered while parsing configuration
make: *** [
/home/cdvadmin/workspace/cdvoip/rpms/BUILDROOT/selinux-policy-3.7.19-155el6.4.x86_64/etc/selinux/targeted/policy/policy.24] Error 1
Quoted 3 lines
Does anyone know why I get this error and how to fix it? BTW, if it does matter, I modified the *.spec file to build a monolithic and strict policy.
I think this policy needs to be nested properly
Its a dependency thing
so for example:
optional_policy(`
java_per_role_template(staff, staff_r, staff_t)
optional_policy(`
allow staff_java_t cdvoip_sysadmcat_pki_cdvaserver_pem_t: fileread_file_perms;
')
')
This is just a quick example, it is missing requires and it might have errors.
The point is that this is about dependencies and proper nesting. This can get very complicated depending on the complexity of the policy.
The issue is that the type you are using (staff_java_t) depends on the java_per_role_template so it needs to be nested in that call else it is out of scope.
Welcome to the wonderful world of optional policy and role prefixed domains
Quoted 55 lines
Many thanks,
Hung Truong
I have this rule in my policy:gen_require(`
type staff_java_t; type cdvoip_sysadmcat_pki_cdvaserver_pem_t;')
allow
staff_java_tcdvoip_sysadmcat_pki_cdvaserver_pem_t: file { read open };and get error 'type
staff_java_tis not within scope' when compile it.policy/modules/cdvoip/cdvoip_sysadmcat.te":306:ERROR 'type
staff_java_tis not within scope' at token ';' on line 1684769:
/usr/bin/checkpolicy: loading policy configuration from policy.confallow
staff_java_tcdvoip_sysadmcat_pki_cdvaserver_pem_t: file { read open };checkpolicy: error(s) encountered while parsing configuration
make: *** [
/home/cdvadmin/workspace/cdvoip/rpms/BUILDROOT/selinux-policy-3.7.19-155el6.4.x86_64/etc/selinux/targeted/policy/policy.24] Error 1Does anyone know why I get this error and how to fix it? BTW, if it does matter, I modified the *.spec file to build a monolithic and strict policy.
Quoted 7 lines
Many thanks,
Hung Truong
--
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: ERROR 'type staff_java_t is not within scope' at token
In reply to Hung TruongQuoted 1 line · Hung Truong
I have this rule in my policy:
snip
Quoted 5 lines
Does anyone know why I get this error and how to fix it? BTW, if it does matter, I modified the *.spec file to build a monolithic and strict policy.
By the way , questions with regard to policy should go to [email protected] maillist instead
--
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.
Hung,
I have been trying to rebuild monolithic policy and was not able to. What version of SELinux Policy and RHT are you using?
________________________________
From: [email protected] [mailto:[email protected]] On Behalf Of Hung Truong
Sent: Monday, January 21, 2013 11:25 AM
To: SELinux
Subject: Turn off "dontaudit" rules in monolithic policy
I have a custom monolithic build based on RHEL6 policy. I get this error when try to turn off dontaudit rules:
$ semodule -DB
libsemanage.semanage_link_sandbox: Could not access sandbox base file /etc/selinux/targeted/modules/bmp/base.pp. (No such file or directory)
Is there other way to turn off dontaudit rules in a monilithic policy?
Many thanks,
--Hung Truong
I am using version 3.7.19-155el6.6.
*From:* Vu, Joseph [mailto:[email protected]] *Sent:* Tuesday, January 22, 2013 9:19 AM
*To:* Hung Truong; SELinux
*Subject:* RE: Turn off "dontaudit" rules in monolithic policy
Hung,
I have been trying to rebuild monolithic policy and was not able to.
What version of SELinux Policy and RHT are you using?
------------------------------
*From:* [email protected] [mailto:[email protected]<[email protected]>] *On Behalf Of *Hung Truong
*Sent:* Monday, January 21, 2013 11:25 AM
*To:* SELinux
*Subject:* Turn off "dontaudit" rules in monolithic policy
I have a custom monolithic build based on RHEL6 policy. I get this error when try to turn off dontaudit rules:
$ semodule -DB
libsemanage.semanage_link_sandbox: Could not access sandbox base file /etc/selinux/targeted/modules/bmp/base.pp. (No such file or directory)
Is there other way to turn off dontaudit rules in a monilithic policy?
Many thanks,
--Hung Truong
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 39 lines · Hung Truong
I am using version 3.7.19-155el6.6.
*From:*Vu, Joseph [mailto:[email protected] <mailto:[email protected]>] *Sent:* Tuesday, January 22, 2013 9:19 AM *To:* Hung Truong; SELinux *Subject:* RE: Turn off "dontaudit" rules in monolithic policy
Hung,
I have been trying to rebuild monolithic policy and was not able to.
What version of SELinux Policy and RHT are you using?
--------------------------------------------------------------------------------
*From:*[email protected] <mailto:[email protected]>
[mailto:[email protected]] *On Behalf Of *Hung Truong *Sent:* Monday, January 21, 2013 11:25 AM *To:* SELinux *Subject:* Turn off "dontaudit" rules in monolithic policyI have a custom monolithic build based on RHEL6 policy. I get this error when try to turn off dontaudit rules:
$ semodule -DBlibsemanage.semanage_link_sandbox: Could not access sandbox base file
/etc/selinux/targeted/modules/bmp/base.pp. (No such file or directory)
Quoted 8 lines
Is there other way to turn off dontaudit rules in a monilithic policy?
Many thanks,
--Hung Truong
Why not compile two policies one with and one without dontaudit rules? -----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.13 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iEYEARECAAYFAlD+rAEACgkQrlYvE4MpobMNDgCfaLNiljkPI6ilm65DgUSBCHmP W10An1cOKmfs7qCG8xEKaEwjVguLMLZU
=MkCV
-----END PGP SIGNATURE-----
--
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.
Could you tell me how to compile a policy without dontaudit rules? Thanks.
Hung Truong | Trident Systems Incorporated
Sr. Embedded Engineer, Software System Engineering Group 10201 Fairfax Boulevard | Suite 300 | Fairfax, VA 22030
d: 703.267.6746 | f: 703.273.6608
e: [email protected] | www.tridsys.com
Notice: The information contained in this email message is considered confidential and proprietary to the sender and is intended solely for review and use by the named recipient. Any unauthorized review, use or distribution is strictly prohibited. If you have received this message in error, please advise the sender by reply email and delete the message.
-----Original Message-----
From: Daniel J Walsh [mailto:[email protected]]
Sent: Tuesday, January 22, 2013 10:11 AM
To: Hung Truong
Cc: Vu, Joseph; SELinux
Subject: Re: Turn off "dontaudit" rules in monolithic policy
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 42 lines · Hung Truong
I am using version 3.7.19-155el6.6.
*From:*Vu, Joseph [mailto:[email protected] <mailto:[email protected]>] *Sent:* Tuesday, January 22, 2013 9:19 AM
*To:* Hung Truong; SELinux *Subject:* RE: Turn off "dontaudit" rules in monolithic policyHung,
I have been trying to rebuild monolithic policy and was not able to.
What version of SELinux Policy and RHT are you using?
----------------------------------------------------------------------
----------*From:*[email protected]
<mailto:[email protected]> [mailto:[email protected]] *On Behalf Of *Hung Truong *Sent:* Monday, January 21, 2013 11:25 AM *To:* SELinux *Subject:* Turn off "dontaudit" rules in monolithic policyI have a custom monolithic build based on RHEL6 policy. I get this error when try to turn off dontaudit rules:
$ semodule -DBlibsemanage.semanage_link_sandbox: Could not access sandbox base file
/etc/selinux/targeted/modules/bmp/base.pp. (No such file or directory)
Quoted 8 lines
Is there other way to turn off dontaudit rules in a monilithic policy?
Many thanks,
--Hung Truong
Why not compile two policies one with and one without dontaudit rules? -----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.13 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iEYEARECAAYFAlD+rAEACgkQrlYvE4MpobMNDgCfaLNiljkPI6ilm65DgUSBCHmP W10An1cOKmfs7qCG8xEKaEwjVguLMLZU
=MkCV
-----END PGP SIGNATURE-----
--
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.
This works!!! BTW, there was a typo. The command should be:
make enableaudit
I really appreciate your help.
Hung Truong | Trident Systems Incorporated
Sr. Embedded Engineer, Software System Engineering Group 10201 Fairfax Boulevard | Suite 300 | Fairfax, VA 22030
d: 703.267.6746 | f: 703.273.6608
e: [email protected] | www.tridsys.com
Notice: The information contained in this email message is considered confidential and proprietary to the sender and is intended solely for review and use by the named recipient. Any unauthorized review, use or distribution is strictly prohibited. If you have received this message in error, please advise the sender by reply email and delete the message.
-----Original Message-----
From: Daniel J Walsh [mailto:[email protected]]
Sent: Tuesday, January 22, 2013 10:23 AM
To: Hung Truong
Subject: Re: Turn off "dontaudit" rules in monolithic policy
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 3 lines · Hung Truong
Could you tell me how to compile a policy without dontaudit rules? Thanks.
make enabelaudit
I believe.
Quoted 76 lines
Hung Truong | Trident Systems Incorporated Sr. Embedded Engineer, Software System Engineering Group 10201 Fairfax Boulevard | Suite 300 | Fairfax, VA
22030 d: 703.267.6746 | f: 703.273.6608 e: [email protected] | www.tridsys.comNotice: The information contained in this email message is considered confidential and proprietary to the sender and is intended solely for review and use by the named recipient. Any unauthorized review, use or distribution is strictly prohibited. If you have received this message in error, please advise the sender by reply email and delete the message.
-----Original Message----- From: Daniel J Walsh [mailto:[email protected]]
Sent: Tuesday, January 22, 2013 10:11 AM To: Hung Truong Cc: Vu, Joseph; SELinux Subject: Re: Turn off "dontaudit" rules in monolithic policyQuoted 49 lines · Hung Truong
I am using version 3.7.19-155el6.6.
*From:*Vu, Joseph [mailto:[email protected] <mailto:[email protected]>] *Sent:* Tuesday, January 22, 2013 9:19 AM
*To:* Hung Truong; SELinux *Subject:* RE: Turn off "dontaudit" rules in monolithic policyHung,
I have been trying to rebuild monolithic policy and was not able to.
What version of SELinux Policy and RHT are you using?
---------------------------------------------------------------------
-
----------*From:*[email protected] <mailto:[email protected]> [mailto:[email protected]] *On Behalf Of *Hung Truong *Sent:* Monday, January 21, 2013 11:25 AM *To:* SELinux *Subject:* Turn off "dontaudit" rules in monolithic policy
I have a custom monolithic build based on RHEL6 policy. I get this error when try to turn off dontaudit rules:
$ semodule -DBlibsemanage.semanage_link_sandbox: Could not access sandbox base file
/etc/selinux/targeted/modules/bmp/base.pp. (No such file or directory)Is there other way to turn off dontaudit rules in a monilithic policy?
Many thanks,
Quoted 10 lines
Quoted 1 line
--Hung Truong
Why not compile two policies one with and one without dontaudit rules?
-- 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.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.13 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iEYEARECAAYFAlD+ruEACgkQrlYvE4MpobPNkACggndNE6JYVYFJIWRJ4UAjHEIw WnQAn1iAHwPv3UtoiTt3MOSYOgnLtGOv
=/+7i
-----END PGP SIGNATURE-----
--
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.
To clarify terminology, if you're using semodule, you're using a modular policy, not a monolithic policy. A monolithic policy would be fully compiled on the development machine, and the policy.27 would be deployed to the running machine. A modular policy deploys the *.pp files to the running machine and links them together to make a policy.27.
Quoted 16 lines · Hung Truong
I have a custom monolithic build based on RHEL6 policy. I get this error when try to turn off dontaudit rules:
$ semodule -DBlibsemanage.semanage_link_sandbox: Could not access sandbox base file
/etc/selinux/targeted/modules/bmp/base.pp. (No such file or directory)Is there other way to turn off dontaudit rules in a monilithic policy?
Many thanks,
--Hung Truong
Signature · 8 lines
Chris PeBenito Tresys Technology, LLC www.tresys.com | oss.tresys.com -- 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 clarification. I thought the "semodule -DB" could be used for monolithic policy as well.
Daniel Walsh gave a solution by compiling a policy without dontaudit rules and that worked perfectly fine for me. But, just curious if there is an equivalent command to turn off dontaudit for monolithic policy at runtime?
--Hung Truong
-----Original Message-----
From: Christopher J. PeBenito [mailto:[email protected]]
Sent: Tuesday, January 22, 2013 1:03 PM
To: Hung Truong
Cc: SELinux
Subject: Re: Turn off "dontaudit" rules in monolithic policy
To clarify terminology, if you're using semodule, you're using a modular policy, not a monolithic policy. A monolithic policy would be fully compiled on the development machine, and the policy.27 would be deployed to the running machine. A modular policy deploys the *.pp files to the running machine and links them together to make a policy.27.
Quoted 7 lines · Hung Truong
I have a custom monolithic build based on RHEL6 policy. I get this error when try to turn off dontaudit rules:
$ semodule -DBlibsemanage.semanage_link_sandbox: Could not access sandbox base file
/etc/selinux/targeted/modules/bmp/base.pp. (No such file or directory)
Quoted 9 lines
Is there other way to turn off dontaudit rules in a monilithic policy?
Many thanks,
--Hung Truong
Signature · 8 lines
Chris PeBenito Tresys Technology, LLC www.tresys.com | oss.tresys.com -- 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.
No, a monolithic policy can't be managed like that at run time. The policy is supposed to be static. You'd have to use make enableaudit when you build it, as Dan previously mentioned, and redeploy the policy.
Quoted 44 lines · Hung Truong
Thanks for the clarification. I thought the "semodule -DB" could be used for monolithic policy as well.
Daniel Walsh gave a solution by compiling a policy without dontaudit rules and that worked perfectly fine for me. But, just curious if there is an equivalent command to turn off dontaudit for monolithic policy at runtime?
--Hung Truong
-----Original Message-----
From: Christopher J. PeBenito [mailto:[email protected]]
Sent: Tuesday, January 22, 2013 1:03 PM
To: Hung Truong
Cc: SELinux
Subject: Re: Turn off "dontaudit" rules in monolithic policyTo clarify terminology, if you're using semodule, you're using a modular policy, not a monolithic policy. A monolithic policy would be fully compiled on the development machine, and the policy.27 would be deployed to the running machine. A modular policy deploys the *.pp files to the running machine and links them together to make a policy.27.
Quoted 7 lines · Hung Truong
I have a custom monolithic build based on RHEL6 policy. I get this error when try to turn off dontaudit rules:
$ semodule -DBlibsemanage.semanage_link_sandbox: Could not access sandbox base file
/etc/selinux/targeted/modules/bmp/base.pp. (No such file or directory)Quoted 9 lines
Is there other way to turn off dontaudit rules in a monilithic policy?
Many thanks,
--Hung Truong
Signature · 8 lines
Chris PeBenito Tresys Technology, LLC www.tresys.com | oss.tresys.com -- 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.