1. Overview

Prisma Cloud offers native integration with a number of services, including email, JIRA, and Slack. When no native integration is available, webhooks provide a mechanism to interface Prisma Cloud’s alert system with virtually any third party service.

A webhook is an HTTP callback. When an event occurs, Prisma Cloud notifies your web service with an HTTP POST request. The request contains an JSON body that you configure when you set up the webhook. A webhook configuration consists of:

  • URL,

  • Custom JSON body,

  • Username,

  • Password,

  • CA Certificate.

2. Custom JSON body

You can customize the body of the POST request with values of interest. The content of the JSON object in the request body is defined using predefined macros. For example:

{
  "type":#type,
  "host":#host,
  "details":#message
}

When an event occurs, Prisma Cloud replaces the macros in your custom JSON with real values, and then submits the request.

{
  "type":"ContainerRuntime",
  "host":"host1",
  "details":"/bin/cp changed binary /bin/busybox MD5:XXXXXXX"
}

All supported macros are described in the following table. Not all macros are applicable to all alert types.

Rule Description

#type

Audit alert type. For example, 'Container Runtime'.

#time

Audit alert time. For example, 'Jan 21, 2018 UTC'.

#container

Impacted container.

#image

Impacted image.

#host

Hostname for the host where the audit occurred.

#fqdn

Fully qualified domain name for the host where the audit occurred.

#function

Serverless function where the audit occurred.

#region

Region where the audit occurred. For example 'N. Virginia'.

#runtime

Language runtime in which the audit occurred. For example, 'python3.6'.

#appID

Serverless or Function name.

#rule

Rule which triggered the alert.

#message

Associated alert message.

#aggregated

All fields in the audit message as a single JSON object.

#rest

All subsequent alerts that occurred during the aggregation period, in JSON format.

2.1. Configuring alert frequency

You can configure the rate at which alerts are emitted. This is a global setting that controls the spamminess of the alert service. Alerts received during the specified period are aggregated into a single alert. For each alert profile, an alert is sent as soon as the first matching event is received. All subsequent alerts are sent once per period.

  1. Open Console, and go to Manage > Alerts.

  2. In Aggregate audits every, specify the maximum rate that alerts should be sent.

    You can specify Second, Minute, Hour, Day.

    frag configure alerts

3. Sending alerts to a webhook

Alert profiles specify which events should trigger the alert machinery, and to which channel alerts are sent. You can send alerts to any combination of channels by creating multiple alert profiles.

Alert profiles consist of two parts:

(1) Alert settings — Who should get the alerts, and on what channel? Configure Prisma Cloud to integrate with your messaging service and specify the people or places where alerts should be sent. For example, configure the email channel and specify a list of all the email addresses where alerts should be sent. Or for JIRA, configure the project where the issue should be created, a long with the type of issue, priority, assignee, and so on.

(2) Alert triggers — Which events should trigger an alert to be sent? Specify which of the rules that make up your overall policy should trigger alerts.

webhook config

If you use multi-factor authentication, you must create an exception or app-specific password to allow Console to authenticate to the service.

4. Create new alert channel

Create a new alert channel.

Prerequisites: You have a service to accept Prisma Cloud’s callback. For purely testing purposes, consider PostBin or RequestBin.

  1. In Manage > Alerts, click Add profile.

  2. Enter a name for your alert profile.

  3. In Provider, select Webhook.

5. Configure the channel

Configure the channel.

  1. In Webhook incoming URL, enter the endpoint where Prisma Cloud should submit the alert.

  2. In Custom JSON, Enter the structure of the JSON payload that your web application is expecting.

    For more details about the type of data in each field, click Show macros.

  3. (Optional) In Credential, specify a basic auth credential if your endpoint requires authentication.

  4. (Optional) In CA Certificate, enter a CA cert in PEM format.

    When using a CA cert to secure communication, only one-way SSL authentication is supported. If two-way SSL authentication is configured, alerts will not be sent.
  5. Click Send Test Alert to test the connection. An alert is sent immediately.

5.1. Configure the triggers

Configure how the alert is triggered.

  1. Under Alert Types, check the boxes types of events that should trigger an alert.

  2. For additional configuration options, click Edit.

  3. To specify specific rules that should trigger an alert, deselect All rules, and then select any individual rules.

    frag config triggers
  4. Click Save.