-
Notifications
You must be signed in to change notification settings - Fork 836
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
feat: add kubescape patch command #1332
feat: add kubescape patch command #1332
Conversation
Signed-off-by: Anubhav Gupta <mail.anubhav06@gmail.com>
|
At the present, there's no assertion of levels of support in Kubescape. Everything just "is", in the most part. The alternative would be keeping it in a separate branch, which would require keeping it in sync, and making builds from it if we wanted anyone to actually use it. /cc @rotemamsa |
|
The former sounds better to me. So this will be merged later, when the feature gates have been introduced, right? |
|
@anubhav06 Please pull from the master branch and run the What do you think? |
Signed-off-by: Anubhav Gupta <mail.anubhav06@gmail.com>
|
@dwertent I've updated the output to align with that of image scan command (screenshot in PR desc). |
|
@anubhav06 This feature looks really cool and works smoothly! I'm very excited for this! I have some general comments about the feature, which are mostly food for thought:
|
|
@Daniel-GrunbergerCA Thanks! To answer your questions:
|
In general, thank you @anubhav06 for this PR! |
Signed-off-by: Anubhav Gupta <mail.anubhav06@gmail.com>
|
changes: (updated screenshot in PR desc)
|
core/pkg/opaprocessor/utils.go
Outdated
| @@ -106,6 +106,6 @@ var imageNameNormalizeDefinition = func(bctx rego.BuiltinContext, a *ast.Term) ( | |||
| if err != nil { | |||
| return nil, fmt.Errorf("invalid parameter type: %v", err) | |||
| } | |||
| normalizedName, err := normalize_image_name(string(aStr)) | |||
| normalizedName, err := cautils.Normalize_image_name(string(aStr)) | |||
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.
@YiscahLevySilas1 can this affect the controls that are using this function?
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.
I don't think it will affect them
| @@ -116,12 +116,7 @@ func (sp *SARIFPrinter) printImageScan(scanResults *models.PresenterConfig) erro | |||
| return fmt.Errorf("no no image vulnerability data provided") | |||
| } | |||
|
|
|||
| presenterConfig, err := presenter.ValidatedConfig(printer.SARIFFormat, "", false) | |||
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.
was this accidentally removed?
cc @Daniel-GrunbergerCA
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.
No. Because with the new version of grype, the previous syntax is not supported.
Similarly, in the jsonprinter, the ValidatedConfig method has been removed (here)
Signed-off-by: Anubhav Gupta <mail.anubhav06@gmail.com>
e091269
into
kubescape:refactor-img-cmd


Overview
Add
kubescape patchcommandAdditional Information
kubescape patchcommand can be used to patch container images with vulnerabilities.TODO
anubhav06/copaceticwithproject-copacetic/copacetic, when the copa team accepts the kubescape and copa integration support PR.Usage
Examples/Screenshots
sudo buildkitdin a separate terminalsudo kubescape patch --image docker.io/library/nginx:1.22:cc @craigbox @dwertent
Related issues/PRs:
Resolved #1227
Checklist before requesting a review
put an [x] in the box to get it checked