CreatePrismaCloudComputeComplianceReportButton

Generate a compliance report via button.

python · Prisma Cloud Compute by Palo Alto Networks

Details

IDCreatePrismaCloudComputeComplianceReportButton
Languagepython
From Version6.0.0
Docker Imagedemisto/python3:3.12.13.10116658

README

Generate a compliance report via clicking a button.

Script Data


Name Description
Script Type python3
Cortex XSOAR Version 6.0.0

Inputs


Argument Name Description
table The table of data.
title The title of the report.
to The to email address.

Outputs


There are no outputs for this script.

Script Examples

Example command

!CreatePrismaCloudComputeComplianceReportButton title=test to=test@paloaltonetworks.com table=`{"cve": "cve-123456"}`

Context Example

{}

Human Readable Output

Mail sent successfully

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


def main():
    args = demisto.args()

    try:
        res = demisto.executeCommand("ConvertTableToHTML", {"table": args.get("table"), "title": args.get("title")})

        if is_error(res):
            raise DemistoException(f"Failed to create compliance report: {get_error(res)!s}")

        html = res[0]["EntryContext"]["HTMLTable"]

        body = f"""
        Hello,

        Please see below the details for the compliance report from Prisma Cloud Compute

        {html}

        - DBot
        """

        res = demisto.executeCommand(
            "send-mail", {"to": args.get("to"), "subject": "IMPORTANT: Prisma Cloud Compute Compliance", "body": body}
        )

        if is_error(res):
            raise DemistoException(f"Failed to create compliance report: {get_error(res)!s}")

        demisto.results(res)
        return_results(CommandResults(readable_output=res[0]["Contents"]))

    except Exception as e:
        return_error(e)


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