Commit 04d91ee
rego: Allow sending SIGTERM and SIGKILL to the container init process in old policies (#2540)
* rego: Allow sending SIGTERM and SIGKILL to the container init process in old policies
We used to allow SIGTERM/SIGKILL the container init process even if the
container's signals list is empty due to a bug fixed in #2538. However, because
our tooling has been generating policies with an empty signals list, we need to
special case this for old policies to maintain backwards compatibility.
Update framework.rego to have SIGTERM and SIGKILL as default kill signals for
init process for framework API versions "0.4.1" and below. Newer policies must
explicitly have these signals present, otherwise sending signal will be denied.
Signed-off-by: Tingmao Wang <[email protected]>
Co-authored-by: Maksim An <[email protected]>
* Fix missing denial reason when a signal request to a non-init process is denied
This happens if the container.signals list contains relevant signals, but the
process's signals list does not allow the signal.
Old:
{"decision":"deny","input":{"argList":["/bin/sleep","infinity"],"containerID":"0971693a04cdd4f2eeefc569754b5cd8046ec0b7c7ed6899bb3dec0dd45ba735","isInitProcess":false,"rule":"signal_container_process","signal":9},"reason":{"errors":[]}}
Now:
{"decision":"deny","input":{"argList":["/bin/sleep","infinity"],"containerID":"3873bfc939e2415892b5b74a7b1dbade0f7222e266df43df85968ddda59be56e","isInitProcess":false,"rule":"signal_container_process","signal":9},"reason":{"errors":["target isn't allowed to receive the signal"]}}
Signed-off-by: Tingmao Wang <[email protected]>
---------
Signed-off-by: Tingmao Wang <[email protected]>
Co-authored-by: Maksim An <[email protected]>1 parent f2cdd65 commit 04d91ee
2 files changed
+14
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1488 | 1488 | | |
1489 | 1489 | | |
1490 | 1490 | | |
| 1491 | + | |
1491 | 1492 | | |
1492 | 1493 | | |
1493 | 1494 | | |
1494 | 1495 | | |
1495 | 1496 | | |
| 1497 | + | |
1496 | 1498 | | |
1497 | 1499 | | |
1498 | 1500 | | |
| |||
1960 | 1962 | | |
1961 | 1963 | | |
1962 | 1964 | | |
1963 | | - | |
| 1965 | + | |
1964 | 1966 | | |
1965 | 1967 | | |
1966 | 1968 | | |
| |||
2026 | 2028 | | |
2027 | 2029 | | |
2028 | 2030 | | |
| 2031 | + | |
| 2032 | + | |
| 2033 | + | |
| 2034 | + | |
| 2035 | + | |
| 2036 | + | |
| 2037 | + | |
| 2038 | + | |
| 2039 | + | |
| 2040 | + | |
2029 | 2041 | | |
2030 | 2042 | | |
2031 | 2043 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
0 commit comments