Skip to content

Commit

Permalink
Merge pull request #3458 from mercedes-benz/feature-3392-client-warni…
Browse files Browse the repository at this point in the history
…ng-addScmHistory-non-compatible-scantypes

warn on -addScmHistory but no secretScan #3392
  • Loading branch information
sven-dmlr authored Sep 26, 2024
2 parents 42495ed + 0233408 commit 5586340
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions sechub-cli/src/mercedes-benz.com/sechub/cli/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,9 @@ func assertValidConfig(context *Context) {
if !validateOutputLocation(context.config) {
errorsFound = true
}
if context.config.addSCMHistory {
validateAddScmHistory(context)
}

if context.config.action == interactiveMarkFalsePositivesAction && context.config.file == "" {
// Let's try to find the latest report (default naming scheme) and take this as file
Expand Down Expand Up @@ -510,3 +513,9 @@ func validateMaximumNumberOfCMDLineArgumentsOrCapAndWarning() {
sechubUtil.LogWarning(fmt.Sprintf("Too many commandline arguments. Capping to %d.", MaximumNumberOfCMDLineArguments))
}
}

func validateAddScmHistory(context *Context) {
if context.config.addSCMHistory && len(context.sechubConfig.SecretScan.Use) == 0 {
sechubUtil.LogWarning("You chose to append the SCM history but have configured no secretScan. The SCM history is not uploaded to SecHub.")
}
}

0 comments on commit 5586340

Please sign in to comment.