Skip to content

Commit 1b033a3

Browse files
Merge pull request #59 from deepfence/ISSUE-1700
ISSUE-1700: Fixing the vulnerability scans for registries with no credentials.
2 parents 739a02d + f1e9f24 commit 1b033a3

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

sbom/syft/syft.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ func GenerateSBOM(ctx context.Context, config utils.Config) ([]byte, error) {
182182
syftArgs = append(syftArgs, buildCatalogersArg(config.ScanType, isRegistry)...)
183183
}
184184

185-
if config.RegistryCreds.AuthFilePath != "" {
185+
if config.IsRegistry {
186186
if !strings.HasPrefix(syftArgs[1], registryPrefix) {
187187
syftArgs[1] = registryPrefix + syftArgs[1]
188188
}

utils/type.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ type Config struct {
3838
GrypeConfigPath string `json:"grype_config_path,omitempty"`
3939
KeepSbom bool `json:"keep_sbom,omitempty"`
4040
RegistryCreds RegistryCreds `json:"registry_creds,omitempty"`
41+
IsRegistry bool `json:"is_registry,omitempty"`
4142
}
4243

4344
type RegistryCreds struct {

0 commit comments

Comments
 (0)