PAN-OS 8.0 HTTP Log Integration with Slack

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
L3 Networker
100% helpful (3/3)

PAN-OS 8.0 HTTP Log Integration with Slack

 

This document assumes that you have already created a Slack team. This sample integration was done with a free Slack account. 

 

Once you have created your Slack team, login to your slack account and add an “Incoming Webhooks” custom integration on the slack website.  During that configuration, you will select the channel where the message will be broadcast (#general in this example).  You will also receive a Webhook URL, and an opportunity to customize the Name and Icon for the source of the message. 

 

Here’s a screenshot of the Incoming Webhooks configuration on the slack website: 

 

 

Slack Integration Settings.png

  

Next, configure an HTTP Server Profile in PAN-OS 8.0.  Use the first part of the Webhooks URL in the “Address” field.  In this example, it is “hooks.slack.com” using HTTPS on 443 with the POST HTTP method.  Username/Password are not required for this particular integration. 

HTTP Server Profile Entry Name.png

 

 Personally, I was interested in specific “system” events, so this document focuses on the system-level logs.  Similar integrations could easily be done with traffic, threat, and/or URL logs. 

HTTP Server Profile Payload Format.png

  

This is what the System format looks like:

Slack System Payload Format.png

 

 

In the URI Format box, provide the URI portion of the Slack-provided Incoming Webhooks URL, beginning with /service

 

The content-type must be application/json

 

Leave the Parameters field blank.

 

The Payload input box accepts the default Slack-preferred JSON format as documented here:  https://api.slack.com/incoming-webhooks

 

No additional escaping is required to add the PAN-OS provided variables to the payload.  In this example, I’m using a rich-formatted “attachments” message from Slack, although the basic format works perfectly as well. 

 

Here are two samples that you should be able to cut and paste:

 

Rich Format Message:

 

{

    "attachments": [

        {

            "fallback": "$time_generated $device_name reports $severity $subtype event:\n $opaque\n--------",

            "text": "$time_generated: <https://pa0.example.com|pa0> reports $severity $subtype event:\n$opaque",

            "color": "danger"

        }

    ]

}

 

 

Simple Format Message:

 

{

    "text": "$time_generated $device_name reports $severity $subtype event:\n $opaque\n--------"

}

 

Since I was mainly interested in system-level events, I tied it all together in the Device / Log Settings tab.  I haven’t narrowed-down exactly what I want to see in the slack channel, but for the purposes of this test, I wanted to see non-informational ha or crypto events, so used the following system log filter:

 

(( subtype eq ha ) or (subtype eq crypto)) and ( severity neq informational )

 

I matched that with the “Slack System Event 1” created earlier.  The configuration looks like this:Log Settings System Configuration.png

 

Here’s what I see on my desktop in the Slack app when I initiate a manual HA state change via the PAN-OS GUI:Slack app notification from PAN-OS.png

 

 

Looks good on the phone too:Slack app Mobile View.pngCreated by Jared Valentine - Systems Engineer

Rate this article:
(3)
Comments
L2 Linker

Nice articel! I just tried to follow theser steps, unfortunately my PA-200 say:

Failed to send HTTP request: hooks.slack.com: Peer certificate cannot be authenticated with given CA certificates
 
Not sure what's the rootcause, I used that slack account with NTOP before and just verified with curl from a Linux machine that the webhook does work.
 
I'll keep trying 🙂
L0 Member

what PAN OS version you are using?

L2 Linker

Sorry, didn't repor


@rkemburu wrote:

PAN-OS 8.0 HTTP Log Integration with Slack

 

This document assumes that you have already created a Slack team.  This sample integration was done with a free Slack account. 

 

Once you have created your Slack team, login to your slack account and add an “Incoming Webhooks” custom integration on the slack website.  During that configuration, you will select the channel where the message will be broadcast (#general in this example).  You will also receive a Webhook URL, and an opportunity to customize the Name and Icon for the source of the message. 

 

Here’s a screenshot of the Incoming Webhooks configuration on the slack website: 

 

 

Picture71.png

  

Next, configure an HTTP Server Profile in PAN-OS 8.0.  Use the first part of the Webhooks URL in the “Address” field.  In this example, it is “hooks.slack.com” using HTTPS on 443 with the POST HTTP method.  Username/Password are not required for this particular integration. 

Picture72.png

 

 Personally, I was interested in specific “system” events, so this document focuses on the system-level logs.  Similar integrations could easily be done with traffic, threat, and/or URL logs. 

Picture73.png

  

This is what the System format looks like:

Picture74.png

 

 

 

In the URI Format box, provide the URI portion of the Slack-provided Incoming Webhooks URL, beginning with /service

 

The content-type must be application/json

 

Leave the Parameters field blank.

 

The Payload input box accepts the default Slack-preferred JSON format as documented here:  https://api.slack.com/incoming-webhooks

 

No additional escaping is required to add the PAN-OS provided variables to the payload.  In this example, I’m using a rich-formatted “attachments” message from Slack, although the basic format works perfectly as well. 

 

Here are two samples that you should be able to cut&paste:

 

Rich Format Message:

 

{

    "attachments": [

        {

            "fallback": "$time_generated $device_name reports $severity $subtype event:\n $opaque\n--------",

            "text": "$time_generated: <https://pa0.example.com|pa0> reports $severity $subtype event:\n$opaque",

            "color": "danger"

        }

    ]

}

 

 

Simple Format Message:

 

{

    "text": "$time_generated $device_name reports $severity $subtype event:\n $opaque\n--------"

}

 

Since I was mainly interested in system-level events, I tied it all together in the Device / Log Settings tab.  I haven’t narrowed-down exactly what I want to see in the slack channel, but for the purposes of this test, I wanted to see non-informational ha or crypto events, so used the following system log filter:

 

(( subtype eq ha ) or (subtype eq crypto)) and ( severity neq informational )

 

I matched that with the “Slack System Event 1” created earlier.  The configuration looks like this:Picture75.png

 Here’s what I see on my desktop in the Slack app when I initiate a manual HA state change via the PAN-OS GUI:Picture76.png

 

 

 

Looks good on the phone too:Picture77.pngCreated by Jared Valentine - Systems Engineer



t back - It does work just fine. As far as I remember I suffered from a cert issue. Regards, Walter

L0 Member

ya that was bug earlier, instead of using default trust certificates, it used device certificates to connect to hooks.slack.com.
now that is fixed.

L1 Bithead

What kind of certs do you need on the Firewall in order to do this slack integration? 

L1 Bithead

For some reason i am confiruing everything correctly but it does not like using this 

$opaque\n if i remove it and test test by sending log to slack it works any ideas?

L5 Sessionator

@Alex_Gomez This is fixed in PAN-OS 8.1.2

L2 Linker

I have successfully deployed this awesome feature into my 70 firewalls using Panorama.

The alerts are flowing into my designated slack channel, however, I am not getting very intuitive information from some devices.

 

For example when an alert flows to my channel the notification Windows gives me show the entirety of the Palo Alto firewall name. When I look at the actual data within the channel I am not seeing the same data present on certain devcies.

 

Capture.JPG

Compared to:

 

Capture.JPG

 

Any help is appreciated.

L0 Member

Hi @EddieBrown ,
i came across the same issue. Some information are missing on slack...
Did you manage to find the problem?

L2 Linker

Hey @Evgenij,

 

Unfortunately not, I thought maybe it had to do with the revision of code I was running as I had a few non 8.1 .x firewalls deployed. All my firewalls are on either 8.1.6 or 8.1.8 and I am still seeing the same results.

Maybe @rkemburu Can shed some of their infinite wisdom with us.

Palo Alto Networks Guru

I am forwarding this to the features owners to take a look. 

Glad you like the feature. 

Do you use any other integrations as well?  How did you hear about the feature?  

L2 Linker

@Jamiefitzgerald That is a lot of questions. I would like the feature more if it worked as advertised.

I use a few other integrations: PingID, MineMeld. I heard about this feature via a Slack/Palo Alto google search.

L3 Networker

I did the same with MS Teams, see here

😉 

pan-teams.png

L2 Linker

@Jamiefitzgerald  Any update on why we are only seeing half the information in Slack?

L0 Member

Hello,

 

Nice solution and thank you very much for taking the time to think about this solution.
Unfortunately, the firewalls are in a secure environment and do not have access to the Internet

 

Logs are sent to Splunk and Tufin servers which are on the same secure environment.

 

however, if it were necessary to create a server in this secure environment which allows to recover this type of alerts, it would be possible.

 

Thanks to all of you in advance

 

Valentino

 

  • 51763 Views
  • 15 comments
  • 10 Likes
Register or Sign-in
Contributors
Article Dashboard
Version history
Last Updated:
‎10-23-2019 09:19 AM
Updated by:
Retired Member