Commit graph

8 commits

Author SHA1 Message Date
Peter Hunt
da695e7b78 e2e_node: update proc mount test to correctly handle baseline PSA
Signed-off-by: Peter Hunt <pehunt@redhat.com>
2026-01-07 15:59:26 -05:00
Sascha Grunert
a66c025dc9
test/e2e_node: Update procMount test to use Restricted PSA level
Update the procMount test expectations to match the intentional PSA
policy relaxation introduced in commit e8bd3f629d.

As of Kubernetes 1.35+, Pod Security Admission Baseline policy
allows UnmaskedProcMount for pods with user namespaces (hostUsers:
false). This was an intentional change to support nested container
use cases while maintaining security through user namespace isolation.

The test "will fail to unmask proc mounts if not privileged" was
written before this relaxation and expected Baseline level to reject
UnmaskedProcMount. Since Baseline now allows it (for user namespace
pods), the test needs to use Restricted level instead, which
unconditionally blocks UnmaskedProcMount regardless of user namespace
settings.

Changes:
- Change PSA level from Baseline to Restricted
- Update test name to clarify it's testing Restricted level behavior
- Update framework name from "proc-mount-baseline-test" to
  "proc-mount-restricted-test"

Fixes the ci-crio-userns-e2e-serial test failure that started occurring
when runtimes began reporting user namespace support.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2025-11-14 10:17:54 +01:00
Rodrigo Campos
3b7926824e e2e_node: Don't use userns in DefaultPocMount tests
When proc mount is set to default, it should mask /proc.

The DefaultProcMount test was setting "hostUsers: false" which means to
create a user namespaces. This was not causing issues before, because
user namespaces was disabled by default and therefore the field was
completely ignored. Now that userns is enabled by default, the test is
failing as the runtime doesn't always have userns support.

One option would be to filter for runtimes that do have userns support.
But the default case (/proc is masked) for sure we want to test it
without userns support, as it will be applied to all pods.

To that end, we add a param "hostUsers bool" to testProcMount that will
enable it or not. Then, both test cases that call this function set it
accordingly: the default case sets it to true (no user namespace), and
the unmasked case with a privileged pod sets it to false (use a user
namespace), to verify the /proc mount is unmasked in this case.

Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2025-02-17 11:51:55 +01:00
Kevin Hannon
bae4122f56 deprecate nodefeature for feature labels 2025-01-20 17:02:59 -05:00
Kevin Hannon
8495df64b2 deprecate nodefeature for feature labels 2024-12-17 13:58:12 -05:00
Peter Hunt
3d8cb4fa89 e2e_node: loosen proc mount test
the exact number of lines/ro lines is not important, just that there are more than 0 ro lines
and more than 1 line total.

this helps accomodate different architectures that implement different kernel APIs

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2024-07-17 13:26:23 -04:00
Peter Hunt
a20a8225cf e2e_node: skip proc mount tests on nodes without userns support in the runtime
Signed-off-by: Peter Hunt <pehunt@redhat.com>
Co-authored-by: Sohan Kunkerkar <sohank2602@gmail.com>
2024-07-16 17:46:23 -04:00
Peter Hunt
d6ee9ca860 test/e2e_node: add proc mount tests
including one Alpha only test, as the feature is in alpha

Signed-off-by: Peter Hunt <pehunt@redhat.com>
Co-authored-by: Sohan Kunkerkar <sohank2602@gmail.com>
2024-07-16 17:45:26 -04:00