As part of submitting a file scan request, the request payload must contain a reference to a webhook server URL defined as part of a policy defined inline.
When Nightfall prepares a file scan operation, it will issue a challenge to the webhook server to verify its legitimacy.
After the file scan has been processed asynchronously, the results will be delivered to the webhook.
Webhook Payload and Findings for File Scans
For a file scan, your webhook will receive a request body that will be a JSON payload containing:
the upload UUID (uploadID)
a boolean indicating whether or not any data in the file matched the provided detection rules (findingsPresent)
a pre-signed S3 URL where the caller may fetch the findings for the scan (findingsURL). if there are no findings in the file, this field will be empty.
the date until which the findingsURL is valid (validUntil) formatted to RFC 3339. Results are valid for 24 hours after scan completion. The time will be in UTC.
the value you supplied for requestMetadata. Callers may opt to use this to help identify their input file upon receiving a webhook response. Maximum length 10 KB.
Below is an example of a payload sent to the webhook URL.
If you follow the URL (before it expires) it will return a JSON representation of the findings similar to those returned by the Scan Plain Text endpoint.
In this example, we have uploaded a zip file with a python script (upload.py) and a README.md file. A Detector in our DetectionRule checks for the presence of the string http://localhost
{"findings":[ {"path":"fileupload/upload.py","detector":{"id":"58861dee-b213-4dbc-97fa-a148acb8bd1a","name":"localhost url" },"finding":"http://localhost","confidence":"LIKELY","location":{"byteRange":{"start":105,"end":121 },"codepointRange":{"start":105,"end":121 },"lineRange":{"start":7,"end":7 } },"beforeContext":"PLOAD_URL = getenv(\"FILE_UPLOAD_HOST\", \"","afterContext":":8080/v3\")\nNF_API_KEY = getenv(\"NF_API_K","matchedDetectionRuleUUIDs":["950833c9-8608-4c66-8a3a-0734eac11157" ],"matchedDetectionRules":[ ] }, {"path":"fileupload/README.md","detector":{"id":"58861dee-b213-4dbc-97fa-a148acb8bd1a","name":"localhost url" },"finding":"http://localhost","confidence":"LIKELY","location":{"byteRange":{"start":570,"end":586 },"codepointRange":{"start":570,"end":586 },"lineRange":{"start":22,"end":22 } },"beforeContext":"t the script will send the requests to `","afterContext":":8080`, but this can be overridden using","matchedDetectionRuleUUIDs":["950833c9-8608-4c66-8a3a-0734eac11157" ],"matchedDetectionRules":[ ] }, {"path":"fileupload/README.md","detector":{"id":"58861dee-b213-4dbc-97fa-a148acb8bd1a","name":"localhost url" },"finding":"http://localhost","confidence":"LIKELY","location":{"byteRange":{"start":965,"end":981 },"codepointRange":{"start":965,"end":981 },"lineRange":{"start":26,"end":26 } },"beforeContext":"ice deployment you want to connect to | ","afterContext":":8080 |\n| `NF_API_KEY` | the API Ke","matchedDetectionRuleUUIDs":["950833c9-8608-4c66-8a3a-0734eac11157" ],"matchedDetectionRules":[ ] } ]}