Compare commits

..

1 Commits

Author SHA1 Message Date
David Wertenteil
0cfdabd25a remove v1 format 2022-04-10 16:26:59 +03:00
6 changed files with 12 additions and 19 deletions

View File

@@ -61,21 +61,17 @@ func getRiskScoreColumn(controlSummary reportsummary.IControlSummary, infoToPrin
}
func getSeverityColumn(controlSummary reportsummary.IControlSummary) string {
// if controlSummary.GetStatus().IsPassed() || controlSummary.GetStatus().IsSkipped() {
// return " "
// }
severity := apis.ControlSeverityToString(controlSummary.GetScoreFactor())
return color.New(getColor(severity), color.Bold).SprintFunc()(severity)
return color.New(getColor(apis.ControlSeverityToInt(controlSummary.GetScoreFactor())), color.Bold).SprintFunc()(apis.ControlSeverityToString(controlSummary.GetScoreFactor()))
}
func getColor(controlSeverity string) color.Attribute {
func getColor(controlSeverity int) color.Attribute {
switch controlSeverity {
case "Critical":
case apis.SeverityCritical:
return color.FgRed
case "High":
case apis.SeverityHigh:
return color.FgYellow
case "Medium":
case apis.SeverityMedium:
return color.FgCyan
case "Low":
case apis.SeverityLow:
return color.FgWhite
default:
return color.FgWhite

View File

@@ -36,11 +36,7 @@ func (prettyPrinter *PrettyPrinter) ActionPrint(opaSessionObj *cautils.OPASessio
sortedControlNames := getSortedControlsNames(opaSessionObj.Report.SummaryDetails.Controls) // ListControls().All())
if prettyPrinter.verboseMode {
if prettyPrinter.formatVersion == "v1" {
prettyPrinter.printResults(&opaSessionObj.Report.SummaryDetails.Controls, opaSessionObj.AllResources, sortedControlNames)
} else if prettyPrinter.formatVersion == "v2" {
prettyPrinter.resourceTable(opaSessionObj)
}
prettyPrinter.resourceTable(opaSessionObj)
}
prettyPrinter.printSummaryTable(&opaSessionObj.Report.SummaryDetails, sortedControlNames)

View File

@@ -12,7 +12,7 @@ Running `kubescape` will start up a webserver on port `8080` which will serve th
* DELETE `/v1/results` - Delete kubescape scan results from storage. ~If empty will delete latest results~ (not supported)
* * query `id=<string>`: Delete ID of specific results
* * query `all`: Delete all cached results
* GET/POST `/metrics` - will trigger cluster scan. will respond with prometheus metrics once they have been scanned. This will respond 503 if the scan failed.
* GET/POST `/v1/metrics` - will trigger cluster scan. will respond with prometheus metrics once they have been scanned. This will respond 503 if the scan failed.
* `/livez` - will respond 200 is server is alive
* `/readyz` - will respond 200 if server can receive requests

View File

@@ -89,7 +89,8 @@ spec:
port: 8080
initialDelaySeconds: 3
periodSeconds: 3
image: quay.io/armosec/kubescape:prometheus.v2
image: quay.io/armosec/kubescape:latest
imagePullPolicy: Always
env:
- name: KS_DEFAULT_CONFIGMAP_NAMESPACE
valueFrom:

View File

@@ -11,6 +11,6 @@ spec:
app: kubescape
podMetricsEndpoints:
- port: http
# path: v1
path: /v1/metrics
interval: 120s
scrapeTimeout: 100s

View File

@@ -17,7 +17,7 @@ import (
const (
scanPath = "/v1/scan"
resultsPath = "/v1/results"
prometheusMmeticsPath = "/metrics"
prometheusMmeticsPath = "/v1/metrics"
livePath = "/livez"
readyPath = "/readyz"
)