DataminrPulseCVSSColor

This dynamic automation parses the CVSS Score of a CVE and presents it in the layout with color.

python · Dataminr Pulse

Details

IDDataminrPulseCVSSColor
Languagepython
From Version6.10.0
Docker Imagedemisto/python3:3.12.13.10116658
Tagsdynamic-indicator-section

README

This dynamic automation parses the CVSS Score of a CVE and presents it in the layout with color.

Script Data


Name Description
Script Type python3
Tags dynamic-indicator-section
Cortex XSOAR Version 6.10.0

Inputs


There are no inputs for this script.

Outputs


There are no outputs for this script.

from CommonServerPython import *  # noqa: F401
from DataminrPulseCVSSColor import main, demisto


def test_main_with_valid_cvss_score_data(mocker):
    """
    Test the main function with valid cvss score.
    """

    context = {
        "args": {"indicator": {"CustomFields": {"cvssscore": "7.1"}}},
    }

    mocker.patch.object(demisto, "callingContext", context)

    mock_return = mocker.patch("DataminrPulseCVSSColor.return_results")

    main()

    assert mock_return.call_args.args[0].readable_output == "# <-:->{{color:#E1211E}}(**7.1**)"


def test_main_with_no_cvss_score_data(mocker):
    """
    Test the main function with no cvss score data.
    """
    context: dict = {
        "args": {"indicator": {"CustomFields": {}}},
    }

    mocker.patch.object(demisto, "callingContext", context)

    mock_return = mocker.patch("DataminrPulseCVSSColor.return_results")

    main()

    assert mock_return.call_args.args[0].readable_output == "# <-:->{{color:#CDCED6}}(**N/A**)"