mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 17:08:53 +00:00
Just log the error if vulnerabilities fail (#3963)
* Just log the error if vulnerabilities fail * Add explicit return for more secure future iterations
This commit is contained in:
parent
ab8cb8ceb5
commit
66976080ae
1 changed files with 17 additions and 13 deletions
|
|
@ -706,19 +706,7 @@ func cronVulnerabilities(
|
|||
}
|
||||
|
||||
if !vulnDisabled {
|
||||
err := vulnerabilities.TranslateSoftwareToCPE(ctx, ds, vulnPath, logger, config)
|
||||
if err != nil {
|
||||
level.Error(logger).Log("msg", "analyzing vulnerable software: Software->CPE", "err", err)
|
||||
sentry.CaptureException(err)
|
||||
continue
|
||||
}
|
||||
|
||||
err = vulnerabilities.TranslateCPEToCVE(ctx, ds, vulnPath, logger, config)
|
||||
if err != nil {
|
||||
level.Error(logger).Log("msg", "analyzing vulnerable software: CPE->CVE", "err", err)
|
||||
sentry.CaptureException(err)
|
||||
continue
|
||||
}
|
||||
checkVulnerabilities(ctx, ds, logger, vulnPath, config)
|
||||
}
|
||||
|
||||
if err := ds.CalculateHostsPerSoftware(ctx, time.Now()); err != nil {
|
||||
|
|
@ -731,6 +719,22 @@ func cronVulnerabilities(
|
|||
}
|
||||
}
|
||||
|
||||
func checkVulnerabilities(ctx context.Context, ds fleet.Datastore, logger kitlog.Logger, vulnPath string, config config.FleetConfig) {
|
||||
err := vulnerabilities.TranslateSoftwareToCPE(ctx, ds, vulnPath, logger, config)
|
||||
if err != nil {
|
||||
level.Error(logger).Log("msg", "analyzing vulnerable software: Software->CPE", "err", err)
|
||||
sentry.CaptureException(err)
|
||||
return
|
||||
}
|
||||
|
||||
err = vulnerabilities.TranslateCPEToCVE(ctx, ds, vulnPath, logger, config)
|
||||
if err != nil {
|
||||
level.Error(logger).Log("msg", "analyzing vulnerable software: CPE->CVE", "err", err)
|
||||
sentry.CaptureException(err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
func cronWebhooks(ctx context.Context, ds fleet.Datastore, logger kitlog.Logger, identifier string, failingPoliciesSet fleet.FailingPolicySet) {
|
||||
appConfig, err := ds.AppConfig(ctx)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Reference in a new issue