From a5ef6aa12673fecbcd84d8d9eae0dbcafd674c62 Mon Sep 17 00:00:00 2001 From: Alan Clucas Date: Tue, 26 Oct 2021 15:12:17 +0100 Subject: [PATCH 1/2] Minor spelling fixes --- README.md | 2 +- resultshandling/printer/prettyprinter.go | 12 ++++++------ resultshandling/printer/summary.go | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 6bcc3cb6..8d893934 100644 --- a/README.md +++ b/README.md @@ -163,7 +163,7 @@ Kubescape is an open source project, we welcome your feedback and ideas for impr ## Build using python (3.7^) script -Kubescpae can be built using: +Kubescape can be built using: ``` sh python build.py diff --git a/resultshandling/printer/prettyprinter.go b/resultshandling/printer/prettyprinter.go index 1d4b366b..e0b54715 100644 --- a/resultshandling/printer/prettyprinter.go +++ b/resultshandling/printer/prettyprinter.go @@ -46,7 +46,7 @@ func (printer *PrettyPrinter) summarySetup(postureReport *reporthandling.Posture printer.frameworkSummary = ControlSummary{ TotalResources: fr.GetNumberOfResources(), TotalFailed: fr.GetNumberOfFailedResources(), - TotalWarnign: fr.GetNumberOfWarningResources(), + TotalWarning: fr.GetNumberOfWarningResources(), } for _, cr := range fr.ControlReports { if len(cr.RuleReports) == 0 { @@ -57,7 +57,7 @@ func (printer *PrettyPrinter) summarySetup(postureReport *reporthandling.Posture printer.summary[cr.Name] = ControlSummary{ TotalResources: cr.GetNumberOfResources(), TotalFailed: cr.GetNumberOfFailedResources(), - TotalWarnign: cr.GetNumberOfWarningResources(), + TotalWarning: cr.GetNumberOfWarningResources(), FailedWorkloads: groupByNamespace(workloadsSummary, workloadSummaryFailed), ExcludedWorkloads: groupByNamespace(workloadsSummary, workloadSummaryExclude), Description: cr.Description, @@ -82,8 +82,8 @@ func (printer *PrettyPrinter) printResults() { func (printer *PrettyPrinter) printSummary(controlName string, controlSummary *ControlSummary) { cautils.SimpleDisplay(printer.writer, "Summary - ") - cautils.SuccessDisplay(printer.writer, "Passed:%v ", controlSummary.TotalResources-controlSummary.TotalFailed-controlSummary.TotalWarnign) - cautils.WarningDisplay(printer.writer, "Excluded:%v ", controlSummary.TotalWarnign) + cautils.SuccessDisplay(printer.writer, "Passed:%v ", controlSummary.TotalResources-controlSummary.TotalFailed-controlSummary.TotalWarning) + cautils.WarningDisplay(printer.writer, "Excluded:%v ", controlSummary.TotalWarning) cautils.FailureDisplay(printer.writer, "Failed:%v ", controlSummary.TotalFailed) cautils.InfoDisplay(printer.writer, "Total:%v\n", controlSummary.TotalResources) if controlSummary.TotalFailed > 0 { @@ -99,7 +99,7 @@ func (printer *PrettyPrinter) printTitle(controlName string, controlSummary *Con cautils.InfoDisplay(printer.writer, "resources not found %v\n", emoji.ConfusedFace) } else if controlSummary.TotalFailed != 0 { cautils.FailureDisplay(printer.writer, "failed %v\n", emoji.SadButRelievedFace) - } else if controlSummary.TotalWarnign != 0 { + } else if controlSummary.TotalWarning != 0 { cautils.WarningDisplay(printer.writer, "excluded %v\n", emoji.NeutralFace) } else { cautils.SuccessDisplay(printer.writer, "passed %v\n", emoji.ThumbsUp) @@ -191,7 +191,7 @@ func (printer *PrettyPrinter) printSummaryTable() { controlSummary := printer.summary[printer.sortedControlNames[i]] summaryTable.Append(generateRow(printer.sortedControlNames[i], controlSummary)) } - summaryTable.SetFooter(generateFooter(len(printer.summary), printer.frameworkSummary.TotalFailed, printer.frameworkSummary.TotalWarnign, printer.frameworkSummary.TotalResources)) + summaryTable.SetFooter(generateFooter(len(printer.summary), printer.frameworkSummary.TotalFailed, printer.frameworkSummary.TotalWarning, printer.frameworkSummary.TotalResources)) summaryTable.Render() } diff --git a/resultshandling/printer/summary.go b/resultshandling/printer/summary.go index 9df245f6..056f6d23 100644 --- a/resultshandling/printer/summary.go +++ b/resultshandling/printer/summary.go @@ -15,7 +15,7 @@ func NewSummary() Summary { type ControlSummary struct { TotalResources int TotalFailed int - TotalWarnign int + TotalWarning int Description string Remediation string ListInputKinds []string @@ -34,7 +34,7 @@ type WorkloadSummary struct { func (controlSummary *ControlSummary) ToSlice() []string { s := []string{} s = append(s, fmt.Sprintf("%d", controlSummary.TotalFailed)) - s = append(s, fmt.Sprintf("%d", controlSummary.TotalWarnign)) + s = append(s, fmt.Sprintf("%d", controlSummary.TotalWarning)) s = append(s, fmt.Sprintf("%d", controlSummary.TotalResources)) return s } From 38a9c11286ce1ef75308c1934797aa711f0467dd Mon Sep 17 00:00:00 2001 From: Matt Boersma Date: Fri, 5 Nov 2021 10:33:06 -0600 Subject: [PATCH 2/2] Fix spelling in --fail-threshold description --- README.md | 2 +- clihandler/cmd/scan.go | 2 +- clihandler/initcli.go | 2 +- docs/run-options.md | 4 +--- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 6bcc3cb6..cc0786a5 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ Set-ExecutionPolicy RemoteSigned -scope CurrentUser | --- | --- | --- | --- | | `-e`/`--exclude-namespaces` | Scan all namespaces | Namespaces to exclude from scanning. Recommended to exclude `kube-system` and `kube-public` namespaces | | `-s`/`--silent` | Display progress messages | Silent progress messages | -| `-t`/`--fail-threshold` | `0` (do not fail) | fail command (return exit code 1) if result bellow threshold| `0` -> `100` | +| `-t`/`--fail-threshold` | `0` (do not fail) | fail command (return exit code 1) if result is below threshold| `0` -> `100` | | `-f`/`--format` | `pretty-printer` | Output format | `pretty-printer`/`json`/`junit` | | `-o`/`--output` | print to stdout | Save scan result in file | | `--use-from` | | Load local framework object from specified path. If not used will download latest | diff --git a/clihandler/cmd/scan.go b/clihandler/cmd/scan.go index e86e5a02..1e1056fa 100644 --- a/clihandler/cmd/scan.go +++ b/clihandler/cmd/scan.go @@ -34,7 +34,7 @@ func init() { scanCmd.PersistentFlags().StringVarP(&scanInfo.Format, "format", "f", "pretty-printer", `Output format. Supported formats: "pretty-printer"/"json"/"junit"`) scanCmd.PersistentFlags().StringVarP(&scanInfo.Output, "output", "o", "", "Output file. Print output to file and not stdout") scanCmd.PersistentFlags().BoolVarP(&scanInfo.Silent, "silent", "s", false, "Silent progress messages") - scanCmd.PersistentFlags().Uint16VarP(&scanInfo.FailThreshold, "fail-threshold", "t", 0, "Failure threshold is the percent bellow which the command fails and returns exit code 1") + scanCmd.PersistentFlags().Uint16VarP(&scanInfo.FailThreshold, "fail-threshold", "t", 0, "Failure threshold is the percent below which the command fails and returns exit code 1") scanCmd.PersistentFlags().StringVar(&scanInfo.UseFrom, "use-from", "", "Load local framework object from specified path. If not used will download latest") scanCmd.PersistentFlags().BoolVar(&scanInfo.UseDefault, "use-default", false, "Load local framework object from default path. If not used will download latest") scanCmd.PersistentFlags().StringVar(&scanInfo.UseExceptions, "exceptions", "", "Path to an exceptions obj. If not set will download exceptions from Armo management portal") diff --git a/clihandler/initcli.go b/clihandler/initcli.go index 1fdaae44..7e74ebb0 100644 --- a/clihandler/initcli.go +++ b/clihandler/initcli.go @@ -118,7 +118,7 @@ func CliSetup(scanInfo *cautils.ScanInfo) error { adjustedFailThreshold := float32(scanInfo.FailThreshold) / 100 if score < adjustedFailThreshold { - return fmt.Errorf("Scan score is bellow threshold") + return fmt.Errorf("Scan score is below threshold") } return nil diff --git a/docs/run-options.md b/docs/run-options.md index 8a94afc0..9233f49b 100644 --- a/docs/run-options.md +++ b/docs/run-options.md @@ -13,7 +13,7 @@ kubescape scan framework nsa --exclude-namespaces kube-system,kube-public | --- | --- | --- | --- | | `-e`/`--exclude-namespaces` | Scan all namespaces | Namespaces to exclude from scanning. Recommended to exclude `kube-system` and `kube-public` namespaces | | `-s`/`--silent` | Display progress messages | Silent progress messages | -| `-t`/`--fail-threshold` | `0` (do not fail) | fail command (return exit code 1) if result bellow threshold| `0` -> `100` | +| `-t`/`--fail-threshold` | `0` (do not fail) | fail command (return exit code 1) if result is below threshold| `0` -> `100` | | `-f`/`--format` | `pretty-printer` | Output format | `pretty-printer`/`json`/`junit` | | `-o`/`--output` | print to stdout | Save scan result in file | | `--use-from` | | Load local framework object from specified path. If not used will download latest | @@ -85,5 +85,3 @@ kubescape scan framework nsa --use-from nsa.json ``` Kubescape is an open source project, we welcome your feedback and ideas for improvement. We’re also aiming to collaborate with the Kubernetes community to help make the tests themselves more robust and complete as Kubernetes develops. - -