Как посмотреть все ресурсы, которые не прошли CIS compliance-проверки?
1kubectl get clustercompliancereports.aquasecurity.github.io cis -ojson |
2 jq '.status.detailReport.results | map(select(.checks | map(.success) | all | not))'
Как посмотреть ресурсы, которые не прошли конкретную CIS compliance-проверку?
По id
:
1check_id="5.7.3"
2kubectl get clustercompliancereports.aquasecurity.github.io cis -ojson |
3 jq --arg check_id "$check_id" '.status.detailReport.results | map(select(.id == $check_id))'
По описанию:
1check_desc="Apply Security Context to Your Pods and Containers"
2kubectl get clustercompliancereports.aquasecurity.github.io cis -ojson |
3 jq --arg check_desc "$check_desc" '.status.detailReport.results | map(select(.description == $check_desc))'