1
0
mirror of https://github.com/aquasecurity/kube-bench.git synced 2025-03-06 10:06:07 +00:00

fix: Add default case to CIS benchmark version selection (#1823)

This commit adds a default case to the switch statements for both "rancher" and "rke2" platforms. This ensures that a fallback CIS benchmark version ("rke-cis-1.7" and "rke2-cis-1.7" respectively) is returned when the Kubernetes version does not match any of the explicitly defined cases.
This commit is contained in:
mjshastha 2025-03-05 13:13:06 +05:30 committed by GitHub
parent 7f2f0f3227
commit b0cb472482
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -527,6 +527,8 @@ func getPlatformBenchmarkVersion(platform Platform) string {
return "rke-cis-1.24"
case "1.25", "1.26", "1.27":
return "rke-cis-1.7"
default:
return "rke-cis-1.7"
}
case "rke2r":
switch platform.Version {
@ -536,6 +538,8 @@ func getPlatformBenchmarkVersion(platform Platform) string {
return "rke2-cis-1.24"
case "1.25", "1.26", "1.27":
return "rke2-cis-1.7"
default:
return "rke2-cis-1.7"
}
}
return ""