-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DISA K8s STIG rule 242442 does not parse imageID correctly #321
DISA K8s STIG rule 242442 does not parse imageID correctly #321
Conversation
…lidate the error case that provoked the issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall, just a few nits.
pkg/provider/managedk8s/ruleset/disak8sstig/rules/242442_test.go
Outdated
Show resolved
Hide resolved
pkg/provider/virtualgarden/ruleset/disak8sstig/rules/242442_test.go
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
/lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Two requests that need to be applied in several places. The rest looks good.
|
||
dockerref "github.com/distribution/reference" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dockerref "github.com/distribution/reference" | |
imageref "github.com/distribution/reference" |
@@ -113,19 +116,45 @@ var _ = Describe("#242442", func() { | |||
|
|||
Expect(ruleResult.CheckResults).To(Equal(expectedCheckResults)) | |||
}) | |||
It("should return correct results when images are local", func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It("should return correct results when images are local", func() { | |
It("should return correct results when image repository includes port number", func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
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: