Skip to content

Commit

Permalink
Merge pull request #6322 from Checkmarx/feat/rename_metrics_flag
Browse files Browse the repository at this point in the history
feat(flags): rename disable full description flag to disable metrics
  • Loading branch information
cxMiguelSilva authored Apr 28, 2023
2 parents 2a39181 + 837891e commit ebc1ab8
Show file tree
Hide file tree
Showing 14 changed files with 50 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go-ci-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
docker run -v ${PWD}/assets/queries:/path \
kics:${{ github.sha }} scan \
--silent \
--disable-full-descriptions \
--disable-telemetry \
--ignore-on-exit "results" \
--log-level DEBUG \
--log-path "/path/info.log" \
Expand Down
2 changes: 1 addition & 1 deletion docs/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Flags:
-m, --bom include bill of materials (BoM) in results output
--cloud-provider strings list of cloud providers to scan (alicloud, aws, azure, gcp)
--config string path to configuration file
--disable-full-descriptions disable request for full descriptions and use default vulnerability descriptions
--disable-telemetry disable usage telemetry requests
--disable-secrets disable secrets scanning
--exclude-categories strings exclude categories by providing its name
cannot be provided with query inclusion flags
Expand Down
2 changes: 1 addition & 1 deletion docs/dockerhub.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Flags:
-m, --bom include bill of materials (BoM) in results output
--cloud-provider strings list of cloud providers to scan (alicloud, aws, azure, gcp)
--config string path to configuration file
--disable-full-descriptions disable request for full descriptions and use default vulnerability descriptions
--disable-telemetry disable usage telemetry requests
--disable-secrets disable secrets scanning
--exclude-categories strings exclude categories by providing its name
cannot be provided with query inclusion flags
Expand Down
6 changes: 3 additions & 3 deletions docs/flags.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ Example of a valid `flags.json` file:
To mark a flag as hidden use the following configuration:
```json
{
"disable-full-descriptions": {
"disable-telemetry": {
"flagType": "bool",
"shorthandFlag": "",
"defaultValue": "false",
"usage": "disable request for full descriptions and use default vulnerability descriptions",
"usage": "disable usage telemetry requests",
"hidden": true
}
}
Expand All @@ -62,7 +62,7 @@ If you also want to display a flag deprecation warning you can define it like th
"usage": "disable request for full descriptions and use default vulnerability descriptions",
"hidden": true,
"deprecated": true,
"deprecatedInfo": "use --disable-full-descriptions instead"
"deprecatedInfo": "use --disable-telemetry instead"
}
}
```
Expand Down
48 changes: 24 additions & 24 deletions docs/integrations_codefresh.md

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions docs/results.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ You can also change the default name by using the following command:

This will generate an HTML and Gitlab SAST reports on output folder, with `kics-result` and `gl-sast-kics-result` names.

## Telemetry

KICS captures telemetry to help developers identify areas for improvement. After the scanning process is completed, if an internet connection is available, KICS will automatically send usage telemetry to a HTTP endpoint. However, users can disable this feature by using the `--disable-telemetry` option. This allows users to maintain privacy and control over the data that KICS sends.

It's important to note that KICS only captures counts of query results and no code or personal information is sent. All telemetry are completely anonymous, ensuring that KICS users can contribute to the improvement of the tool without compromising their privacy and security.
The captured telemetry are for internal use only and are not shared with any external third party.

If KICS is being used behind a corporate proxy, users can set proxy configurations using environment variables such as `HTTP_PROXY`, `HTTPS_PROXY`, `NO_PROXY`. This allows KICS to send usage telemetry through the proxy and maintain network security protocols. By capturing usage telemetry and enabling users to configure proxy settings, KICS ensures that it can be used effectively and securely in various network

## JSON

The JSON report is the default report to be generate, if no arg is passed to `report-formats` flag, also you can explicitly use it with `--report-formats "json"`.
Expand Down
2 changes: 1 addition & 1 deletion e2e/fixtures/assets/scan_help
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Flags:
-m, --bom include bill of materials (BoM) in results output
--cloud-provider strings list of cloud providers to scan (alicloud, aws, azure, gcp)
--config string path to configuration file
--disable-full-descriptions disable request for full descriptions and use default vulnerability descriptions
--disable-telemetry disable usage telemetry requests
--disable-secrets disable secrets scanning
--exclude-categories strings exclude categories by providing its name
cannot be provided with query inclusion flags
Expand Down
4 changes: 2 additions & 2 deletions e2e/testcases/e2e-cli-046_scan_disable-full-descriptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package testcases

