Wildfire event through the REST API

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Wildfire event through the REST API

Not applicable

Hello,

I have been looking at the RESTful XML API in order to retrieve logs, and have noticed that the API returns traffic and threat logs, but it does not return wildfire logs.

To retrieve threat logs I provide type=logs and log-type=threat as parameters.

Wildfire logs show up with type=THREAT and subType=wildfire when retrieved through syslog. Shouldn't they then be return similarly through the REST API?

Thanks!

1 accepted solution

Accepted Solutions

Hi wissa,

There is a bug fix to address accessing WildFire logs via the API that is planned for the upcoming maintenance release 5.0.5, due soon.

The hash is not available within the WildFire logs on the device, but can be accessed via the WildFire API.  In order to retrieve file hash (along with other WildFire forensics details), you can use the WildFire logs on the device and turn into WildFire API queries.  We recently added a new WildFire API method used to query based on device id (S/N) and report ID in the WildFire reports (labeled as threat ID or "tid").


A demonstration of the API query as a CURL command is provided below:

curl -i -k -F device_id=[SERIAL NUMBER] -F report_id=[TID FROM LOG] -F format=xml https://wildfire.paloaltonetworks.com/publicapi/report


WildFire logs can be exported to provide this information using log export or log forwarding.


The full API manual (not including the above new method) is available at: https://wildfire.paloaltonetworks.com/Wildfire/Home/APIProgrammingGuide.  Documentation will be updated soon to include this new API method.

View solution in original post

6 REPLIES 6

L4 Transporter

Wildfire logs cannot be retrieved from the API using the 'log-type=threat' option. A new 'log-type=wildfire' option is being added for this in upcoming PAN-OS 5.0.x software update.

Not applicable

Thanks, savasarala. Will the file hash be available with the new option for wildfire logs?

Hi wissa,

There is a bug fix to address accessing WildFire logs via the API that is planned for the upcoming maintenance release 5.0.5, due soon.

The hash is not available within the WildFire logs on the device, but can be accessed via the WildFire API.  In order to retrieve file hash (along with other WildFire forensics details), you can use the WildFire logs on the device and turn into WildFire API queries.  We recently added a new WildFire API method used to query based on device id (S/N) and report ID in the WildFire reports (labeled as threat ID or "tid").


A demonstration of the API query as a CURL command is provided below:

curl -i -k -F device_id=[SERIAL NUMBER] -F report_id=[TID FROM LOG] -F format=xml https://wildfire.paloaltonetworks.com/publicapi/report


WildFire logs can be exported to provide this information using log export or log forwarding.


The full API manual (not including the above new method) is available at: https://wildfire.paloaltonetworks.com/Wildfire/Home/APIProgrammingGuide.  Documentation will be updated soon to include this new API method.

Hi,

Has the URI you mentioned already been valid?

I tried following command today but no luck.

-------------------------------

$ curl -i -k -F device_id=001606000xxx -F report_id=417xxx -F format=xml https://wildfire.paloaltonetworks.com/publicapi/report

HTTP/1.1 100 Continue

HTTP/1.1 400 Bad Request

Server: nginx/1.0.9

Date: Thu, 11 Jul 2013 07:22:30 GMT

Content-Type: text/html

Transfer-Encoding: chunked

Connection: keep-alive

X-Powered-By: PHP/5.3.6

-------------------------------

Also tried with wget to check if the curl I am using is something wrong but almost same result.

-------------------------------

$ wget --no-check-certificate --post-data 'device_id=001606000xxx&report_id=417xxx&format=xml' https://wildfire.paloaltonetworks.com/publicapi/report

--2013-07-11 08:25:46--  https://wildfire.paloaltonetworks.com/publicapi/report

Resolving wildfire.paloaltonetworks.com... 54.241.16.153

Connecting to wildfire.paloaltonetworks.com|54.241.16.153|:443... connected.

WARNING: certificate common name `*.wildfire.paloaltonetworks.com' doesn't match requested host name `wildfire.paloaltonetworks.com'.

HTTP request sent, awaiting response... 400 Bad Request

2013-07-11 08:25:47 ERROR 400: Bad Request.

-------------------------------

Any mistakes I am making?

Thanks,

you are missing the apikey.  I use -d in the below because you don't need a multipart/form-data request, but -F will work also.

KEY=xxx

$ curl -i -d "apikey=$KEY" -d device_id=00xxx -d report_id=247406568 https://wildfire.paloaltonetworks.com/publicapi/report

HTTP/1.1 200 OK

Server: nginx/1.0.9

Date: Sat, 13 Jul 2013 00:23:43 GMT

Content-Type: text/xml; charset=utf-8

Transfer-Encoding: chunked

Connection: keep-alive

X-Powered-By: PHP/5.3.6

<wildfire>

<report>

  <version>0.1</version>

  <task>353397118</task>

  <sha256>8122940e894a0dafa2fc75310909d83646dfdea2e30845511c1dc697be7b779c</sha256>

  <md5>eadf7415867bfaa3dc4c34c1016f6440</md5>

  <size>707120</size>

  <malware>yes</malware>

It worked as expected!

Thank you,

Takahiro

  • 1 accepted solution
  • 9205 Views
  • 6 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!