Skip to content

🚨 KEV

The kev module queries the CISA Known Exploited Vulnerabilities (KEV) catalog — the list of vulnerabilities confirmed to have been actively exploited. Under BOD 22-01, federal agencies must remediate listed vulnerabilities by their due dates. The client caches the full catalog locally and can enrich VulnerabilityFinding records with KEV status.

Constant

go
const DefaultKEVBaseURL = "https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json"

Type: KEVClient

go
type KEVClient struct {
    BaseURL    string        // KEV catalog JSON URL
    HTTPClient *http.Client  // HTTP client
    // unexported: cache, allCache, cacheExpiry, mu, lastRequestTime, minRequestInterval (1s rate limit)
}

NewKEVClient sets a 30-second timeout and a 1-second minimum request interval, caching entries by CVE ID and the full catalog.

Type: KEVEntry

go
type KEVEntry struct {
    CVEID                      string   `json:"cveID"`
    VendorProject              string   `json:"vendorProject"`
    Product                    string   `json:"product"`
    VulnerabilityName          string   `json:"vulnerabilityName"`
    DateAdded                  string   `json:"dateAdded"`
    ShortDescription           string   `json:"shortDescription"`
    RequiredAction             string   `json:"requiredAction"`
    DueDate                    string   `json:"dueDate"`
    KnownRansomwareCampaignUse string   `json:"knownRansomwareCampaignUse"`
    Notes                      string   `json:"notes"`
    CWEs                       []string `json:"cwes,omitempty"`
}

A single KEV catalog entry.

Type: KEVResponse

go
type KEVResponse struct {
    Title           string      `json:"title"`
    CatalogVersion  string      `json:"catalogVersion"`
    DateReleased    string      `json:"dateReleased"`
    Count           int         `json:"count"`
    Vulnerabilities []*KEVEntry `json:"vulnerabilities"`
}

The full KEV catalog response.

🆕 NewKEVClient

go
func NewKEVClient() *KEVClient

Creates a KEVClient pointed at DefaultKEVBaseURL with a 30-second timeout and 1-second rate limiting.

ReturnTypeDescription
#1*KEVClientNew KEV client
go
client := cpeskills.NewKEVClient()

🆕 NewKEVClientWithOptions

go
func NewKEVClientWithOptions(baseURL string, timeout time.Duration) *KEVClient

Creates a KEVClient with a custom base URL and timeout. Empty baseURL and non-positive timeout fall back to defaults.

ParameterTypeDescription
baseURLstringKEV catalog URL; "" for default
timeouttime.DurationHTTP timeout; <=0 for default (30s)
ReturnTypeDescription
#1*KEVClientNew KEV client
go
client := cpeskills.NewKEVClientWithOptions("", 60*time.Second)

✅ IsListed

go
func (c *KEVClient) IsListed(cveID string) (bool, error)

Returns whether the CVE is present in the KEV catalog.

ParameterTypeDescription
cveIDstringCVE identifier
ReturnTypeDescription
#1booltrue if listed in KEV
#2errorQuery/load error
go
listed, err := client.IsListed("CVE-2021-44228")

📋 GetEntry

go
func (c *KEVClient) GetEntry(cveID string) (*KEVEntry, error)

Returns the KEV entry for a CVE, or nil (no error) when it is not listed.

ParameterTypeDescription
cveIDstringCVE identifier
ReturnTypeDescription
#1*KEVEntryThe matching entry, nil if not listed
#2errorQuery/load error
go
entry, err := client.GetEntry("CVE-2021-44228")

📋 GetEntries

go
func (c *KEVClient) GetEntries(cveIDs []string) (map[string]*KEVEntry, error)

Returns KEV entries for multiple CVEs, keyed by CVE ID. Unlisted CVEs are omitted from the map.

ParameterTypeDescription
cveIDs[]stringCVE identifiers
ReturnTypeDescription
#1map[string]*KEVEntryCVE ID -> entry (only listed ones)
#2errorQuery/load error
go
entries, err := client.GetEntries([]string{"CVE-2021-44228", "CVE-2021-40444"})

📚 GetAll

go
func (c *KEVClient) GetAll() ([]*KEVEntry, error)

