Q on the Constrain verb
I'm writing up a .te file for the Tripwire suite. I'd like the policy to distinguish between staff_r and sysadm_r, in that sysadm_r is given unrestricted access to create/modify the Tripwire policy, database, and local/site keys. Staff_r (and initrc_t) are given read-only access to these files, so that automated nightly and/or staff security checks are not allowed to potentially alter the Tripwire database/policy.
I would like to use the constrain verb in my .te file to distinguish sysadm_r from all others, but when I do a "make reload" I get a syntax error on the constrain statement. I've even gone so far as to quote the third example constrain statement (pg. 20, Sec. 4.5 of "Configuring the SELinux Policy") verbatim in my .te file, but it, too, generates a syntax error.
So, if I have (for example) an allow statement of the form:
allow tripwire_t tripwire_cfg_t:file { create write read getattr };
How do I correctly syntax a constrain statement that will restrict the write & create permissions when the role is not sysadm_r? And how do you connect a given constraint statement with a given target context? For example, supposing that I have:
allow tripwire_t tripwire_cfg_t:file { create write read getattr }; allow tripwire_t tripwire_key_t:file { create write read getattr }; allow tripwire_t tripwire_report_t:file { create write read getattr };
How do I syntax the constraint so that it constrains the cfg and key types but not the report type? That linkage is not apparent in the documentation.
Thanks in advance.
--
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 7 lines · Bill Laut
I'm writing up a .te file for the Tripwire suite. I'd like the policy to distinguish between
staff_randsysadm_r, in thatsysadm_ris given unrestricted access to create/modify the Tripwire policy, database, and local/site keys.Staff_r(andinitrc_t) are given read-only access to these files, so that automated nightly and/or staff security checks are not allowed to potentially alter the Tripwire database/policy.
Quoted 5 lines
I would like to use the constrain verb in my .te file to distinguish
sysadm_rfrom all others, but when I do a "make reload" I get a syntax error on the constrain statement. I've even gone so far as to quote the third example constrain statement (pg. 20, Sec. 4.5 of "Configuring the SELinux Policy") verbatim in my .te file, but it, too, generates a syntax error.
Constraints are separate from the TE configuration, and are placed in the policy/constraints file. In any event, I think you are using the wrong mechanism for what you are trying to achieve. If you want to grant different permissions for sysadm_r vs. staff_r, then do so by granting different permissions to sysadm_t vs. staff_t, e.g. staff_t is only given read permission to the tripwire types, and cannot perform a domain transition to any of the domains that can write to the tripwire types. You can also limit all domains that can write to the tripwire types to the sysadm_r role.
Signature · 8 lines
Stephen Smalley <[email protected]> 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.