Skip to content

Commit 3795301

Browse files
committed
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 <tingmaowang@microsoft.com>
1 parent ee0d9f8 commit 3795301

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pkg/securitypolicy/framework.rego

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1488,11 +1488,13 @@ errors[mountError] {
14881488
default signal_allowed := false
14891489

14901490
signal_allowed {
1491+
input.isInitProcess
14911492
some container in data.metadata.matches[input.containerID]
14921493
signal_ok(container.signals)
14931494
}
14941495

14951496
signal_allowed {
1497+
not input.isInitProcess
14961498
some container in data.metadata.matches[input.containerID]
14971499
some process in container.exec_processes
14981500
command_ok(process.command)

0 commit comments

Comments
 (0)