Skip to content

Conversation

@micromaomao
Copy link
Member

@micromaomao micromaomao commented Oct 15, 2025

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.

TODO: decide what to do with ShutdownGraceful/ShutdownForced - currently
this is another way to send SIGTERM / KILL that bypasses rego policy check

@micromaomao micromaomao force-pushed the tingmao_github/gcs-fix-kill branch from 698ae5c to 57928e5 Compare October 15, 2025 17:25
@micromaomao micromaomao force-pushed the tingmao_github/gcs-fix-kill branch from 57928e5 to 3795301 Compare October 23, 2025 14:23
micromaomao and others added 2 commits November 5, 2025 15:13
… 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 microsoft#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 <tingmaowang@microsoft.com>
Co-authored-by: Maksim An <maksiman@microsoft.com>
… 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>
@micromaomao micromaomao force-pushed the tingmao_github/gcs-fix-kill branch from 3795301 to 5e02034 Compare November 5, 2025 15:17
@micromaomao micromaomao marked this pull request as ready for review November 5, 2025 15:17
@micromaomao micromaomao requested a review from a team as a code owner November 5, 2025 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant