Skip to content

Commit

Permalink
🐛 set upstream config for scans (#1122)
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Milchev <[email protected]>
  • Loading branch information
imilchev authored Feb 16, 2024
1 parent 95d52fc commit 61eddc9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/cnspec/cmd/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,8 @@ func getCobraScanConfig(cmd *cobra.Command, runtime *providers.Runtime, cliRes *
conf.Inventory.ApplyCategory(inventory.AssetCategory_CATEGORY_CICD)
}

var serviceAccount *upstream.ServiceAccountCredentials
serviceAccount := opts.GetServiceCredential()

serviceAccount = opts.GetServiceCredential()
// NOTE: even if we have incognito, we want to set the upstream config. Otherwise we would not be able to
// use the policies that are defined in Mondoo Platform
if serviceAccount != nil {
Expand All @@ -287,6 +286,7 @@ func getCobraScanConfig(cmd *cobra.Command, runtime *providers.Runtime, cliRes *
Incognito: conf.IsIncognito,
Creds: serviceAccount,
}
providers.DefaultRuntime().UpstreamConfig = conf.runtime.UpstreamConfig
} else {
log.Warn().Msg("No credentials provided. Switching to --incognito mode.")
conf.IsIncognito = true
Expand Down

0 comments on commit 61eddc9

Please sign in to comment.