fleet/ee/server/webhooks/mapper.go
Juan Fernandez 009a87d33e
Feature 10196: Add filepath to end-points and third party integrations (#11285)
Adds the software installed path property to the proper end-points and third party integrations (webhook, Zendesk and Jira).
2023-05-17 16:53:15 -04:00

35 lines
645 B
Go

package webhooks
import (
"net/url"
"github.com/fleetdm/fleet/v4/server/fleet"
fleetwebhooks "github.com/fleetdm/fleet/v4/server/webhooks"
)
type Mapper struct {
fleetwebhooks.Mapper
}
func NewMapper() fleetwebhooks.VulnMapper {
return &Mapper{}
}
func (m *Mapper) GetPayload(
hostBaseURL *url.URL,
hosts []fleet.HostVulnerabilitySummary,
cve string,
meta fleet.CVEMeta,
) fleetwebhooks.WebhookPayload {
r := m.Mapper.GetPayload(hostBaseURL,
hosts,
cve,
meta,
)
r.EPSSProbability = meta.EPSSProbability
r.CVSSScore = meta.CVSSScore
r.CISAKnownExploit = meta.CISAKnownExploit
r.CVEPublished = meta.Published
return r
}