File size: 899 Bytes
b8e821a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from typing import Any, Optional
from smolagents.tools import Tool
import requests

class CveTriageTool(Tool):
    name = "cve_patch_priority"
    description = "Kevscope by CyberMax: patch-priority verdict for up to 20 CVE IDs from CISA KEV (known exploited), FIRST EPSS exploit probability, CVSS and ransomware use, with the reasons. Free tier, no key; paid keys at https://kevscope-api.cybermax-tools.workers.dev/docs"
    inputs = {'cves': {'type': 'string', 'description': "Comma-separated CVE IDs, e.g. 'CVE-2024-3400,CVE-2023-4966'"}}
    output_type = "object"

    def forward(self, cves: str):
        import requests
        r = requests.get("https://kevscope-api.cybermax-tools.workers.dev/api/priority",
                         params={"cve": cves, "via": "smolagents"}, timeout=30)
        return r.json()

    def __init__(self, *args, **kwargs):
        self.is_initialized = False