cnti-testcatalog / testsuite

📞📱☎️📡🌐 Cloud Native Telecom Initiative (CNTI) Test Catalog is a tool to check for and provide feedback on the use of K8s + cloud native best practices in networking applications and platforms
https://wiki.lfnetworking.org/display/LN/Test+Catalog
Apache License 2.0
173 stars 71 forks source link

[1993, 1999, 2003] Upgrade Kubescape to v3.0.8 and fix affected tests #2004

Closed HashNuke closed 5 months ago

HashNuke commented 5 months ago

Related issues

Description

(#1993) Kubescape version check

(#1999) resource_policies

CleanShot 2024-04-25 at 15 31 58

(#1999) hostpath_mounts

CleanShot 2024-04-25 at 02 38 14@2x

(#2003) service_account_mapping

The automated spec for service_account_mapping was failing. Turns out that KubectlClient::WORKLOAD_RESOURCES in kubectl_client dependency, did not have ServiceAccount in the list of resources to identify.

The above findings mean that when the Kubescape module's helper functions are used to get the CNF's resources that failed a particular test, the service account is not included as part of CNF's resources.

PR to kubectl_client merged. I've tagged a new release v1.0.6 on kubectl_client. The shard.yml of the testsuite has been updated to use this version.

CleanShot 2024-04-25 at 14 00 32@2x

(#1999) platform:control_plane_hardening

Updated test to use new control name in Kubescape NSA framework.

(#1999) platform:cluster_admin

Updated the name of the Kubescape control. This fixes the test.

(#1999) platform:exposed_dashboard removed

non_root_containers

CleanShot 2024-04-25 at 15 25 29@2x

CleanShot 2024-04-25 at 15 23 55@2x

(#1999) Other changes

Related PRs

Validation with sample coredns CNF

Tried running workload tests for the sample coredns CNF. No crashes/stacktraces displayed. Tests seem to be running.

CleanShot 2024-04-25 at 21 21 25@2x

CleanShot 2024-04-25 at 21 21 54@2x

CleanShot 2024-04-25 at 21 19 18@2x

How has this been tested:

Types of changes:

Checklist:

Documentation

Code Review

Issue

HashNuke commented 5 months ago

Identified an issue with service_account_mapping and reported here - https://github.com/cnti-testcatalog/testsuite/issues/2003

There is one other failure to look into (non_root_containers). Will take a look in a few hours.

HashNuke commented 5 months ago

Updates

The previous build passed - https://github.com/cnti-testcatalog/testsuite/actions/runs/8830493531

To move forward

Next steps