Skip to content

Commit 6d612cd

Browse files
committed
policy: Add missing input validations for ExecProcessRequest
This commit introduces validation for input fields in ExecProcessRequest to harden security policy. The changes include: - update rules.rego to add null/empty field enforcements for String_user, SelinuxLabel and ApparmorProfile Signed-off-by: Ankita Pareek <[email protected]>
1 parent 63232fc commit 6d612cd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/tools/genpolicy/rules.rego

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,8 @@ allow_create_container_input(req) {
314314
i_process := i_oci.Process
315315
count(i_process.SelinuxLabel) == 0
316316
count(i_process.User.Username) == 0
317-
317+
count(i_process.ApparmorProfile) == 0
318+
318319
print("allow_create_container_input: true")
319320
}
320321

@@ -1580,7 +1581,6 @@ allow_interactive_exec(p_container, i_process) {
15801581
print("allow_interactive_exec: true")
15811582
}
15821583

1583-
# TODO: should other ExecProcessRequest input data fields be validated as well?
15841584
ExecProcessRequest {
15851585
print("ExecProcessRequest 1: input =", input)
15861586
allow_exec_process_input

0 commit comments

Comments
 (0)