Skip to content

KaanSK/go-epss

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go-EPSS

A Golang library for interacting with the EPSS (Exploit Prediction Scoring System).

Data Set

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.

Key Features

  • 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.

Getting Started

  1. Install Go-EPSS package:
    go get github.com/KaanSK/go-epss
  2. Import the package and create a client with default values:
    import (
        "github.com/KaanSK/go-epss"
    )
    
    client := epss.NewClient()
    ...

Providing Client Options and Custom *http.Client

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),
)

Getting All Score List

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)
}
...

Getting Individual Score for CVE ID

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)
...

Test & Benchmarks

To run tests only:

go test -v -run Test

To run benchmarks only (will fetch remote data):

go test -bench=.

Disclaimer

About

A Golang library for interacting with the EPSS (Exploit Prediction Scoring System).

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages