gardener / diki

Apache License 2.0
7 stars 8 forks source link

DISA K8s STIG rule 242442 does not parse imageID correctly #321

Closed georgibaltiev closed 5 days ago

georgibaltiev commented 6 days ago

What this PR does / why we need it: This PR refactors the parsing of image names in all 3 implementations of DISA rule 242442. The strings split functions are replaced by an regex parsing function imported from the package k8s.io/kubernetes/pkg/util/parsers. An additional test to replicate the scenario that provoked the issue has been added as well.

Which issue(s) this PR fixes: Fixes #302

Special notes for your reviewer:

Release note:

A bug causing rule 242442 for all providers to parse image names incorrectly under certain circumstances (for example the image name containing additional semicolons before the tag/digest) was fixed.