Returns the entire KEV catalog, loading and caching it on first access.

ReturnTypeDescription
#1[]*KEVEntryAll KEV entries
#2errorLoad error
go
all, err := client.GetAll()
fmt.Printf("%d KEV entries\n", len(all))

✨ EnrichVulnerabilityFinding

go
func (c *KEVClient) EnrichVulnerabilityFinding(finding *VulnerabilityFinding) error

Sets finding.KEVListed based on whether the finding's CVE is in the KEV catalog.

ParameterTypeDescription
finding*VulnerabilityFindingFinding to enrich (modified in place)
ReturnTypeDescription
#1errorQuery/load error
go
err := client.EnrichVulnerabilityFinding(finding)

✨ EnrichVulnerabilityFindings

go
func (c *KEVClient) EnrichVulnerabilityFindings(findings []*VulnerabilityFinding) error

Batch-enriches multiple findings using a single catalog load.

ParameterTypeDescription
findings[]*VulnerabilityFindingFindings to enrich
ReturnTypeDescription
#1errorLoad error
go
err := client.EnrichVulnerabilityFindings(findings)

📅 GetDueDate

go
func (c *KEVClient) GetDueDate(cveID string) (string, error)

Returns the BOD 22-01 remediation due date for a listed CVE, or an error if not listed.

ParameterTypeDescription
cveIDstringCVE identifier
ReturnTypeDescription
#1stringDue date (as published in the catalog)
#2errorError if not listed
go
due, err := client.GetDueDate("CVE-2021-44228")

🦠 IsRansomwareRelated

go
func (c *KEVClient) IsRansomwareRelated(cveID string) (bool, error)

Returns whether the CVE is flagged as associated with a known ransomware campaign.

ParameterTypeDescription
cveIDstringCVE identifier
ReturnTypeDescription
#1booltrue if ransomware-related
#2errorError if not listed
go
rw, err := client.IsRansomwareRelated("CVE-2021-44228")

🛠️ GetRequiredAction

go
func (c *KEVClient) GetRequiredAction(cveID string) (string, error)

Returns the required remediation action for a listed CVE, or an error if not listed.

ParameterTypeDescription
cveIDstringCVE identifier
ReturnTypeDescription
#1stringRequired action text
#2errorError if not listed
go
action, err := client.GetRequiredAction("CVE-2021-44228")

🔢 Count

go
func (c *KEVClient) Count() (int, error)

Returns the total number of entries in the KEV catalog.

ReturnTypeDescription
#1intEntry count
#2errorLoad error
go
n, err := client.Count()

🔍 FilterByVendor

go
func (c *KEVClient) FilterByVendor(vendor string) ([]*KEVEntry, error)

Returns all KEV entries whose VendorProject matches vendor.

ParameterTypeDescription
vendorstringVendor name to match
ReturnTypeDescription
#1[]*KEVEntryMatching entries
#2errorLoad error
go
ms, err := client.FilterByVendor("Microsoft")

🔍 FilterByProduct

go
func (c *KEVClient) FilterByProduct(product string) ([]*KEVEntry, error)

Returns all KEV entries whose Product matches product.

ParameterTypeDescription
productstringProduct name to match
ReturnTypeDescription
#1[]*KEVEntryMatching entries
#2errorLoad error
go
entries, err := client.FilterByProduct("Exchange Server")

🧹 ClearCache

go
func (c *KEVClient) ClearCache()

Empties the KEV entry cache and full-catalog cache, forcing the next query to reload the catalog.

go
client.ClearCache()

⬆️ KEVSeverityBoost

go
func KEVSeverityBoost(currentSeverity string) string

Returns a severity one level higher than currentSeverity, reflecting the elevated risk of a KEV-listed vulnerability: LowMedium, MediumHigh, HighCritical, CriticalCritical. Unknown inputs return High.

ParameterTypeDescription
currentSeveritystringCurrent severity label
ReturnTypeDescription
#1stringBoosted severity label
go
cpeskills.KEVSeverityBoost("Medium") // High
cpeskills.KEVSeverityBoost("High")   // Critical

🧭 KEV Query Flow

Released under the MIT License.