Skip to content

Commit

Permalink
fix: mapping for api logging and return for not found vulnr details
Browse files Browse the repository at this point in the history
Signed-off-by: Frank Jogeleit <frank.jogeleit@web.de>
  • Loading branch information
fjogeleit committed Feb 11, 2025
1 parent c87978d commit 93f89b6
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion plugins/trivy/pkg/logging/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

type Config struct {
API bool `mapstructure:"enabled"`
API bool `mapstructure:"api"`
Server bool `mapstructure:"enabled"`
LogLevel int8 `mapstructure:"logLevel"`
Encoding string `mapstructure:"encoding"`
Expand Down
1 change: 0 additions & 1 deletion plugins/trivy/pkg/server/vulnr/v1/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ func (h *APIHandler) List(ctx *gin.Context) {
return fmt.Errorf("%s: %w", p.Name, err)
}

zap.L().Debug("vulnr details found", zap.String("name", p.Name))
v.Category = p.Category
v.Severity = p.Severity

Expand Down
1 change: 1 addition & 0 deletions plugins/trivy/pkg/vulnr/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ func (s *Service) Get(ctx context.Context, name string) (*Vulnerability, error)
trivyCVE, err := s.db.Get(name)
if err != nil {
zap.L().Warn("unable to load CVE from TrivyDB", zap.String("cve", name), zap.Error(err))
return &Vulnerability{ID: name, Title: name}, nil
}

details = MapFromTrivyDB(name, trivyCVE)
Expand Down

0 comments on commit 93f89b6

Please sign in to comment.