From c61c7edbd075deea52f87b2d7ecd9627edc243d6 Mon Sep 17 00:00:00 2001 From: David Wertenteil Date: Thu, 24 Nov 2022 11:06:37 +0200 Subject: [PATCH] update examples --- cmd/root.go | 2 +- cmd/scan/framework.go | 4 ++-- cmd/scan/scan.go | 2 +- core/pkg/resourcehandler/filesloader.go | 7 ++++--- core/pkg/resourcehandler/k8sresources.go | 2 +- core/pkg/resourcehandler/registrydata.go | 2 +- httphandler/docs/swagger.yaml | 1 - 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index b1ada8da..bcd3d671 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -27,7 +27,7 @@ var rootInfo cautils.RootInfo var ksExamples = ` # Scan command - kubescape scan --submit + kubescape scan # List supported frameworks kubescape list frameworks diff --git a/cmd/scan/framework.go b/cmd/scan/framework.go index 70002c57..d182d976 100644 --- a/cmd/scan/framework.go +++ b/cmd/scan/framework.go @@ -23,7 +23,7 @@ import ( var ( frameworkExample = ` # Scan all frameworks and submit the results - kubescape scan framework all --submit + kubescape scan framework all # Scan the NSA framework kubescape scan framework nsa @@ -35,7 +35,7 @@ var ( kubescape scan framework all # Scan kubernetes YAML manifest files (single file or glob) - kubescape scan framework nsa *.yaml + kubescape scan framework nsa . Run 'kubescape list frameworks' for the list of supported frameworks ` diff --git a/cmd/scan/scan.go b/cmd/scan/scan.go index f5e4d94b..e1fb0973 100644 --- a/cmd/scan/scan.go +++ b/cmd/scan/scan.go @@ -17,7 +17,7 @@ var scanCmdExamples = ` kubescape scan --enable-host-scan --verbose # Scan kubernetes YAML manifest files - kubescape scan *.yaml + kubescape scan .yaml # Scan and save the results in the JSON format kubescape scan --format json --output results.json diff --git a/core/pkg/resourcehandler/filesloader.go b/core/pkg/resourcehandler/filesloader.go index 933e392b..080a93d5 100644 --- a/core/pkg/resourcehandler/filesloader.go +++ b/core/pkg/resourcehandler/filesloader.go @@ -76,9 +76,10 @@ func (fileHandler *FileResourceHandler) GetResources(sessionObj *cautils.OPASess } - if err := fileHandler.registryAdaptors.collectImagesVulnerabilities(k8sResources, allResources, ksResources); err != nil { - logger.L().Warning("failed to collect images vulnerabilities", helpers.Error(err)) - } + // Should Kubescape scan image related controls when scanning local files? + // if err := fileHandler.registryAdaptors.collectImagesVulnerabilities(k8sResources, allResources, ksResources); err != nil { + // logger.L().Warning("failed to collect images vulnerabilities", helpers.Error(err)) + // } cautils.StopSpinner() logger.L().Success("Done accessing local objects") diff --git a/core/pkg/resourcehandler/k8sresources.go b/core/pkg/resourcehandler/k8sresources.go index 689e320f..e1c42eab 100644 --- a/core/pkg/resourcehandler/k8sresources.go +++ b/core/pkg/resourcehandler/k8sresources.go @@ -88,7 +88,7 @@ func (k8sHandler *K8sResourceHandler) GetResources(sessionObj *cautils.OPASessio logger.L().Info("Requesting images vulnerabilities results") cautils.StartSpinner() if err := k8sHandler.registryAdaptors.collectImagesVulnerabilities(k8sResourcesMap, allResources, ksResourceMap); err != nil { - logger.L().Warning("failed to collect image vulnerabilities", helpers.Error(err)) + logger.L().Warning("failed to collect image vulnerabilities", helpers.Error(err), helpers.String("Read more here", "https://hub.armosec.io/docs/configuration-of-image-vulnerabilities")) cautils.SetInfoMapForResources(fmt.Sprintf("failed to pull image scanning data: %s. for more information: https://hub.armosec.io/docs/configuration-of-image-vulnerabilities", err.Error()), imgVulnResources, sessionObj.InfoMap) } else { if isEmptyImgVulns(*ksResourceMap) { diff --git a/core/pkg/resourcehandler/registrydata.go b/core/pkg/resourcehandler/registrydata.go index 5620a8ea..e94300f3 100644 --- a/core/pkg/resourcehandler/registrydata.go +++ b/core/pkg/resourcehandler/registrydata.go @@ -8,8 +8,8 @@ import ( "github.com/kubescape/k8s-interface/workloadinterface" "github.com/kubescape/kubescape/v2/core/cautils" "github.com/kubescape/kubescape/v2/core/cautils/getter" - gcpadaptorv1 "github.com/kubescape/kubescape/v2/core/pkg/registryadaptors/gcp/v1" armosecadaptorv1 "github.com/kubescape/kubescape/v2/core/pkg/registryadaptors/armosec/v1" + gcpadaptorv1 "github.com/kubescape/kubescape/v2/core/pkg/registryadaptors/gcp/v1" "github.com/kubescape/kubescape/v2/core/pkg/registryadaptors/registryvulnerabilities" "github.com/kubescape/opa-utils/shared" diff --git a/httphandler/docs/swagger.yaml b/httphandler/docs/swagger.yaml index 1d83789a..a95400fa 100644 --- a/httphandler/docs/swagger.yaml +++ b/httphandler/docs/swagger.yaml @@ -75,7 +75,6 @@ definitions: description: |- Submit results to Kubescape Cloud. - Same as `kubescape scan --submit`. type: boolean x-go-name: Submit targetNames: