[BUG] `service_account_mapping` test does not fail if the CNF includes an auto-mounted service account.
Opened this issue · 2 comments
HashNuke commented
Describe the bug
service_account_mapping
should fail if the CNF includes an auto-mounted service account.
Possible cause
When the resources for the CNF are collected, the Service Accounts are not collected.
CNFManager
in the testsuite uses this helper function -Helm.all_workload_resources
- The above function in turns uses
KubectlClient::WORKLOAD_RESOURCES
, which does not have Service Accounts listed.
KubectlClient::WORKLOAD_RESOURCES
needs to be updated to include service accounts.
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.
HashNuke commented
The dependency kubectl_client
had to be fixed. Will open a PR for that soon.