|
| 1 | +########################################## |
| 2 | +# |
| 3 | +# Policy for testing attribute assignment to attributes |
| 4 | +# |
| 5 | + |
| 6 | +# 4 attributtes linked in a typeattribute sequence d->c->b->a |
| 7 | +attribute test_attribute_a; |
| 8 | +attribute test_attribute_b; |
| 9 | +attribute test_attribute_c; |
| 10 | +attribute test_attribute_d; |
| 11 | + |
| 12 | +typeattribute test_attribute_b test_attribute_a; |
| 13 | +typeattribute test_attribute_c test_attribute_b; |
| 14 | +typeattribute test_attribute_d test_attribute_c; |
| 15 | + |
| 16 | +# 2 types assigned to attributes b and d |
| 17 | +type test_attribute_setpgid_yes_t; |
| 18 | +type test_attribute_setpgid_no_t; |
| 19 | + |
| 20 | +typeattribute test_attribute_setpgid_no_t test_attribute_b; |
| 21 | +typeattribute test_attribute_setpgid_yes_t test_attribute_d; |
| 22 | + |
| 23 | +# Attribute "a" is made into a minimal domain type |
| 24 | +testsuite_domain_type_minimal(test_attribute_a) |
| 25 | +# Attribute "c" and types assigned to it can change its pgid |
| 26 | +testsuite_domain_type(test_attribute_c) |
| 27 | + |
| 28 | +# Allow each attribute some access so that they don't get optimized out |
| 29 | +allow test_attribute_a test_attribute_a:dir getattr; |
| 30 | +allow test_attribute_b test_attribute_b:dir getattr; |
| 31 | +allow test_attribute_c test_attribute_c:dir getattr; |
| 32 | +allow test_attribute_d test_attribute_d:dir getattr; |
| 33 | + |
| 34 | +########################################## |
| 35 | +# |
| 36 | +# repeats entrypoint test, only with attributes as proxies for every type |
| 37 | +# |
| 38 | + |
| 39 | +# Type that the test domain can be entered through |
| 40 | +attribute test_attribute_entrypoint; |
| 41 | +files_type(test_attribute_entrypoint) |
| 42 | + |
| 43 | +# Type that the test domain can NOT be entered through |
| 44 | +attribute test_attribute_entrypoint_deny; |
| 45 | +files_type(test_attribute_entrypoint_deny) |
| 46 | + |
| 47 | +# Test domain that can only be entered via test_attribute_entrypoint |
| 48 | +attribute test_attribute_domain; |
| 49 | +testsuite_domain_type(test_attribute_domain) |
| 50 | + |
| 51 | +# Allow test_attribute_domain to be entered via test_attribute_entrypoint. |
| 52 | +domain_entry_file(test_attribute_domain, test_attribute_entrypoint) |
| 53 | + |
| 54 | +# Allow test_attribute_domain to execute test_attribute_entrypoint_deny, but not |
| 55 | +# to enter through it |
| 56 | +can_exec(test_attribute_domain, test_entrypoint_deny_t) |
| 57 | + |
| 58 | +# assign corresponding types |
| 59 | +type test_attribute_entrypoint_t; |
| 60 | +typeattribute test_attribute_entrypoint_t test_attribute_entrypoint; |
| 61 | + |
| 62 | +type test_attribute_entrypoint_deny_t; |
| 63 | +typeattribute test_attribute_entrypoint_deny_t test_attribute_entrypoint_deny; |
| 64 | + |
| 65 | +type test_attribute_domain_t; |
| 66 | +typeattribute test_attribute_domain_t test_attribute_domain; |
| 67 | + |
0 commit comments