DisplayCVEChartScript

Display bar chart based on cves count and trending cves count with the different colors.

python · RiskSense

Details

IDDisplayCVEChartScript
Languagepython
From Version5.0.0
Docker Imagedemisto/python3:3.12.13.10116658
TagsRiskSense

README

Display bar chart based on cves count and trending cves count with the different colors.

Script Data


Name Description
Script Type python3
Cortex XSOAR Version 5.0.0

Inputs


Argument Name Description
CvesCount The number of CVEs.
TrendingCvesCount The number of trending CVEs.

Outputs


There are no outputs for this script.

import pytest

import demistomock as demisto

CVE_CONTEXT = [
    {
        "Cve": "CVE-0000-0000",
        "CVSS": 7.5,
        "VRR": 5.67,
        "ThreatCount": 1,
        "Trending": "false",
        "VulnLastTrendingOn": "2018-05-01",
        "Description": "remote code execution",
        "Threats": [
            {
                "Title": "Hunter Exploit Kit",
                "Category": "Ransomware",
                "Severity": "null",
                "Description": "",
                "Cve": ["CVE-0000-0000"],
                "Source": "MCAFEE",
                "Published": "2017-08-03T00:00:00",
                "Updated": "2019-08-16T15:50:04",
                "ThreatLastTrendingOn": "2018-02-23",
                "Trending": "false",
            }
        ],
    }
]


def test_display_chart(mocker):
    from RiskSenseDisplayCVEChartScript import display_cve_chart

    mocker.patch.object(demisto, "get", return_value=CVE_CONTEXT[0])
    try:
        display_cve_chart()
    except Exception:
        pytest.fail("Unexpected MyError ..")