AlgosecQuery

Performs a batch traffic simulation query using Firewall Analyzer.

python · AlgoSec

Source

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


def algosec_query():
    resp = demisto.executeCommand("algosec-query", demisto.args())

    if isError(resp[0]):
        result = resp
    else:
        data = demisto.get(resp[0], "Contents.QueryResponse.QueryResult")
        if data:
            data = data if isinstance(data, list) else [data]
            data = flattenTable(data)
            result = {"ContentsFormat": formats["table"], "Type": entryTypes["note"], "Contents": data}
        else:
            result = "No results."
    return_results(result)


def main():  # pragma: no cover
    try:
        algosec_query()
    except Exception as e:
        err_msg = f"Encountered an error while running the script: [{e}]"
        return_error(err_msg, error=e)


if __name__ in ("__main__", "__builtin__", "builtins"):
    main()

README

Performs a batch traffic simulation query using Firewall Analyzer.

Script Data


Name Description
Script Type python
Tags Algosec

Dependencies


This script uses the following commands and scripts.

  • algosec-query

Inputs


Argument Name Description
source The source(s) for the query. Multiple values must be comma-separated.
destination The destination(s) for the query. Multiple values must be comma-separated.
service The service(s) for the query. Multiple values must be comma-separated.
user The user for the query.
application The application for the query.

Outputs


There are no outputs for this script.