DataminrPulseCVSSColor
This dynamic automation parses the CVSS Score of a CVE and presents it in the layout with color.
python · Dataminr Pulse
Details
| ID | DataminrPulseCVSSColor |
|---|---|
| Language | python |
| From Version | 6.10.0 |
| Docker Image | demisto/python3:3.12.13.10116658 |
| Tags | dynamic-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**)"