Skip to content

Commit 6a7684f

Browse files
authored
feat: Add EPSS to Dependabot alerts (#3547)
1 parent 6f8bcef commit 6a7684f

File tree

4 files changed

+34
-0
lines changed

4 files changed

+34
-0
lines changed

github/dependabot_alerts.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@ type AdvisoryCWEs struct {
2929
Name *string `json:"name,omitempty"`
3030
}
3131

32+
// AdvisoryEPSS represents the advisory pertaining to the Exploit Prediction Scoring System.
33+
//
34+
// For more information, see:
35+
// https://github.blog/changelog/2024-10-10-epss-scores-in-the-github-advisory-database/
36+
type AdvisoryEPSS struct {
37+
Percentage float64 `json:"percentage"`
38+
Percentile float64 `json:"percentile"`
39+
}
40+
3241
// DependabotSecurityAdvisory represents the GitHub Security Advisory.
3342
type DependabotSecurityAdvisory struct {
3443
GHSAID *string `json:"ghsa_id,omitempty"`
@@ -39,6 +48,7 @@ type DependabotSecurityAdvisory struct {
3948
Severity *string `json:"severity,omitempty"`
4049
CVSS *AdvisoryCVSS `json:"cvss,omitempty"`
4150
CWEs []*AdvisoryCWEs `json:"cwes,omitempty"`
51+
EPSS *AdvisoryEPSS `json:"epss,omitempty"`
4252
Identifiers []*AdvisoryIdentifier `json:"identifiers,omitempty"`
4353
References []*AdvisoryReference `json:"references,omitempty"`
4454
PublishedAt *Timestamp `json:"published_at,omitempty"`

github/dependabot_alerts_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,10 @@ func TestDependabotSecurityAdvisory_Marshal(t *testing.T) {
281281
Name: Ptr("Exposure of Sensitive Information to an Unauthorized Actor"),
282282
},
283283
},
284+
EPSS: &AdvisoryEPSS{
285+
Percentage: 0.05,
286+
Percentile: 0.5,
287+
},
284288
Identifiers: []*AdvisoryIdentifier{
285289
{
286290
Type: Ptr("GHSA"),
@@ -353,6 +357,10 @@ func TestDependabotSecurityAdvisory_Marshal(t *testing.T) {
353357
"name": "Exposure of Sensitive Information to an Unauthorized Actor"
354358
}
355359
],
360+
"epss": {
361+
"percentage": 0.05,
362+
"percentile": 0.5
363+
},
356364
"identifiers": [
357365
{
358366
"type": "GHSA",

github/github-accessors.go

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github/github-accessors_test.go

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)