-
Notifications
You must be signed in to change notification settings - Fork 17
/
check_examples.txt
211 lines (124 loc) · 2.44 KB
/
check_examples.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
Here are examples of errors that will cause each possible result:
Extra:
X-001:
# generates av rules for each type assigned to the attribute 'domain'
# except 'foo_t', which might be thousands
allow { domain -foo_t } self:process signal;
Convention:
C-001:
type foo_t;
allow foo_t self:process signal;
type bar_t;
C-004:
interface(`foo_read_conf',`
...
')
C-005:
allow foo_t bar_t:file { write read };
C-006:
gen_require(`
type foo_t, bar_t;
class foobar;
')
C-007:
allow myapp_t myapp_t:process signal;
Style:
S-001:
require {
type foo_t;
}
S-003:
foo(bar);
S-004:
template(`bar',`')
interface(`foo',`
bar()
')
S-005:
interface(`foo',`
type foo_t;
')
S-006:
module foo 1.0;
S-007:
gen_context(system_u:object_r:foo_t)
S-008:
gen_require(
type foo_t;
)
S-009:
allow foo_t bar_t:file read_fifo_file_perms;
S-010:
allow foo_t bar_t:file { open read };
S-011:
# file context line containing only white spaces
Warning:
W-001:
# etc_t is defined in files module
read_files_pattern(foo_t, etc_t, etc_t)
W-002:
interface(`foo_read_conf',`
read_files_pattern($1, foo_conf_t, foo_conf_t)
')
W-003:
interface(`foo_read_conf',`
gen_require(`
type foo_conf_t;
')
')
W-004:
/path/with/unescaped.dot -- gen_context(system_u:object_r:foo_exec_t,s0)
W-005:
# foo is set to module in modules.conf
foo_read_conf()
W-006:
foo()
W-007:
foo(bar baz)
W-008:
allow foo_t bar_t:file *;
W-009:
#In foo.te
policy_module(bar, 1.0)
W-010:
init_this-if-does-not-exist(bar_t)
W-011:
interface(`foo_read_conf',`
gen_require(`
type this_type_does_not_exist;
# type from different module
type bar_conf_t;
')
')
W-012:
# in module foo
if (bar_cond) {
...
}
W-013:
allow foo_t bar_t:file audit_access;
Error:
E-002:
/usr/bin/foo -- gen_erquire(system_u:object_r:foo_exec_t, s0)
E-003:
/usr/bin/foo -- gen_require(not_a_valid_user:object_r:foo_exec_t, s0)
E-004:
/usr/bin/foo -- gen_require(system_u:not_a_valid_role:foo_exec_t, s0)
E-004:
/usr/bin/foo -- gen_require(system_u:object_r:not_a_valid_type, s0)
E-005:
# There is no type named foo_exce_t defined in our policy
/usr/bin/foo -- gen_require(system_u:object_r:foo_exce_t, s0)
E-006:
attribute foo;
interface(`foo',`')
E-007:
allow foo_t bar_t:file reed_file_perms;
E-008:
allow foo_t bar_t:File read_file_perms;
E-009:
optional_policy(`
#do_something(type_t)
')
E-010:
bare_m4_macro