import "regexp"

// E2E-CLI-046 - Kics scan command with --disable-full-descriptions
// E2E-CLI-046 - Kics scan command with --disable-telemetry
// should fetch CIS descriptions from environment URL KICS_DESCRIPTIONS_ENDPOINT.
func init() { //nolint
testSample := TestCase{
Expand All @@ -11,7 +11,7 @@ func init() { //nolint
Args: []cmdArgs{
[]string{"scan", "-p", "/path/e2e/fixtures/samples/positive.dockerfile",
"--no-color", "-v",
"--disable-full-descriptions"},
"--disable-telemetry"},
},
},
Validation: func(outputText string) bool {
Expand Down
4 changes: 2 additions & 2 deletions internal/console/assets/scan-flags.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
"deprecated": true,
"deprecatedInfo": "use --disable-full-descriptions instead"
},
"disable-full-descriptions": {
"disable-telemetry": {
"flagType": "bool",
"shorthandFlag": "",
"defaultValue": "false",
"usage": "disable request for full descriptions and use default vulnerability descriptions"
"usage": "disable usage telemetry requests"
},
"exclude-categories": {
"flagType": "multiStr",
Expand Down
2 changes: 1 addition & 1 deletion internal/console/flags/scan_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const (
CloudProviderFlag = "cloud-provider"
ConfigFlag = "config"
DisableCISDescFlag = "disable-cis-descriptions"
DisableFullDescFlag = "disable-full-descriptions"
DisableTelemetryFlag = "disable-telemetry"
ExcludeCategoriesFlag = "exclude-categories"
ExcludePathsFlag = "exclude-paths"
ExcludeQueriesFlag = "exclude-queries"
Expand Down
2 changes: 1 addition & 1 deletion internal/console/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func getScanParameters(changedDefaultQueryPath, changedDefaultLibrariesPath bool
scanParams := scan.Parameters{
CloudProvider: flags.GetMultiStrFlag(flags.CloudProviderFlag),
DisableCISDesc: flags.GetBoolFlag(flags.DisableCISDescFlag),
DisableFullDesc: flags.GetBoolFlag(flags.DisableFullDescFlag),
DisableTelemetry: flags.GetBoolFlag(flags.DisableTelemetryFlag),
ExcludeCategories: flags.GetMultiStrFlag(flags.ExcludeCategoriesFlag),
ExcludePaths: flags.GetMultiStrFlag(flags.ExcludePathsFlag),
ExcludeQueries: flags.GetMultiStrFlag(flags.ExcludeQueriesFlag),
Expand Down
2 changes: 1 addition & 1 deletion pkg/scan/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
type Parameters struct {
CloudProvider []string
DisableCISDesc bool
DisableFullDesc bool
DisableTelemetry bool
ExcludeCategories []string
ExcludePaths []string
ExcludeQueries []string
Expand Down
2 changes: 1 addition & 1 deletion pkg/scan/post_scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func (c *Client) getSummary(results []model.Vulnerability, end time.Time, pathPa
End: end,
}

if c.ScanParams.DisableCISDesc || c.ScanParams.DisableFullDesc {
if c.ScanParams.DisableCISDesc || c.ScanParams.DisableTelemetry {
log.Warn().Msg("Skipping CIS descriptions because provided disable flag is set")
} else {
err := descriptions.RequestAndOverrideDescriptions(&summary)
Expand Down
4 changes: 2 additions & 2 deletions pkg/scan/post_scan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ func Test_GetSummary(t *testing.T) {
},
},
scanParameters: Parameters{
DisableCISDesc: false,
DisableFullDesc: false,
DisableCISDesc: false,
DisableTelemetry: false,
},
results: []model.Vulnerability{
{
Expand Down

0 comments on commit ebc1ab8

Please sign in to comment.