Commit f03c2fb
authored
Remove the standard JSON enforcer and the JSON policy parsing in the Rego enforcer (#2539)
* securitypolicyenforcer: Remove the standard JSON enforcer
This commit removes the long deprecated standard JSON enforcer - all
confidential containers now has to either use Rego (the default), or the
open_door enforcer if provided with an empty policy or a policy that is
`{"allow_all": true}` (both case checked against host data).
Note that the host can still choose either rego or open_door, and this is not
measured into host data, but the policy check in createOpenDoorEnforcer ensures
that if the policy is a rego policy, trying to use an open_door enforcer will
error, leaving the enforcer at the default (which for confidential is a
deny-everything ClosedDoorSecurityPolicyEnforcer).
Signed-off-by: Tingmao Wang <[email protected]>
* rego enforcer: Remove support for JSON policies using Rego enforcer
This removes the ability to send in a standard JSON policy to the Rego enforcer.
Previously it would translate it into the equivalent Rego policy (the format is
different from the `containers := [...]` definition in Rego), but we need to
stop supporting this.
Signed-off-by: Tingmao Wang <[email protected]>
* Do not allow {"allow_all": true} as a valid "open_door" policy.
For the open door enforcer to be used, policy must be empty (i.e. the case in
non-confidential containers).
Signed-off-by: Tingmao Wang <[email protected]>
* Remove the custom "JSON policy is not supported." error message
Suggested-by: Ken Gordon <[email protected]>
Signed-off-by: Tingmao Wang <[email protected]>
* Remove unused function and add nolint where it's wrong
Signed-off-by: Tingmao Wang <[email protected]>
* Move substituteUVMPath to test specific go files
This function is now only used by tests, and having it in non _test files
causses unused function lints.
Signed-off-by: Tingmao Wang <[email protected]>
* Fix function name typo in comment
Signed-off-by: Tingmao Wang <[email protected]>
---------
Signed-off-by: Tingmao Wang <[email protected]>1 parent bdc6744 commit f03c2fb
File tree
9 files changed
+70
-1780
lines changed- pkg/securitypolicy
9 files changed
+70
-1780
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2218 | 2218 | | |
2219 | 2219 | | |
2220 | 2220 | | |
2221 | | - | |
2222 | | - | |
2223 | | - | |
2224 | | - | |
2225 | | - | |
2226 | | - | |
2227 | | - | |
2228 | | - | |
2229 | | - | |
2230 | | - | |
2231 | | - | |
2232 | | - | |
2233 | | - | |
2234 | | - | |
2235 | | - | |
2236 | | - | |
2237 | | - | |
2238 | | - | |
2239 | | - | |
2240 | | - | |
2241 | | - | |
2242 | | - | |
2243 | | - | |
2244 | | - | |
2245 | | - | |
2246 | | - | |
2247 | | - | |
2248 | | - | |
2249 | | - | |
2250 | | - | |
2251 | | - | |
2252 | | - | |
2253 | | - | |
2254 | | - | |
2255 | 2221 | | |
2256 | 2222 | | |
2257 | 2223 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| |||
6324 | 6326 | | |
6325 | 6327 | | |
6326 | 6328 | | |
| 6329 | + | |
| 6330 | + | |
| 6331 | + | |
| 6332 | + | |
| 6333 | + | |
| 6334 | + | |
| 6335 | + | |
| 6336 | + | |
| 6337 | + | |
| 6338 | + | |
| 6339 | + | |
| 6340 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1329 | 1329 | | |
1330 | 1330 | | |
1331 | 1331 | | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | 11 | | |
13 | 12 | | |
14 | | - | |
15 | 13 | | |
16 | 14 | | |
17 | 15 | | |
| |||
20 | 18 | | |
21 | 19 | | |
22 | 20 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | 21 | | |
37 | 22 | | |
38 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | 11 | | |
22 | 12 | | |
23 | 13 | | |
| |||
0 commit comments