A Golang library for interacting with the EPSS (Exploit Prediction Scoring System).
EPSS (Exploit Prediction Scoring System) is a framework used to assess the likelihood of a vulnerability being exploited. FIRST organization regularly updates and publishes this data through their website.
- Fetch latest EPSS data directly from source;
- Local EPSS querying interface instead of FIRST remote API;
- Access individual CVE scores;
- Manage update intervals to ensure fresh data;
- Leverages Golang's concurrency features for efficient performance;
- Custom
*http.Client
can be injected.
- Install
Go-EPSS
package:go get github.com/KaanSK/go-epss
- Import the package and create a client with default values:
import ( "github.com/KaanSK/go-epss" ) client := epss.NewClient() ...
import (
"github.com/KaanSK/go-epss"
)
client := epss.NewClient(
epss.WithHTTPClient(&http.Client{Timeout: 10 * time.Second,}),
epss.WithDataURL("test.com"),
epss.WithUpdateInterval(10 * time.Minute),
)
Use the client to retrieve scores:
scores, err := client.GetAllScores()
if err != nil {
// Handle error
}
for _, score := range scores {
fmt.Printf("CVE: %s, EPSS: %.4f, Percentile: %.4f\n", score.CVE, score.EPSS, score.Percentile)
}
...
Use the client to retrieve individual CVE score:
score, err := client.GetScore("CVE-1999-0002")
if err != nil {
// Handle error
}
fmt.Printf("CVE: %s, EPSS: %.4f, Percentile: %.4f\n", score.CVE, score.EPSS, score.Percentile)
...
To run tests only:
go test -v -run Test
To run benchmarks only (will fetch remote data):
go test -bench=.
- EPSS data retrieved from FIRST organization. As of the projects publishing date, data is open-sourced and available for individual projects.