rego: Allow sending SIGTERM and SIGKILL to the container init process in old policies - #2540
Merged
Merged
Conversation
micromaomao
force-pushed
the
tingmao_github/gcs-fix-kill
branch
from
October 15, 2025 17:25
698ae5c to
57928e5
Compare
micromaomao
force-pushed
the
tingmao_github/gcs-fix-kill
branch
from
October 23, 2025 14:23
57928e5 to
3795301
Compare
micromaomao
force-pushed
the
tingmao_github/gcs-fix-kill
branch
from
November 5, 2025 15:17
3795301 to
5e02034
Compare
micromaomao
marked this pull request as ready for review
November 5, 2025 15:17
micromaomao
force-pushed
the
tingmao_github/gcs-fix-kill
branch
from
December 3, 2025 10:35
5e02034 to
24b9a0b
Compare
… 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
force-pushed
the
tingmao_github/gcs-fix-kill
branch
from
December 11, 2025 10:52
24b9a0b to
f042c05
Compare
msscotb
approved these changes
Jan 10, 2026
anmaxvl
approved these changes
Jan 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
Note: currently there is another way to send SIGTERM / KILL that bypasses rego
policy check via ShutdownGraceful/ShutdownForced, and we're not changing that.