RapidBreachResponse-HuntingTasksCount-Widget

Rapid Breach Response dynamic section, will show the updated number of hunting tasks.

python · Rapid Breach Response

Details

IDRapidBreachResponse-HuntingTasksCount-Widget
Languagepython
From Version6.0.0
Docker Imagedemisto/python3:3.12.13.10116658
Tagsdynamic-section

README

Rapid Breach Response dynamic section, will show the updated number of hunting tasks.

Script Data


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

Inputs


There are no inputs for this script.

Outputs


There are no outputs for this script.

import demistomock as demisto  # noqa: F401
from CommonServerPython import *  # noqa: F401

ORANGE_HTML_STYLE = "'color:#EF9700;font-size:48px;padding: 60px; text-align:center;padding-left: 70px'>"
GREEN_HTML_STYLE = "'color:#1DB846;font-size:48px;padding: 60px; text-align:center;padding-left: 70px'>"
GREY_HTML_STYLE = "'color:#404142;font-size:48px;padding: 60px; text-align:center;padding-left: 70px'>"


def main():
    incident = demisto.incidents()
    query = incident[0].get("CustomFields", {}).get("huntingtaskcount", 0)

    if not query:
        html = f"<div style={GREY_HTML_STYLE}{0}</div>"
    elif int(query) == 0:
        html = f"<div style={ORANGE_HTML_STYLE}{query!s}</div>"
    else:
        html = f"<div style={GREEN_HTML_STYLE}{query!s}</div>"

    demisto.results({"ContentsFormat": formats["html"], "Type": entryTypes["note"], "Contents": html})


if __name__ in ["__main__", "builtin", "builtins"]:
    main()