diff --git a/cmd/detectExecuteScan.go b/cmd/detectExecuteScan.go index 9dd948f7a8..bd66108f66 100644 --- a/cmd/detectExecuteScan.go +++ b/cmd/detectExecuteScan.go @@ -429,9 +429,11 @@ func getDetectScript(config detectExecuteScanOptions, utils detectUtils) error { downloadScript := func() error { if config.UseDetect8 { - return utils.DownloadFile("https://detect.synopsys.com/detect8.sh", "detect.sh", nil, nil) + return utils.DownloadFile("https://detect.blackduck.com/detect8.sh", "detect.sh", nil, nil) + } else if config.UseDetect9 { + return utils.DownloadFile("https://detect.blackduck.com/detect9.sh", "detect.sh", nil, nil) } - return utils.DownloadFile("https://detect.synopsys.com/detect9.sh", "detect.sh", nil, nil) + return utils.DownloadFile("https://detect.blackduck.com/detect10.sh", "detect.sh", nil, nil) } diff --git a/cmd/detectExecuteScan_generated.go b/cmd/detectExecuteScan_generated.go index 368b026e9f..4b86d352f0 100644 --- a/cmd/detectExecuteScan_generated.go +++ b/cmd/detectExecuteScan_generated.go @@ -78,6 +78,7 @@ type detectExecuteScanOptions struct { RepositoryUsername string `json:"repositoryUsername,omitempty" validate:"required_if=ScanContainerDistro ubuntu ScanContainerDistro centos ScanContainerDistro alpine"` RepositoryPassword string `json:"repositoryPassword,omitempty" validate:"required_if=ScanContainerDistro ubuntu ScanContainerDistro centos ScanContainerDistro alpine"` UseDetect8 bool `json:"useDetect8,omitempty"` + UseDetect9 bool `json:"useDetect9,omitempty"` } type detectExecuteScanInflux struct { @@ -357,7 +358,8 @@ func addDetectExecuteScanFlags(cmd *cobra.Command, stepConfig *detectExecuteScan cmd.Flags().StringVar(&stepConfig.RegistryURL, "registryUrl", os.Getenv("PIPER_registryUrl"), "Used accessing for the images to be scanned (typically filled by CPE)") cmd.Flags().StringVar(&stepConfig.RepositoryUsername, "repositoryUsername", os.Getenv("PIPER_repositoryUsername"), "Used accessing for the images to be scanned (typically filled by CPE)") cmd.Flags().StringVar(&stepConfig.RepositoryPassword, "repositoryPassword", os.Getenv("PIPER_repositoryPassword"), "Used accessing for the images to be scanned (typically filled by CPE)") - cmd.Flags().BoolVar(&stepConfig.UseDetect8, "useDetect8", false, "This flag enables the use of the supported version 8 of the Detect Script instead of v9") + cmd.Flags().BoolVar(&stepConfig.UseDetect8, "useDetect8", false, "This flag enables the use of the supported version 8 of the Detect script instead of default version 10") + cmd.Flags().BoolVar(&stepConfig.UseDetect9, "useDetect9", false, "This flag enables the use of the supported version 9 of the Detect script instead of default version 10") cmd.MarkFlagRequired("token") cmd.MarkFlagRequired("projectName") @@ -958,6 +960,15 @@ func detectExecuteScanMetadata() config.StepData { Aliases: []config.Alias{{Name: "detect/useDetect8"}}, Default: false, }, + { + Name: "useDetect9", + ResourceRef: []config.ResourceReference{}, + Scope: []string{"PARAMETERS", "STAGES", "STEPS"}, + Type: "bool", + Mandatory: false, + Aliases: []config.Alias{{Name: "detect/useDetect9"}}, + Default: false, + }, }, }, Containers: []config.Container{ diff --git a/cmd/detectExecuteScan_test.go b/cmd/detectExecuteScan_test.go index 8b4ac8d1f8..0c0949ef59 100644 --- a/cmd/detectExecuteScan_test.go +++ b/cmd/detectExecuteScan_test.go @@ -310,7 +310,7 @@ func TestRunDetect(t *testing.T) { utilsMock.AddFile("detect.sh", []byte("")) err := runDetect(ctx, detectExecuteScanOptions{}, utilsMock, &detectExecuteScanInflux{}) - assert.Equal(t, utilsMock.downloadedFiles["https://detect.synopsys.com/detect9.sh"], "detect.sh") + assert.Equal(t, utilsMock.downloadedFiles["https://detect.blackduck.com/detect10.sh"], "detect.sh") assert.True(t, utilsMock.HasRemovedFile("detect.sh")) assert.NoError(t, err) assert.Equal(t, ".", utilsMock.Dir, "Wrong execution directory used") diff --git a/pkg/whitesource/configHelper.go b/pkg/whitesource/configHelper.go index 1e21311861..018a9f7b37 100644 --- a/pkg/whitesource/configHelper.go +++ b/pkg/whitesource/configHelper.go @@ -153,7 +153,7 @@ func (c *ConfigOptions) addGeneralDefaults(config *ScanOptions, utils Utils, pro {Name: "forceUpdate", Value: true, Force: true}, {Name: "offline", Value: false, Force: true}, {Name: "resolveAllDependencies", Value: false, Force: false}, - {Name: "failErrorLevel", Value: "ALL", Force: true}, + {Name: "failErrorLevel", Value: "ALL", Force: false}, {Name: "case.sensitive.glob", Value: false}, {Name: "followSymbolicLinks", Value: true}, }...) diff --git a/resources/metadata/detectExecuteScan.yaml b/resources/metadata/detectExecuteScan.yaml index 8f77741ad5..c9498e172c 100644 --- a/resources/metadata/detectExecuteScan.yaml +++ b/resources/metadata/detectExecuteScan.yaml @@ -655,7 +655,7 @@ spec: param: container/repositoryPassword - name: useDetect8 description: - "This flag enables the use of the supported version 8 of the Detect Script instead of v9" + "This flag enables the use of the supported version 8 of the Detect script instead of default version 10" aliases: - name: detect/useDetect8 type: bool @@ -664,6 +664,17 @@ spec: - STAGES - STEPS default: false + - name: useDetect9 + description: + "This flag enables the use of the supported version 9 of the Detect script instead of default version 10" + aliases: + - name: detect/useDetect9 + type: bool + scope: + - PARAMETERS + - STAGES + - STEPS + default: false outputs: resources: - name: influx