This repository was archived by the owner on Oct 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
feat: add CIS Docker Benchmark scanner #1303
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ff00cbd
to
1b1eb5d
Compare
This comment has been minimized.
This comment has been minimized.
4b7b5a4
to
3ba24e2
Compare
This comment has been minimized.
This comment has been minimized.
ramizpolic
reviewed
Feb 24, 2024
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.
great work @akijakya! left a couple of comments to address, nothing major
3ba24e2
to
d4212f7
Compare
ramizpolic
reviewed
Feb 26, 2024
ramizpolic
reviewed
Feb 26, 2024
d4212f7
to
407de7e
Compare
Signed-off-by: András Jáky <[email protected]>
Signed-off-by: András Jáky <[email protected]>
Signed-off-by: András Jáky <[email protected]> ci: fix? Signed-off-by: András Jáky <[email protected]>
Signed-off-by: András Jáky <[email protected]>
407de7e
to
fc1074f
Compare
This comment has been minimized.
This comment has been minimized.
2025ae6
to
ce27d6d
Compare
Signed-off-by: András Jáky <[email protected]>
ce27d6d
to
663b415
Compare
Hey! Your images are ready:
|
ramizpolic
approved these changes
Feb 27, 2024
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, thanks @akijakya!
Hey there and thank you for opening this pull request! 👋🏼 We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted. Details:
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds
dockle
as CIS Docker Benchmark scanner to the family of Misconfiguration scanners.Addressing fix: go builds commit
Additional build tags had to be added everywhere where the
cli
and modules using thecli
module (namelyorchestrator
andprovider
) are being built (because of thegithub.com/containers/storage
indirect package) and CGO is enabled, otherwise, this build error would occur:If this is unacceptable, we could think of other ways to include this scanner, e.g., adding it as a binary instead of using it as a go package.
Try it out locally
Get a test image (e.g.
docker pull goodwithtech/test-image:v1
, or any image on your system you'd like to scan)Also, since Dockle can scan docker archives as well, let's create one, e.g.:
docker buildx build --output type=docker,dest=./docker-test.tar --build-arg BUILD_OPTS="-tags=exclude_graphdriver_btrfs,exclude_graphdriver_devicemapper" -f Dockerfile.cli .
Create a config with these inputs:
Run the scan:
go run ./cli/cmd/main.go scan --config .cisdocker-test.yaml
For trying it out locally as part of the docker provider within VMClarity, this issue needs to be resolved first.
Fixes #1254
Type of Change
[ ] Bug Fix
[X] New Feature
[ ] Breaking Change
[ ] Refactor
[ ] Documentation
[ ] Other (please describe)
Checklist