cnti-testcatalog/testsuite

[BUG] `service_account_mapping` test does not fail if the CNF includes an auto-mounted service account.

Opened this issue · 2 comments

Describe the bug

service_account_mapping should fail if the CNF includes an auto-mounted service account.

CleanShot 2024-04-25 at 03 01 49@2x

Possible cause

When the resources for the CNF are collected, the Service Accounts are not collected.

KubectlClient::WORKLOAD_RESOURCES needs to be updated to include service accounts.

CleanShot 2024-04-25 at 03 08 08@2x

To reproduce

./cnf-testsuite cnf_setup cnf-config=./sample-cnfs/sample-service-accounts/cnf-testsuite.yml
./cnf-testsuite service_account_mapping

The test should fail, but it instead passes.

This output was from upgraded kubescape version from another branch. But that shouldn't matter, it looks like the bug should be present in the main branch too.

This is fixed in #2004 to help the build pass.

The dependency kubectl_client had to be fixed. Will open a PR for that soon.