Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...








curl --request POST \
--url https://api.nightfall.ai/v3/scan \
--header 'Accept: application/json' \
--header 'Authorization: Bearer NF-rEpLaCeM3w1ThYoUrNiGhTfAlLKeY123' \
--header 'Content-Type: application/json' \
--data '
{
"policy": {
"detectionRules": [
{
"detectors": [
{
"minNumFindings": 1,
"minConfidence": "LIKELY",
"displayName": "US Social Security Number",
"detectorType": "NIGHTFALL_DETECTOR",
"nightfallDetector": "US_SOCIAL_SECURITY_NUMBER"
}
],
"name": "My Match Rule",
"logicalOp": "ANY"
}
]
},
"payload": [
"The customer social security number is 458-02-6124",
"No PII in this string"
]
}





curl --location --request POST 'https://api.nightfall.ai/v3/scan' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer NF-rEpLaCeM3w1ThYoUrNiGhTfAlLKeY123' \
--header 'Content-Type: application/json' \
--data-raw '{
"policy": {
"detectionRules": [
{
"detectors": [
{
"regex": {
"pattern": "(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))",
"isCaseSensitive": false
},
"exclusionRules": [
{
"wordList": {
"values": [
"4111111111111111",
"5105105105105100"
]
},
"exclusionType": "WORD_LIST",
"matchType": "FULL"
}
],
"minNumFindings": 1,
"minConfidence": "POSSIBLE",
"displayName": "Credit Card Reg Ex",
"detectorType": "REGEX"
}
],
"name": "Credit Card Detection Rule",
"logicalOp": "ALL"
}
]
},
"payload": [
"5105105105105100",
"4111111111111111",
"4012888888881881"
]
}'{
"findings":[
[
],
[
],
[
{
"finding":"4012888888881881",
"detector":{
"name":"Credit Card Reg Ex",
"uuid":"93024e88-e6de-4c84-8295-75157cdd1b52"
},
"confidence":"LIKELY",
"location":{
"byteRange":{
"start":0,
"end":16
},
"codepointRange":{
"start":0,
"end":16
},
"rowRange":null,
"columnRange":null,
"commitHash":""
},
"matchedDetectionRuleUUIDs":[
],
"matchedDetectionRules":[
"Credit Card Detection Rule"
]
}
]
],
"redactedPayload":[
"",
"",
""
]
}
curl --location --request POST 'https://api.nightfall.ai/v3/scan' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer NF-rEpLaCeM3w1ThYoUrNiGhTfAlLKeY123' \
--header 'Content-Type: application/json' \
--data-raw '{
"policy": {
"detectionRules": [
{
"detectors": [
{
"regex": {
"isCaseSensitive": false,
"pattern": "\\d{3}-\\d{2}-\\d{4}"
},
"contextRules": [
{
"regex": {
"pattern": "SSN",
"isCaseSensitive": false
},
"proximity": {
"windowBefore": 20,
"windowAfter": 20
},
"confidenceAdjustment": {
"fixedConfidence": "VERY_LIKELY"
}
}
],
"minNumFindings": 1,
"minConfidence": "POSSIBLE",
"detectorType": "REGEX",
"displayName": "SSN Match Detector"
}
],
"name": "SSN Match Detection Rule",
"logicalOp": "ALL"
}
],
"contextBytes": 20
},
"payload": [
"My SSN is 555-55-5555",
"Here it is : 555-55-5555"
]
}
'{
"findings":[
[
{
"finding":"555-55-5555",
"beforeContext":"My SSN is ",
"detector":{
"name":"SSN Match Detector",
"uuid":"6131f41c-dbdd-47a9-8c6f-1819c9baf388"
},
"confidence":"VERY_LIKELY",
"location":{
"byteRange":{
"start":10,
"end":21
},
"codepointRange":{
"start":10,
"end":21
},
"rowRange":null,
"columnRange":null,
"commitHash":""
},
"matchedDetectionRuleUUIDs":[
],
"matchedDetectionRules":[
"SSN Match Detection Rule"
]
}
],
[
{
"finding":"555-55-5555",
"beforeContext":"Here it is : ",
"detector":{
"name":"SSN Match Detector",
"uuid":"6131f41c-dbdd-47a9-8c6f-1819c9baf388"
},
"confidence":"LIKELY",
"location":{
"byteRange":{
"start":13,
"end":24
},
"codepointRange":{
"start":13,
"end":24
},
"rowRange":null,
"columnRange":null,
"commitHash":""
},
"matchedDetectionRuleUUIDs":[
],
"matchedDetectionRules":[
"SSN Match Detection Rule"
]
}
]
],
"redactedPayload":[
"",
""
]
}{
"mcpServers": {
"nightfall": {
"command": "npx",
"args": [
"-y",
"mcp-remote@latest",
"https://api.nightfall.ai/mcp",
"--header",
"Authorization: Bearer YOUR_NIGHTFALL_API_KEY"
]
}
}
}{
"mcpServers": {
"nightfall": {
"url": "https://api.nightfall.ai/mcp",
"headers": {
"Authorization": "Bearer YOUR_NIGHTFALL_API_KEY"
}
}
}
}{
"mcpServers": {
"nightfall": {
"serverUrl": "https://api.nightfall.ai/mcp",
"headers": {
"Authorization": "Bearer YOUR_NIGHTFALL_API_KEY"
}
}
}
}POST https://api.nightfall.ai/mcp
Authorization: Bearer YOUR_NIGHTFALL_API_KEY
Content-Type: application/jsoncurl --request POST \
--url https://api.nightfall.ai/v3/upload/<fileid>/scan \
--header 'Accept: application/json' \
--header 'Authorization: Bearer NF-<yourNightfallKey> \
--header 'Content-Type: application/json' \
--data '
{
"policy": {
"detectionRules": [
{
"detectors": [
{
"regex": {
"pattern": "*\.txt",
"isCaseSensitive": false
},
"detectorType": "REGEX",
"scope": "ContentAndFile"
}
],
"name": "File Name Detector",
"logicalOp": "ANY"
}
]
}
}
{"challenge": "z78woE1uDFu7tPrPvEBV"}



X-Nightfall-Timestampdetector_list = ['US_SOCIAL_SECURITY_NUMBER', 'ICD9_CODE', 'US_DRIVERS_LICENSE_NUMBER']
detector_object = [{'name':detector} for detector in detector_list][{'name':'US_SOCIAL_SECURITY_NUMBER'},
{'name':'ICD9_CODE'},
{'name':'US_DRIVERS_LICENSE_NUMBER'}]{
"errors": [],
"findingsPresent": true,
"findingsURL": "https://files.nightfall.ai/877442c5-1573-4637-a223-595bf620e3e5.json?Expires=1645722381&Signature=C-kQbtonFAPXfooGcm0dYgbsn9jfGu~vGSv5yK5j1z2f7aAhk0WuaL4bISUwx5MZkQmPVFgeyMwemvEoI8aI11lPA-ORsX5LtRdGJBOma4sPVl~9f9qBPKE2VSrdGDmT4EpBLc8ewUtKrLm2xE-0BzW~5PdLSvZ~NQxtB7OMBaYm7h~y2NSUZfpqzdzENyKhyHx5QxH2PJvxeN5IvMXqNUrKyZsxviSYY6kDNAiGExS-u6PmKKS1GhXOaFLdJSRjgtFhUxDLyWl~xTYR-lJol5UTgtcuYU8AaJ3xVTF1-1JYRlioRlaf9shAvme4djFyg8k~zOB8bYgzBeaRqSjeWA__&Key-Pair-Id=K3RYMP51FKX5HX",
"requestMetadata": "some data",
"uploadID": "877442c5-1573-4637-a223-595bf620e3e5",
"validUntil": "2022-02-24T17:06:21.412377682Z"
}{
"findings": [
{
"detector": {
"id": "74d1315e-c0c3-4ef5-8b1e-6cf98664a854"
},
"finding": "4242-4242-4242-4242",
"confidence": "VERY_LIKELY",
"location": {
"byteRange": {
"start": 146,
"end": 165
},
"codepointRange": {
"start": 146,
"end": 165
},
"lineRange": {
"start": 3,
"end": 3
},
"rowRange": null,
"columnRange": null,
"commitHash": ""
},
"beforeContext": "nd HIPAA Defined PII\nHIPAA HIPAA hooray\n",
"afterContext": " is my credit card number\n\n",
"matchedDetectionRuleUUIDs": ["7bd6166a-b9af-4069-847d-487a88788122"],
"matchedDetectionRules": []
}
]
}{
"findings": [
[
{
"finding": "4242-4242-4242-4242",
"beforeContext": "hello world cc ",
"detector": {
"name": "Credit card number",
"uuid": "74c1815e-c0c3-4df5-8b1e-6cf98864a454"
},
"confidence": "VERY_LIKELY",
"location": {
"byteRange": {
"start": 15,
"end": 34
},
"codepointRange": {
"start": 15,
"end": 34
},
"rowRange": null,
"columnRange": null,
"commitHash": ""
},
"matchedDetectionRuleUUIDs": [
"42efe36c-6479-412a-9049-fd8cdf895ced"
],
"matchedDetectionRules": []
}
]
],
"redactedPayload": [""]
}{
"findingsURL": "https://files.nightfall.ai/asdfasdf-asdf-asdf-asdf-asdfasdfasdf.json?Expires=1635135397&Signature=asdfasdfQ2qTmPFnS9uD5I3QGEqHY2KlsYv4S-WOeEEROj~~x6W2slP2GvPPgPlYs~lwdr-mtJjVFu4LtyDhdfYezC7B0ysfJytyMIyAFriVMqOGsRJXqoQfsg8Ckd2b6kRcyDZXJE25cW8zBS08lyVwMBCsGS0BKSin8uSuD7pQu3QAubT7p~MPkfc6PSXYIJREBr3q4-8c7UnrYOAiXfSW1AmFE47rr3Wxh2TpU3E-Fxu-6e3DKN4q6meACdgZb2KHZo3e-NK7ug9f8sxBp1YT0n5oiVuW4KXguIyXWN~aKEHMa6DzZ4cUJ61LmnMzGndc2sVKhii39FHwTsYog__&Key-Pair-Id=asdfOPZ1EKX0YC",
"validUntil": "2021-10-25T04:16:37.734633129Z",
"uploadID": "152848af-2ac9-4e0a-8563-2b82343d964a",
"findingsPresent": true,
"requestMetadata": "",
"errors": []
}{
"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":[
]
}
]
}{
"findings":[
{
"path":"Sheet1 (5)",
"detector":{
"id":"e30d9a87-f6c7-46b9-a8f4-16547901e069",
"name":"US social security number (SSN)",
"version":1
},
"finding":"624-84-9182",
"confidence":"LIKELY",
"location":{
"byteRange":{
"start":2505,
"end":2516
},
"codepointRange":{
"start":2452,
"end":2463
},
"lineRange":{
"start":55,
"end":55
},
"rowRange":{
"start":55,
"end":55
},
"columnRange":{
"start":2,
"end":2
},
"commitHash":""
},
"matchedDetectionRuleUUIDs":[
"950833c9-8608-4c66-8a3a-0734eac11157"
],
"matchedDetectionRules":[
]
},
...{
"findings":[
{
"path":"f607a067..53e59684/nightfall.go",
"detector":{
"id":"6123060e-2d9f-4f35-a7a1-743379ea5616",
"name":"URL"
},
"finding":"https://api.nightfall.ai/\"",
"confidence":"LIKELY",
"location":{
"byteRange":{
"start":142,
"end":168
},
"codepointRange":{
"start":142,
"end":168
},
"lineRange":{
"start":16,
"end":16
},
"rowRange":{
"start":0,
"end":0
},
"columnRange":{
"start":0,
"end":0
},
"commitHash":"53e59684d9778ceb0f0ed6a4b949c464c24d35ce"
},
"beforeContext":"tp\"\n\t\"os\"\n\t\"time\"\n)\n\nconst (\n\tAPIURL = \"",
"afterContext":"\n\n\tDefaultFileUploadConcurrency = 1\n\tDef",
"matchedDetectionRuleUUIDs":[
"cda0367f-aa75-4d6a-904f-0311209b3383"
],
"matchedDetectionRules":[
]
},
...cd nightfall-go-sdk
git checkout 53e59684d9778ceb0f0ed6a4b949c464c24d35cefrom datetime import datetime, timedelta
import hmac
import hashlib
from flask import request
SIGNING_SECRET = "super-secret"
given_signature = request.headers.get('X-Nightfall-Signature')
req_timestamp = request.headers.get('X-Nightfall-Timestamp')
now = datetime.now()
if now-timedelta(minutes=5) <= datetime.fromtimestamp(int(req_timestamp)) <= now:
raise Exception("could not validate timestamp is within the last few minutes")
computed_signature = hmac.new(
SIGNING_SECRET.encode(),
msg=F"{req_timestamp}:{request.get_data(as_text=True)}".encode(),
digestmod=hashlib.sha256
).hexdigest().lower()
if computed_signature != given_signature:
raise Exception("could not validate signature of inbound request!")import hmac
import hashlib
from os import getenv, path, mkdir
from flask import Flask, request
import requests
app = Flask(__name__)
output_dir = "findings"
SIGNING_SECRET = getenv("NF_SIGNING_SECRET")
@app.route("/", methods=['POST'])
def hello():
content = request.get_json(silent=True)
challenge = content.get("challenge")
if challenge:
return challenge
else:
verify_signature()
print(F"Received request metadata: {content['requestMetadata']}")
print(F"Received errors: {content['errors']}")
if not content["findingsPresent"]:
print(F"No findings for {content['uploadID']}")
return "", 200
print(F"S3 findings valid until {content['validUntil']}")
response = requests.get(content["findingsURL"])
save_findings(content["uploadID"], response.text)
return "", 200
def verify_signature():
if SIGNING_SECRET is None:
return
given_signature = request.headers.get('X-Nightfall-Signature')
nonce = request.headers.get('X-Nightfall-Timestamp')
computed_signature = hmac.new(
SIGNING_SECRET.encode(),
msg=F"{nonce}:{request.get_data(as_text=True)}".encode(),
digestmod=hashlib.sha256
).hexdigest().lower()
if computed_signature != given_signature:
raise Exception("could not validate signature of inbound request!")
def save_findings(scan_id, finding_json):
if not path.isdir(output_dir):
mkdir(output_dir)
output_path = path.join(output_dir, f"{scan_id}.json")
with open(output_path, "w+") as out_file:
out_file.write(finding_json)
print(F"Findings for {scan_id} written to {output_path}")
if __name__ == "__main__":
app.run(port=8075)
{
"finding": "zImaKNJJ8u/seIbm1UszokVz3SSARukJs6cghEBXD",
"detector": {
"name": "API key",
"uuid": "0e95732f-bc5c-448f-9d15-bd1417177360"
},
"confidence": "VERY_LIKELY",
...
"findingMetadata": {
"apiKeyMetadata": {
"status": "ACTIVE",
"kind": "AWS",
"description": "Access Key ID: AKIA52FSMBPZS1JIDTPX"
}
}
}
curl --request POST \
--url https://api.nightfall.ai/v3/scan \
--header 'Authorization: Bearer NF-rEpLaCeM3w1ThYoUrNiGhTfAlLKeY123' \
--header 'Content-Type: application/json' \
--data '{
"policy": {
"detectionRules": [
{
"detectors": [
{
"detectorType": "NIGHTFALL_DETECTOR",
"nightfallDetector": "API_KEY",
"minNumFindings": 1,
"minConfidence": "LIKELY",
"displayName": "API Key"
}
],
"name": "My Match Rule",
"logicalOp": "ANY"
}
]
},
"payload": [
"Is this an active nightfall key? NF-OZ6F9fzF2z5mRxMrUdfL8FddFS51kPzE"
]
}'import json
import os
import requestsendpoint = 'https://api.nightfall.ai/v1/scan'h = {
'Content-Type': 'application/json',
'x-api-key': os.getenv('NIGHTFALL_API_KEY')
}with open('sample_data.csv', 'r') as f:
raw_data = f.read()
d = {
'detectors': detector_object,
'payload':{'items':[raw_data]}
}import os
if os.stat('sample_data.csv').st_size < 500000:
print('This file will fit in a single API call.')
else:
print('This file will need to be broken into pieces across multiple calls.')response = requests.post(endpoint, headers = h, data = json.dumps(d))
if (response.status_code == 200) & (len(response.content.decode()) > 4):
print('This file contains sensitive data.')
print(json.loads(response.content.decode()))
elif response.status_code == 200:
print('No sensitive data detected. Hooray!')
else:
print(f'Something went wrong -- Response {response.status_code}.')[
[
{'fragment': '172-32-1176',
'detector': 'US_SOCIAL_SECURITY_NUMBER',
'confidence': {'bucket': 'LIKELY'},
'location': {'byteRange': {'start': 122, 'end': 133},
'unicodeRange': {'start': 122, 'end': 133}}},
{'fragment': '514-14-8905',
'detector': 'US_SOCIAL_SECURITY_NUMBER',
'confidence': {'bucket': 'LIKELY'},
'location': {'byteRange': {'start': 269, 'end': 280},
'unicodeRange': {'start': 269, 'end': 280}}},
{'fragment': '213-46-8915',
'detector': 'US_SOCIAL_SECURITY_NUMBER',
'confidence': {'bucket': 'LIKELY'},
'location': {'byteRange': {'start': 418, 'end': 429},
'unicodeRange': {'start': 418, 'end': 429}}}
]
]curl --request POST \
--url https://api.nightfall.ai/v3/scan \
--header 'Accept: application/json' \
--header 'Authorization: Bearer NF-rEpLaCeM3w1ThYoUrNiGhTfAlLKeY123' \
--header 'Content-Type: application/json' \
--data '
{
"policy": {
"detectionRuleUUIDs": [
"950833c9-8608-4c66-8a3a-0734eac11157"
]
},
"payload": [
"4916-6734-7572-5015 is my credit card number",
"This string does not have any sensitive data",
"my api key is yr+ZWwIZp6ifFgaHV8410b2BxbRt5QiAj1EZx1qj and my 💳 credit card number 💰 is 30204861594838"
]
}
'curl --request POST \
--url https://api.nightfall.ai/v3/scan \
--header 'accept: application/json' \
--header 'Authorization: Bearer NF-rEpLaCeM3w1ThYoUrNiGhTfAlLKeY123' \
--header 'content-type: application/json' \
--data '
{
"policy": {
"detectionRules": [
{
"detectors": [
{
"nightfallDetector": "CREDIT_CARD_NUMBER",
"detectorType": "NIGHTFALL_DETECTOR",
"minConfidence": "POSSIBLE",
"minNumFindings": 1
}
],
"logicalOp": "ALL"
}
]
},
"payload": [
"4916-6734-7572-5015 is my credit card number",
"This string does not have any sensitive data",
"my api key is yr+ZWwIZp6ifFgaHV8410b2BxbRt5QiAj1EZx1qj and my 💳 credit card number 💰 is 30204861594838"
]
}
'{
"findings": [
[
{
"finding": "4916-6734-7572-5015",
"detector": {
"name": "Credit card number",
"uuid": "74c1815e-c0c3-4df5-8b1e-6cf98864a454"
},
"confidence": "VERY_LIKELY",
"location": {
"byteRange": {
"start": 0,
"end": 19
},
"codepointRange": {
"start": 0,
"end": 19
}
},
"matchedDetectionRuleUUIDs": [
"950833c9-8608-4c66-8a3a-0734eac11157"
],
"matchedDetectionRules": []
}
],
[],
[
{
"finding": "30204861594838",
"detector": {
"name": "Phone number",
"uuid": "d08edfc4-b5e2-420a-a5fe-3693fb6276c4"
},
"confidence": "LIKELY",
"location": {
"byteRange": {
"start": 94,
"end": 108
},
"codepointRange": {
"start": 88,
"end": 102
}
},
"matchedDetectionRuleUUIDs": [
"950833c9-8608-4c66-8a3a-0734eac11157"
],
"matchedDetectionRules": []
},
{
"finding": "30204861594838",
"detector": {
"name": "Credit card number",
"uuid": "74c1815e-c0c3-4df5-8b1e-6cf98864a454"
},
"confidence": "LIKELY",
"location": {
"byteRange": {
"start": 94,
"end": 108
},
"codepointRange": {
"start": 88,
"end": 102
}
},
"matchedDetectionRuleUUIDs": [
"950833c9-8608-4c66-8a3a-0734eac11157"
],
"matchedDetectionRules": []
}
]
]
}
"location": {
"byteRange": {
"start": 94,
"end": 108
},
"codepointRange": {
"start": 88,
"end": 102
}
},
"matchedDetectionRuleUUIDs": [
"950833c9-8608-4c66-8a3a-0734eac11157"
],
"matchedDetectionRules": []
},
{
"finding": "30204861594838",
"detector": {
"name": "Credit card number",
"uuid": "74c1815e-c0c3-4df5-8b1e-6cf98864a454"
},
"confidence": "LIKELY",
"location": {
"byteRange": {
"start": 94,
"end": 108
},
"codepointRange": {
"start": 88,
"end": 102
}
},
"matchedDetectionRuleUUIDs": [
"950833c9-8608-4c66-8a3a-0734eac11157"
],
"matchedDetectionRules": []
}
]
]payload = [
"The customer social security number is 458-02-6124",
"No PII in this string",
"My credit card number is 4916-6734-7572-5015"
]
result, _ = nightfall.scan_text(
payload,
detection_rule_uuids=[detection_rule_uuid]
)payload = [
"The customer social security number is 458-02-6124",
"No PII in this string",
"My credit card number is 4916-6734-7572-5015"
]
result, _ = nightfall.scan_text(
payload,
detection_rules=[
DetectionRule(
name="Sample_Detection_Rule",
logical_op=LogicalOp.ANY,
detectors=[
Detector(
min_confidence=Confidence.VERY_LIKELY,
min_num_findings=1,
display_name="Credit Card",
nightfall_detector="CREDIT_CARD_NUMBER",
),
Detector(
min_confidence=Confidence.VERY_LIKELY,
min_num_findings=1,
display_name="Social",
nightfall_detector="US_SOCIAL_SECURITY_NUMBER",
)
]
)
]
)[
[Finding(finding='458-02-6124', redacted_finding=None, before_context=None, after_context=None, detector_name='US social security number (SSN)', detector_uuid='e30d9a87-f6c7-46b9-a8f4-16547901e069', confidence=<Confidence.VERY_LIKELY: 'VERY_LIKELY'>, byte_range=Range(start=39, end=50), codepoint_range=Range(start=39, end=50), matched_detection_rule_uuids=['c67e3dd7-560e-438f-8c72-6ec54979396f'], matched_detection_rules=[])],
[],
[Finding(finding='4916-6734-7572-5015', redacted_finding=None, before_context=None, after_context=None, detector_name='Credit card number', detector_uuid='74c1815e-c0c3-4df5-8b1e-6cf98864a454', confidence=<Confidence.VERY_LIKELY: 'VERY_LIKELY'>, byte_range=Range(start=25, end=44), codepoint_range=Range(start=25, end=44), matched_detection_rule_uuids=['c67e3dd7-560e-438f-8c72-6ec54979396f'], matched_detection_rules=[])]
][
[Finding(finding='458-02-6124', redacted_finding=None, before_context=None, after_context=None, detector_name='Social', detector_uuid='e30d9a87-f6c7-46b9-a8f4-16547901e069', confidence=<Confidence.VERY_LIKELY: 'VERY_LIKELY'>, byte_range=Range(start=39, end=50), codepoint_range=Range(start=39, end=50), matched_detection_rule_uuids=[], matched_detection_rules=['Sample_Detection_Rule'])],
[],
[Finding(finding='4916-6734-7572-5015', redacted_finding=None, before_context=None, after_context=None, detector_name='Credit Card', detector_uuid='74c1815e-c0c3-4df5-8b1e-6cf98864a454', confidence=<Confidence.VERY_LIKELY: 'VERY_LIKELY'>, byte_range=Range(start=25, end=44), codepoint_range=Range(start=25, end=44), matched_detection_rule_uuids=[], matched_detection_rules=['Sample_Detection_Rule'])],
][[], [], []]import os
from nightfall import Confidence, DetectionRule, Detector, LogicalOp, Nightfallnightfall = Nightfall(os.environ['NIGHTFALL_API_KEY'])detection_rule_uuid = os.environ.get('DETECTION_RULE_UUID')list_posture_events with the same time rangesearch_posture_events with query actor_email:[email]curl --request POST \
--url https://api.nightfall.ai/v3/scan \
--header 'Accept: application/json' \
--header 'Authorization: Bearer NF-rEpLaCeM3w1ThYoUrNiGhTfAlLKeY123' \
--header 'Content-Type: application/json' \
--data '
{
"policy": {
"detectionRules": [
{
"detectors": [
{
"minNumFindings": 1,
"minConfidence": "VERY_LIKELY",
"displayName": "US Social Security Number",
"detectorType": "NIGHTFALL_DETECTOR",
"nightfallDetector": "US_SOCIAL_SECURITY_NUMBER"
},
{
"redactionConfig": {
"maskConfig": {
"charsToIgnore": [
"-"
],
"maskingChar": "X",
"maskRightToLeft":true,
"numCharsToLeaveUnMasked":4
}
},
"minNumFindings": 1,
"minConfidence": "VERY_LIKELY",
"displayName": "Credit Card Number",
"detectorType": "NIGHTFALL_DETECTOR",
"nightfallDetector": "CREDIT_CARD_NUMBER"
}
],
"name": "My Match Rule",
"logicalOp": "ANY"
}
]
},
"payload": [
"The customer social security number is 458-02-6124",
"No PII in this string",
"My credit card number is 5310-2768-6832-9293"
]
}
'// By default, the client reads your API key from the environment variable NIGHTFALL_API_KEY
const nfClient = new Nightfall();
const payload = [
"The customer social security number is 458-02-6124",
"No PII in this string",
"My credit card number is 5310-2768-6832-9293"
];
const policy = {
"detectionRules": [
{
"detectors": [
{
"minNumFindings": 1,
"minConfidence": "LIKELY",
"displayName": "US Social Security Number",
"detectorType": "NIGHTFALL_DETECTOR",
"nightfallDetector": "US_SOCIAL_SECURITY_NUMBER"
},
{
"redactionConfig": {
"maskConfig": {
"charsToIgnore": [
"-"
],
"maskingChar": "#"
}
},
"minNumFindings": 1,
"minConfidence": "LIKELY",
"displayName": "Credit Card Number",
"detectorType": "NIGHTFALL_DETECTOR",
"nightfallDetector": "CREDIT_CARD_NUMBER"
}
],
"name": "My Match Rule",
"logicalOp": "ANY"
}
]
};
const response = await nfClient.scanText(payload, policy);
if (response.isError) {
console.log(response.getError());
} else {
response.data.findings.forEach((finding) => {
if (finding.length > 0) {
finding.forEach((result) => {
console.log(`Finding: ${result.finding}, Confidence: ${result.confidence}`);
});
}
});
}// Some code>>> from nightfall import Confidence, DetectionRule, Detector, Nightfall
>>> # By default, the client reads the API key from the environment variable NIGHTFALL_API_KEY
>>> nightfall = Nightfall()
>>> # A rule contains a set of detectors to scan with
>>> cc = Detector(min_confidence=Confidence.LIKELY, nightfall_detector="CREDIT_CARD_NUMBER")
>>> ssn = Detector(min_confidence=Confidence.POSSIBLE, nightfall_detector="US_SOCIAL_SECURITY_NUMBER")
>>> detection_rule = DetectionRule([cc, ssn])
>>> payload = ["hello world", "my SSN is 678-99-8212", "4242-4242-4242-4242"]
>>> findings, _ = nightfall.scan_text( payload, detection_rules=[detection_rule]){
"findings": [
[
{
"finding": "458-02-6124",
"redactedFinding": "XXX-XXXX-XXXX-9293",
"detector": {
"name": "US Social Security Number",
"uuid": "e30d9a87-f6c7-46b9-a8f4-16547901e069"
},
"confidence": "VERY_LIKELY",
"location": {
"byteRange": {
"start": 39,
"end": 50
},
"codepointRange": {
"start": 39,
"end": 50
},
"rowRange": null,
"columnRange": null,
"commitHash": ""
},
"matchedDetectionRuleUUIDs": [],
"matchedDetectionRules": [
"My Match Rule"
]
}
],
[],
[
{
"finding": "5310-2768-6832-9293",
"redactedFinding": "XXXX-XXXX-XXXX-9293",
"detector": {
"name": "Credit Card Number",
"uuid": "74c1815e-c0c3-4df5-8b1e-6cf98864a454"
},
"confidence": "VERY_LIKELY",
"location": {
"byteRange": {
"start": 25,
"end": 44
},
"codepointRange": {
"start": 25,
"end": 44
},
"rowRange": null,
"columnRange": null,
"commitHash": ""
},
"redactedLocation": {
"byteRange": {
"start": 25,
"end": 44
},
"codepointRange": {
"start": 25,
"end": 44
},
"rowRange": null,
"columnRange": null,
"commitHash": ""
},
"matchedDetectionRuleUUIDs": [],
"matchedDetectionRules": [
"My Match Rule"
]
}
]
],
"redactedPayload": [
"",
"",
"My credit card number is XXXX-XXXX-XXXX-9293"
]
}<!--pom.xml-->
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.foo</groupId>
<artifactId>my-artifact</artifactId>
<version>1.0.0</version>
<name>${project.groupId}:${project.artifactId}</name>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>ai.nightfall</groupId>
<artifactId>scan-api</artifactId>
<version>1.0.1</version>
</dependency>
</dependencies>
</project>//List of imports
import ai.nightfall.scan.NightfallClient;
import ai.nightfall.scan.model.Confidence;
import ai.nightfall.scan.model.DetectionRule;
import ai.nightfall.scan.model.Detector;
import ai.nightfall.scan.model.LogicalOp;
import ai.nightfall.scan.model.NightfallAPIException;
import ai.nightfall.scan.model.ScanTextConfig;
import ai.nightfall.scan.model.ScanTextRequest;
import ai.nightfall.scan.model.ScanTextResponse;
import java.util.Arrays;
import java.util.List;//Sample Payload
List<String> payload = Arrays.asList(
"hello",
"world",
"my data is 4242-4242-4242-4242 but shhhh 🙊 ",
"my ssn is 678-99-8212"
);//Build the Scan Request
public static ScanTextRequest buildScanTextRequest() {
// Define some detectors to use to scan your data
Detector creditCard = new Detector("CREDIT_CARD_NUMBER");
creditCard.setMinConfidence(Confidence.LIKELY);
creditCard.setMinNumFindings(1);
Detector ssn = new Detector("US_SOCIAL_SECURITY_NUMBER");
ssn.setMinConfidence(Confidence.POSSIBLE);
ssn.setMinNumFindings(1);
DetectionRule rule = new DetectionRule(Arrays.asList(creditCard, ssn), LogicalOp.ANY);
ScanTextConfig config = ScanTextConfig.fromDetectionRules(Arrays.asList(rule), 20);
return new ScanTextRequest(payload, config);
}//Run the Scan Request
public class Runner {
public static void main(String[] args) {
try (NightfallClient c = NightfallClient.Builder.defaultClient()) {
try {
ScanTextResponse response = c.scanText(buildScanTextRequest());
System.out.println("response: " + response.getFindings());
} catch (NightfallAPIException e) {
// not a checked exception, just for illustrative purposes
System.out.println("got error: " + e);
}
}
}
}integration_name:github AND risk_label:HIGH AND state:ACTIVEuser_email:[email protected] AND integration_name:slackuser_email:[email protected] OR user_email:[email protected]slack.channel_name:general AND state:PENDINGcreatedAfter=<unix_timestamp> AND risk_label:HIGH# Load dependencies
require 'open-uri'
require 'net/http'
require 'json'# Load environment variables for Nightfall API
nightfall_api_key = ENV['NIGHTFALL_API_KEY']
detection_rule_uuid = ENV['NIGHTFALL_DETECTION_RULE_UUID']# Text data to scan
payload = [
"The customer social security number is 458-02-6124",
"No PII in this string",
"My credit card number is 4916-6734-7572-5015"
]# Configure detection settings
config = {
"config": {
"detectionRuleUUIDs": [detection_rule_uuid]
},
"payload": payload
}# Build API request
url = URI("https://api.nightfall.ai/v3/scan")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Accept"] = 'application/json'
request["Content-Type"] = 'application/json'
request["Authorization"] = "Bearer #{nightfall_api_key}"
request.body = config.to_json# Make API request
response = http.request(request)
# Parse response
if response.code.to_i == 200 and response.body['findings']
puts "This text contains sensitive data.\n\n"
puts JSON.pretty_generate(JSON.parse(response.body))
elsif response.code.to_i == 200
puts "No sensitive data found. Hooray!"
else
puts "Something went wrong -- Response #{response.code}."
endruby nightfall_demo.rbThis text contains sensitive data.
{
"findings": [
[
{
"finding": "458-02-6124",
"detector": {
"name": "US social security number (SSN)",
"uuid": "e30d9a87-f6c7-46b9-a8f4-16547901e069"
},
"confidence": "VERY_LIKELY",
"location": {
"byteRange": {
"start": 39,
"end": 50
},
"codepointRange": {
"start": 39,
"end": 50
}
},
"matchedDetectionRuleUUIDs": [
"996a3c12-35d1-48cb-b858-5ee0841c652d"
],
"matchedDetectionRules": [
]
}
],
[
],
[
{
"finding": "4916-6734-7572-5015",
"detector": {
"name": "Credit card number",
"uuid": "74c1815e-c0c3-4df5-8b1e-6cf98864a454"
},
"confidence": "VERY_LIKELY",
"location": {
"byteRange": {
"start": 25,
"end": 44
},
"codepointRange": {
"start": 25,
"end": 44
}
},
"matchedDetectionRuleUUIDs": [
"996a3c12-35d1-48cb-b858-5ee0841c652d"
],
"matchedDetectionRules": [
]
}
]
],
"redactedPayload": [
"",
"",
""
]
}
# nightfall_demo.rb
# Load dependencies
require 'open-uri'
require 'net/http'
require 'json'
# Load environment variables for Nightfall API
nightfall_api_key = ENV['NIGHTFALL_API_KEY']
detection_rule_uuid = ENV['NIGHTFALL_DETECTION_RULE_UUID']
# Text data to scan
payload = [
"The customer social security number is 458-02-6124",
"No PII in this string",
"My credit card number is 4916-6734-7572-5015"
]
# Configure detection settings
config = {
"config": {
"detectionRuleUUIDs": [detection_rule_uuid]
},
"payload": payload
}
# Build API request
url = URI("https://api.nightfall.ai/v3/scan")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Accept"] = 'application/json'
request["Content-Type"] = 'application/json'
request["Authorization"] = "Bearer #{nightfall_api_key}"
request.body = config.to_json
# Make API request
response = http.request(request)
# Parse response
if response.code.to_i == 200 and response.body['findings']
puts "This text contains sensitive data.\n\n"
puts JSON.pretty_generate(JSON.parse(response.body))
elsif response.code.to_i == 200
puts "No sensitive data found. Hooray!"
else
puts "Something went wrong -- Response #{response.code}."
endcurl --request POST \
--url https://api.nightfall.ai/v3/scan \
--header 'Authorization: Bearer NF-rEpLaCeM3w1ThYoUrNiGhTfAlLKeY123' \
--header 'Content-Type: application/json' \
--data '{
"policy": {
"detectionRules": [
{
"detectors": [
{
"detectorType": "NIGHTFALL_DETECTOR",
"nightfallDetector": "US_SOCIAL_SECURITY_NUMBER",
"minNumFindings": 1,
"minConfidence": "LIKELY",
"displayName": "US Social Security Number"
},
{
"detectorType": "NIGHTFALL_DETECTOR",
"nightfallDetector": "CREDIT_CARD_NUMBER",
"minNumFindings": 1,
"minConfidence": "LIKELY",
"displayName": "Credit Card Number",
"redactionConfig": {
"maskConfig": {
"maskingChar": "👀",
"charsToIgnore": ["-"]
}
}
}
],
"name": "My Match Rule",
"logicalOp": "ANY"
}
]
},
"payload": [
"The customer social security number is 458-02-6124",
"No PII in this string",
"My credit card number is 5310-2768-6832-9293"
]
}'{
"findings": [
[
{
"finding": "458-02-6124",
"detector": {
"name": "US Social Security Number",
"uuid": "e30d9a87-f6c7-46b9-a8f4-16547901e069"
},
"confidence": "VERY_LIKELY",
"location": {
"byteRange": {
"start": 39,
"end": 50
},
"codepointRange": {
"start": 39,
"end": 50
}
},
"matchedDetectionRuleUUIDs": [],
"matchedDetectionRules": [
"My Match Rule"
]
}
],
[],
[
{
"finding": "5310-2768-6832-9293",
"redactedFinding": "👀👀👀👀-👀👀👀👀-👀👀👀👀-👀👀👀👀",
"detector": {
"name": "Credit Card Number",
"uuid": "74c1815e-c0c3-4df5-8b1e-6cf98864a454"
},
"confidence": "VERY_LIKELY",
"location": {
"byteRange": {
"start": 25,
"end": 44
},
"codepointRange": {
"start": 25,
"end": 44
}
},
"redactedLocation": {
"byteRange": {
"start": 25,
"end": 44
},
"codepointRange": {
"start": 25,
"end": 44
}
},
"matchedDetectionRuleUUIDs": [],
"matchedDetectionRules": [
"My Match Rule"
]
}
]
],
"redactedPayload": [
"",
"",
"My credit card number is 👀👀👀👀-👀👀👀👀-👀👀👀👀-👀👀👀👀"
]
}curl --location --request POST 'https://api.nightfall.ai/v3/scan' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer NF-rEpLaCeM3w1ThYoUrNiGhTfAlLKeY123' \
--header 'Content-Type: application/json' \
--data-raw '{
"config": {
"detectionRules": [
{
"detectors": [
{
"regex": {
"isCaseSensitive": false,
"pattern": "[A-Z]{2}-?\\w{3}-?\\d{2}-?\\d{5}"
},
"minNumFindings": 1,
"minConfidence": "POSSIBLE",
"detectorType": "REGEX",
"displayName": "ISRC Code Detector"
},
{
"regex": {
"isCaseSensitive": false,
"pattern": "T-[0-9]{3}\\.[0-9]{3}\\.[0-9]{3}-[0-9]"
},
"minNumFindings": 1,
"minConfidence": "POSSIBLE",
"detectorType": "REGEX",
"displayName": "ISWC Code Detector"
}
],
"name": "ISRC and ISWC Code Detection Rule",
"logicalOp": "ANY"
}
]
},
"payload": [
"Non Matching Payload",
"US-S1Z-99-00001 is an example ISRC Code: ",
"The ISWC for Symphony No. 9 is T-905.029.737-5"
]
}
'{
"findings": [
[],
[
{
"finding": "US-S1Z-99-00001",
"detector": {
"name": "ISRC Code Detector",
"uuid": "d8be87c9-4b44-41fd-b78c-8d638fe56069"
},
"confidence": "LIKELY",
"location": {
"byteRange": {
"start": 0,
"end": 15
},
"codepointRange": {
"start": 0,
"end": 15
}
},
"matchedDetectionRuleUUIDs": [],
"matchedDetectionRules": [
"ISRC and ISWC Code Detection Rule"
]
}
],
[
{
"finding": "T-905.029.737-5",
"detector": {
"name": "ISWC Code Detector",
"uuid": "faf4c830-f2ac-4934-bf9c-ff20f5a6f420"
},
"confidence": "LIKELY",
"location": {
"byteRange": {
"start": 31,
"end": 46
},
"codepointRange": {
"start": 31,
"end": 46
}
},
"matchedDetectionRuleUUIDs": [],
"matchedDetectionRules": [
"ISRC and ISWC Code Detection Rule"
]
}
]
]
}curl --location --request POST 'https://api.nightfall.ai/v3/scan' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'x-api-key: NF-rEpLaCeM3w1ThYoUrNiGhTfAlLKeY123' \
--data-raw '{
"config": {
"detectionRules": [
{
"detectors": [
{
"wordList": {
"values": [
"cat",
"dog",
"rat"
],
"isCaseSensitive": false
},
"minNumFindings": 1,
"minConfidence": "POSSIBLE",
"displayName": "animals",
"detectorType": "WORD_LIST"
}
],
"name": "WordListExamples",
"logicalOp": "ANY"
}
]
},
"payload": [
"THE CAT SAT ON THE MAT",
"The dog and the rat are on the west bank of the river",
"No one here but use chickens"
]
}'{
"findings": [
[
{
"finding": "cat",
"detector": {
"name": "animals",
"uuid": "c033e224-034a-417f-9c0d-0c8d13f462bb"
},
"confidence": "LIKELY",
"location": {
"byteRange": {
"start": 4,
"end": 7
},
"codepointRange": {
"start": 4,
"end": 7
}
},
"matchedDetectionRuleUUIDs": [],
"matchedDetectionRules": [
"WordListExamples"
]
}
],
[
{
"finding": "dog",
"detector": {
"name": "animals",
"uuid": "c033e224-034a-417f-9c0d-0c8d13f462bb"
},
"confidence": "LIKELY",
"location": {
"byteRange": {
"start": 4,
"end": 7
},
"codepointRange": {
"start": 4,
"end": 7
}
},
"matchedDetectionRuleUUIDs": [],
"matchedDetectionRules": [
"WordListExamples"
]
},
{
"finding": "rat",
"detector": {
"name": "animals",
"uuid": "c033e224-034a-417f-9c0d-0c8d13f462bb"
},
"confidence": "LIKELY",
"location": {
"byteRange": {
"start": 16,
"end": 19
},
"codepointRange": {
"start": 16,
"end": 19
}
},
"matchedDetectionRuleUUIDs": [],
"matchedDetectionRules": [
"WordListExamples"
]
}
],
[]
],
"redactedPayload": [
"",
"",
""
]
}policyconfig
{
"findings":[
{
"path":"Sheet1 (5)",
"detector":{
"id":"e30d9a87-f6c7-46b9-a8f4-16547901e069",
"name":"US social security number (SSN)",
"version":1
},
"finding":"624-84-9182",
"confidence":"LIKELY",
"location":{
"byteRange":{
"start":2505,
"end":2516
},
"codepointRange":{
"start":2452,
"end":2463
},
"lineRange":{
"start":55,
"end":55
},
"rowRange":{
"start":55,
"end":55
},
"columnRange":{
"start":2,
"end":2
},
"commitHash":""
},
"matchedDetectionRuleUUIDs":[
"950833c9-8608-4c66-8a3a-0734eac11157"
],
"matchedDetectionRules":[
]
},
...curl --request POST \
--url https://api.nightfall.ai/v3/upload/02a0c5e1-c950-4e28-a988-f6fffefc4205/scan \
--header 'Accept: application/json' \
--header 'Authorization: Bearer NF-<Your API Key>' \
--header 'Content-Type: application/json' \
--data '
{
"policy": {
"detectionRuleUUIDs": [
"950833c9-8608-4c66-8a3a-0734eac11157"
],
"alertConfig": {
"email": {
"address": "<your email addres>"
}
},
"defaultRedactionConfig": {
"maskConfig": {
"charsToIgnore": [
"-",
"@"
],
"maskingChar": "*"
}
},
"enableFileRedaction": true
},
"requestMetadata": "csv redaction test"
}
'{
"errors":null,
"findingsPresent":true,
"findingsURL":"https://files.nightfall.ai/asdfc5e1-c950-4e28-a988-f6fffefc4205.json?Expires=1655324479&Signature=zjo1nT-PECHC-fiTvAgdA8aDnceoY~6iGfzOBCcBjscKqOHnIar8hoH4gGufffiulBw5BpfJuvWwBW~lXO~ZNhN139LDwoTsfLJswJiQCB2Hj-Az0Em6go~1j8WBqCS8G0Gk17M-zcPedHGX3z~1pw8nm5sh6Pa-jJwfw9NIEiqmBb3Vdcj3J-~Wzag~ENV4499rnG299ee-ig5Ms1oVlzycb4YxzgTMrTL5Q07ozNenwFZcGDNQre1inLXmV-m8teLX-K3boklenp9KXiNDDV0wi74ADN-QfIR1q1oU7mEI1f3aVC3kju0QRErp2lsfs08EtZKLE3C4N17jDJdYcw__&Key-Pair-Id=K24YOPZ1EKX0YC",
"redactedFile":{
"fileURL":"https://files.nightfall.ai/asdfc5e1-c950-4e28-a988-f6fffefc4205-redacted.csv?Expires=1655324479&Signature=Hx8kRh88maLeStysy3fsLbFVG9VELEtfemtQe2lWUnFjAMd9HqlEksTmirqAWFWV4zPVUB73izlMj5cSer8v2N5ZCcnD3dz~nnwR4P5LewGJ2CQzGnDnXgh70HW5qp04gnUD-pYWp~bGPVspkJKCkl1zH-EoGonvcNVq3SNsVzOlsVIjep7Y7otQKEEyAZ7JmHiVfuBxrvn8pleuC5lEJ3f9miPyoRqH9DyPlNTJTIuijqe9q32Qcui2RsDR6IT-foFX52dy6rRa01ZV0gZMDWJokMlCr8Iu5An~qnhxC49bqTtI82oz9FcBaP-Yea8cq1TiAfGxX7CJ0~JeTLvr6g__&Key-Pair-Id=K24YOPZ1EKX0YC",
"validUntil":"2022-06-15T20:21:19.750990823Z"
},
"requestMetadata":"csv redaction test",
"uploadID":"02a0c5e1-c950-4e28-a988-f6fffefc4205",
"validUntil":"2022-06-15T20:21:19.723045787Z"
}name,email,phone,alphanumeric
Ulric Burton,*****@*************,*-***-***-****,TEL82EBM1GQ
Wade Jones,******************@***********,(********-****,VVF64PJV2EF
Molly Mccullough,*****************@**********,(********-****,OHO41SFZ2BR
Raja Riggs,************@**********,(********-****,UVD51JTE5NZ
Colin Carter,**********************@*********,(********-****,LNI34LLC5WV// Some code{
"findings":[
{
"path":"f607a067..53e59684/nightfall.go",
"detector":{
"id":"6123060e-2d9f-4f35-a7a1-743379ea5616",
"name":"URL"
},
"finding":"https://api.nightfall.ai/\"",
"confidence":"LIKELY",
"location":{
"byteRange":{
"start":142,
"end":168
},
"codepointRange":{
"start":142,
"end":168
},
"lineRange":{
"start":16,
"end":16
},
"rowRange":{
"start":0,
"end":0
},
"columnRange":{
"start":0,
"end":0
},
"commitHash":"53e59684d9778ceb0f0ed6a4b949c464c24d35ce"
},
"beforeContext":"tp\"\n\t\"os\"\n\t\"time\"\n)\n\nconst (\n\tAPIURL = \"",
"afterContext":"\n\n\tDefaultFileUploadConcurrency = 1\n\tDef",
"matchedDetectionRuleUUIDs":[
"cda0367f-aa75-4d6a-904f-0311209b3383"
],
"matchedDetectionRules":[
]
},
...cd nightfall-go-sdk
git checkout 53e59684d9778ceb0f0ed6a4b949c464c24d35ce{
"policy": {
"detectionRules": [
{
"detectors": [
{
"detectorType": "NIGHTFALL_DETECTOR",
"nightfallDetector": "US_SOCIAL_SECURITY_NUMBER",
"minNumFindings": 1,
"minConfidence": "LIKELY",
"displayName": "US Social Security Number"
}
],
"name": "SSN Match Detection Rule",
"logicalOp": "ALL"
}
],
"contextBytes": 5,
"alertConfig": {
"email": {
"address": "[email protected]"
}
}
},
"payload": [
"The customer's social security number is 555-55-5555",
"No SSN in this string"
]
}{
"findings": [
[
{
"finding": "555-55-5555",
"beforeContext": "r is ",
"detector": {
"name": "US Social Security Number",
"uuid": "e30d9a87-f6c7-46b9-a8f4-16547901e069"
},
"confidence": "VERY_LIKELY",
"location": {
"byteRange": {
"start": 41,
"end": 52
},
"codepointRange": {
"start": 41,
"end": 52
},
"rowRange": null,
"columnRange": null,
"commitHash": ""
},
"matchedDetectionRuleUUIDs": [],
"matchedDetectionRules": [
"SSN Match Detection Rule"
]
}
],
[]
],
"redactedPayload": [
"",
""
]
}curl --request POST \
--url https://api.nightfall.ai/v3/scan \
--header 'accept: application/json' \
--header 'authorization: Bearer <InsertYourApiKeyHere>' \
--header 'content-type: application/json' \
--data '
{
"policyUUIDs": [
"2b2ced32-80c3-4a89-8757-489743ec4640"
],
"payload": [
"My payload to scan"
]
}
'{
"redactedPayload": [
"",
""
],
"findings": [
[
{
"confidence": "LIKELY",
"matchedDetectionRules": [
"SSN Match Detection Rule"
],
"matchedDetectionRuleUUIDs": [],
"location": {
"codepointRange": {
"start": 41,
"end": 52
},
"rowRange": null,
"byteRange": {
"start": 41,
"end": 52
},
"columnRange": null,
"commitHash": ""
},
"finding": "555-55-5555",
"detector": {
"name": "SSN Match Detector",
"uuid": "7270ccd5-07c5-44e5-b280-c768e0028963"
},
"beforeContext": "r is "
}
],
[]
]
}
{
"policy": {
"detectionRuleUUIDs": [
"c8d43147-0a63-4c01-8a57-83d8108422f5"
],
"alertConfig": {
"url": {
"address": "https://mywebhookurl.com"
}
}
},
"payload": [
"The customer's social security number is 555-55-5555"
]
}{
"policy": {
"detectionRules": [
{
"detectors": [
{
"detectorType": "NIGHTFALL_DETECTOR",
"nightfallDetector": "US_SOCIAL_SECURITY_NUMBER",
"minNumFindings": 1,
"minConfidence": "LIKELY",
"displayName": "US Social Security Number"
}
],
"name": "Simple SSN Match Detection Rule",
"logicalOp": "ALL"
}
],
"alertConfig": {
"slack": {
"target": "#securityalert"
}
}
},
"payload": [
"The customer's social security number is 555-55-5555",
"No SSN in this string"
]
}{
"policy": {
"detectionRules": [
{
"detectors": [
{
"nightfallDetector": "CREDIT_CARD_NUMBER",
"detectorType": "NIGHTFALL_DETECTOR",
"minConfidence": "POSSIBLE",
"minNumFindings": 1
}
],
"logicalOp": "ALL"
}
],
"alertConfig": {
"email": {
"address": "<your email>"
},
"siem": {
"sensitiveHeaders": {
"Authorization": "Splunk <your token value>"
},
"address": "https://http-inputs-<yourhost>.splunkcloud.com:8088/services/collector/event"
}
}
},
"payload": [
"4916-6734-7572-5015 is my credit card number",
"This string does not have any sensitive data",
"my api key is yr+ZWwIZp6ifFgaHV8410b2BxbRt5QiAj1EZx1qj and my 💳 credit card number 💰 is 30204861594838"
]
}
{
"policy": {
"detectionRules": [
{
"detectors": [
{
"detectorType": "NIGHTFALL_DETECTOR",
"nightfallDetector": "US_SOCIAL_SECURITY_NUMBER",
"minNumFindings": 1,
"minConfidence": "LIKELY",
"displayName": "US Social Security Number"
}
],
"name": "Simple SSN Match Detection Rule",
"logicalOp": "ALL"
}
],
"defaultRedactionConfig": {
"maskConfig": {
"charsToIgnore": [
"-"
],
"maskingChar": "#",
"numCharsToLeaveUnmasked": 4,
"maskLeftToRight": true
}
},
"contextBytes": 5,
"alertConfig": {
"email": {
"address": "[email protected]"
}
}
},
"payload": [
"The customers social security number is 555-55-5555",
"No SSN in this string"
]
}>>> from nightfall import Confidence, DetectionRule, Detector, Nightfall, EmailAlert, AlertConfig
>>> import os
>>> # use your API Key here
>>> nightfall = Nightfall("NF-y0uRaPiK3yG03sH3r3")
>>> # A rule contains a set of detectors to scan with
>>> cc = Detector(min_confidence=Confidence.LIKELY, nightfall_detector="CREDIT_CARD_NUMBER")
>>> ssn = Detector(min_confidence=Confidence.POSSIBLE, nightfall_detector="US_SOCIAL_SECURITY_NUMBER")
>>> detection_rule = DetectionRule([cc, ssn])
>>> # The scanning is done asynchronously, so provide a valid email address as the simplest way of getting results
>>> alertconfig = alert_config=AlertConfig(email=EmailAlert("[email protected]"))
>>> # Upload the file and start the scan.
>>> id, message = nightfall.scan_file( "./README.md", detection_rules=[detection_rule],
>>> print("started scan", id, message)//this script assumes the node sdk has been installed locally with `npm install` and `npm run build`
import { Nightfall } from "./nightfall-nodejs-sdk/dist/nightfall.js";
import { Detector } from "./nightfall-nodejs-sdk/dist/types/detectors.js";
// By default, the client reads your API key from the environment variable NIGHTFALL_API_KEY
const uploadit = async() => {
var data = null;
const nfClient = new Nightfall();
try{
const response = await nfClient.scanFile('./README.md', {
detectionRules: [
{
name: 'Secrets Scanner',
logicalOp: 'ANY',
detectors: [
{
minNumFindings: 1,
minConfidence: Detector.Confidence.Possible,
displayName: 'Credit Card Number',
detectorType: Detector.Type.Nightfall,
nightfallDetector: 'CREDIT_CARD_NUMBER',
},
],
},
],
alertConfig: {
email: {
address: "[email protected]"
}
}
});
if (response.isError) {
data = response.getError();
}
else{
data = (response.data.id);
}
}
catch(e){
console.log(e);
}
return data;
}
uploadit().then(data => console.log(data));The UUID of the policy to update
user emails to be added in inclusion setting, supports both internal & external users
user emails to be added in exclusion setting, supports both internal & external users
user emails to be removed in inclusion setting, supports both internal & external users
user emails to be removed in exclusion setting, supports both internal & external users
The UUID of the policy to update
domains to be added in inclusion setting
domains to be added in exclusion setting
domains to be removed in inclusion setting
domains to be removed in exclusion setting
Successful response (processed immediately)
How many remaining requests you can make within the next second before being throttled
How many remaining requests you can make within the next quota period
When the current quota period expires
a list of all included domains in the policy
a list of all excluded domains in the policy
Invalid request parameters
Authentication failure
Operation prohibited on the policy
Policy not found
Rate Limit Exceeded or Daily Quota Exceeded
Internal Nightfall Error
The UUID of the policy to update
user emails to be added in inclusion setting
user emails to be added in exclusion setting
user emails to be removed from inclusion setting
user emails to be removed from exclusion setting
Successful response (processed immediately)
How many remaining requests you can make within the next second before being throttled
How many remaining requests you can make within the next quota period
When the current quota period expires
a list of all included user identifiers (emails or IDs) in the policy trigger scope
a list of all excluded user identifiers (emails or IDs) in the policy trigger scope
Invalid request parameters
Authentication failure
Operation prohibited on the policy
Policy not found
Rate Limit Exceeded or Daily Quota Exceeded
Internal Nightfall Error
The UUID of the policy to update
domains to be added in inclusion setting
domains to be added in exclusion setting
domains to be removed from inclusion setting
domains to be removed from exclusion setting
Successful response (processed immediately)
How many remaining requests you can make within the next second before being throttled
How many remaining requests you can make within the next quota period
When the current quota period expires
a list of all included domains in the policy trigger scope
a list of all excluded domains in the policy trigger scope
Invalid request parameters
Authentication failure
Operation prohibited on the policy
Policy not found
Rate Limit Exceeded or Daily Quota Exceeded
Internal Nightfall Error
curl --location --request POST 'https://api.nightfall.ai/v3/upload' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer NF-rEpLaCeM3w1ThYoUrNiGhTfAlLKeY123' \
--data-raw '{
"fileSizeBytes": 73891,
"mimeType" : "image/png"
}'{
"id": "f9dbdb15-c9fa-46ff-86ec-cd5c09aa550d",
"fileSizeBytes": 73891,
"chunkSize": 10485760,
"mimeType": "image/png"
}PATCH /v3/upload/<uploadUUID>curl --location --request PATCH 'https://api.nightfall.ai/v3/upload/f9dbdb15-c9fa-46ff-86ec-cd5c09aa550d' \
--header 'X-Upload-Offset: 0' \
--header 'Content-Type: application/octet-stream' \
--header 'Authorization: Bearer NF-rEpLaCeM3w1ThYoUrNiGhTfAlLKeY123' \
--data-binary '@/Users/myname/Documents/work/Nightfall/Nightfall Upload Sequence.png'curl --location --request POST 'https://api.nightfall.ai/v3/upload/f9dbdb15-c9fa-46ff-86ec-cd5c09aa550d/finish' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer NF-rEpLaCeM3w1ThYoUrNiGhTfAlLKeY123' \
--data-raw '""'{
"id": "152848af-2ac9-4e0a-8563-2b82343d964a",
"fileSizeBytes": 2349,
"chunkSize": 10485760,
"mimeType": "application/zip"
}curl --request POST \
--url https://api.nightfall.ai/v3/upload/f9dbdb15-c9fa-46ff-86ec-cd5c09aa550d/scan \
--header 'Accept: application/json' \
--header 'Authorization: Bearer NF-rEpLaCeM3w1ThYoUrNiGhTfAlLKeY123' \
--header 'Content-Type: application/json' \
--data '
{
"policy": {
"detectionRuleUUIDs": [
"950833c9-8608-4c66-8a3a-0734eac11157"
],
"webhookURL": "https://mycompany.org/webhookservice"
},
"requestMetadata": "your file metadata"
}
'from os import getenv, path
import fire
import requests
BASE_UPLOAD_URL = getenv("FILE_UPLOAD_HOST", "http://api.nightfall.ai/v3")
NF_API_KEY = getenv("NF_API_KEY")
def upload(filepath, mimetype, policy_uuid):
"""Upload the given file using the provided MIMEType and PolicyUUID.
Arguments:
file_path -- an absolute or relative path to the file that will be
uploaded to the API.
mimetype -- (optional) The mimetype of the file being uploaded.
policy_uuid -- The UUID corresponding to an existing policy. This
policy must be active and have a webhook URL associated with it.
"""
default_headers = {
"Authorization": F"Bearer {NF_API_KEY}",
}
# =*=*=*=*=* Initiate Upload =*=*=*=*=*=*
file_size = path.getsize(filepath)
upload_request_body = {"fileSizeBytes": file_size, "mimeType": mimetype}
r = requests.post(F"{BASE_UPLOAD_URL}/upload",
headers=default_headers,
json=upload_request_body)
upload = r.json()
if not r.ok:
raise Exception(F"Unexpected error initializing upload - {upload}")
# =*=*=*=*=*=* Upload Chunks =*=*=*=*=*=*
chunk_size = upload["chunkSize"]
i = 0
with open(filepath, "rb") as file:
while file.tell() < file_size:
upload_chunk_headers = {
**default_headers,
"X-UPLOAD-OFFSET": str(file.tell())
}
r = requests.patch(F"{BASE_UPLOAD_URL}/upload/{upload['id']}",
headers=upload_chunk_headers,
data=file.read(chunk_size))
if not r.ok:
raise Exception(F"Unexpected error uploading chunk - {r.text}")
i += 1
# =*=*=*=*=*=* Finish Upload =*=*=*=*=*=*
r = requests.post(F"{BASE_UPLOAD_URL}/upload/{upload['id']}/finish",
headers=default_headers)
if not r.ok:
raise Exception(F"Unexpected error finalizing upload - {r.text}")
# =*=*=*=*=* Scan Uploaded File =*=*=*=*=*
r = requests.post(F"{BASE_UPLOAD_URL}/upload/{upload['id']}/scan",
json={"policyUUID": policy_uuid},
headers=default_headers)
if not r.ok:
raise Exception(F"Unexpected error initiating scan - {r.text}")
print("Scan Initiated Successfully - await response on configured webhook")
quota_remaining = r.headers.get('X-Quota-Remaining')
if quota_remaining is not None and int(quota_remaining) <= 0:
print(F"Scan quota exhausted - Quota will reset on {r.headers['X-Quota-Period-End']}")
if __name__ == "__main__":
fire.Fire(upload)Successful response (processed immediately)
How many remaining requests you can make within the next second before being throttled
How many remaining requests you can make within the next quota period
When the current quota period expires
a list of all included user identifiers (emails or id's) in the policy
a list of all excluded user identifiers (emails or id's) in the policy
Invalid request parameters
Authentication failure
Operation prohibited on the policy
Policy not found
Rate Limit Exceeded or Daily Quota Exceeded
Internal Nightfall Error
{
"minNumFindings":1,
"minConfidence":"POSSIBLE",
"detectorType":"NIGHTFALL_DETECTOR",
"nightfallDetector":"DATE_OF_BIRTH",
"redactionConfig":{
"maskConfig":{
"charsToIgnore":[
"/"
],
"maskingChar":"?",
"maskRightToLeft":true,
"numCharsToLeaveUnMasked":2
}
}
}{
"minNumFindings":1,
"minConfidence":"POSSIBLE",
"detectorType":"NIGHTFALL_DETECTOR",
"nightfallDetector":"EMAIL_ADDRESS",
"displayName":"email",
"redactionConfig":{
"cryptoConfig":{
"publicKey":"-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAydYMwOYUGyBXDgHkzv19YR/dYQES4kYTMUps39qv/amNDywz4nsBDvCUqUvcN3nEpplHlYGH5ShSeA4G/FcmRqynSLVyFPZat/8E7n+EeHsgihFrr8oDWo5UBjCwRinTrC0m11q/5SeNzwVCWkf9x40u94QBz13dQoa9yPwaZBX5uBzyH86R7yeZHpad2cLq0ltpmJ3j5UfsFilkOb3JB60TNpNDdfabprot/y30CEnDDOgAXGtV1m0AhQpQjKRnkUs39DntqSbS+i0UgbyqzEGNUkeR1WsotXekW4KnbWA7k6S8SfkO27vnTSY5b9g/KKaOdysn5YaWJPfTVT/nywIDAQAB\n-----END PUBLIC KEY-----"
}
}
}curl --location --request POST 'https://api.nightfall.ai/v3/scan' \
--header 'x-api-key: NF-rEpLaCeM3w1ThYoUrNiGhTfAlLKeY123' \
--header 'Content-Type: text/plain' \
--data-raw '{
"payload":[
"my ssn is 123-45-5555 and date of birth is 01/11/1995 and my credit card number is 4242 4242 4242 4242 and my email is [email protected].",
"my date of birth is 03 23 4242 4242 4242 4242 amex"
],
"policy":{
"detectionRules":[
{
"detectors":[
{
"minNumFindings":1,
"minConfidence":"POSSIBLE",
"detectorType":"NIGHTFALL_DETECTOR",
"nightfallDetector":"CREDIT_CARD_NUMBER",
"displayName":"cc",
"redactionConfig":{
"infoTypeSubstitutionConfig":{
},
"removeFinding":true
}
},
{
"minNumFindings":1,
"minConfidence":"POSSIBLE",
"detectorType":"NIGHTFALL_DETECTOR",
"nightfallDetector":"US_SOCIAL_SECURITY_NUMBER",
"displayName":"ssn",
"redactionConfig":{
"substitutionConfig":{
"substitutionPhrase":"*REDACTED*"
}
}
},
{
"minNumFindings":1,
"minConfidence":"POSSIBLE",
"detectorType":"NIGHTFALL_DETECTOR",
"nightfallDetector":"EMAIL_ADDRESS",
"displayName":"email",
"redactionConfig":{
"cryptoConfig":{
"publicKey":"-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAydYMwOYUGyBXDgHkzv19YR/dYQES4kYTMUps39qv/amNDywz4nsBDvCUqUvcN3nEpplHlYGH5ShSeA4G/FcmRqynSLVyFPZat/8E7n+EeHsgihFrr8oDWo5UBjCwRinTrC0m11q/5SeNzwVCWkf9x40u94QBz13dQoa9yPwaZBX5uBzyH86R7yeZHpad2cLq0ltpmJ3j5UfsFilkOb3JB60TNpNDdfabprot/y30CEnDDOgAXGtV1m0AhQpQjKRnkUs39DntqSbS+i0UgbyqzEGNUkeR1WsotXekW4KnbWA7k6S8SfkO27vnTSY5b9g/KKaOdysn5YaWJPfTVT/nywIDAQAB\n-----END PUBLIC KEY-----"
}
}
},
{
"minNumFindings":1,
"minConfidence":"POSSIBLE",
"detectorType":"NIGHTFALL_DETECTOR",
"nightfallDetector":"DATE_OF_BIRTH",
"redactionConfig":{
"maskConfig":{
"charsToIgnore":[
"/"
],
"maskingChar":"?",
"maskRightToLeft":true,
"numCharsToLeaveUnMasked":2
}
}
}
],
"name":"cc",
"logicalOp":"ANY"
}
]
}
}'{
"findings":[
[
{
"finding":"[email protected]",
"redactedFinding":"X8QL0mZGHZ+N47nPEccjsLHf2F/5cFqjF16P6wgYJhy8IaxHipHWMBRAufKR4T8FFkvTuTEanu6ZAA+V8NTkNmTLxHarcWPSVClJ8kjXAPltLuR4I2H4eeT+sWEvUP3ik/BF1KcxRpsYWDQO1bNYk+WReXkWlW72Q7rbWuTGFj2uDFCPS+DUraDh9wNBsMPELFOnh1GSQIKCp9U5GMp/kkpo/0idh83RVHXyjZPT4ReKEST2oG2lQ9UuP5LJy/mHX1VYgd8DwlETn8nkhqJ1T0mGs6kHSh22G6N0ic0PjHnj73RiMnQdPwlLw3qyPmFf6RRLKtFuzmFan8ZGtZhcKA==",
"detector":{
"name":"email",
"uuid":"c0235299-0f26-4ad6-ad8c-71f83daf44e9"
},
"confidence":"VERY_LIKELY",
"location":{
"byteRange":{
"start":120,
"end":135
},
"codepointRange":{
"start":120,
"end":135
},
"rowRange":null,
"columnRange":null,
"commitHash":""
},
"redactedLocation":{
"byteRange":{
"start":120,
"end":135
},
"codepointRange":{
"start":120,
"end":135
},
"rowRange":null,
"columnRange":null,
"commitHash":""
},
"matchedDetectionRuleUUIDs":[
],
"matchedDetectionRules":[
"cc"
]
},
{
"finding":"01/11/1995",
"redactedFinding":"??/??/??95",
"detector":{
"name":"DATE_OF_BIRTH",
"uuid":"540856cb-99cb-42e7-b8aa-cd4f22f019d7"
},
"confidence":"LIKELY",
"location":{
"byteRange":{
"start":43,
"end":53
},
"codepointRange":{
"start":43,
"end":53
},
"rowRange":null,
"columnRange":null,
"commitHash":""
},
"redactedLocation":{
"byteRange":{
"start":43,
"end":53
},
"codepointRange":{
"start":43,
"end":53
},
"rowRange":null,
"columnRange":null,
"commitHash":""
},
"matchedDetectionRuleUUIDs":[
],
"matchedDetectionRules":[
"cc"
]
},
{
"finding":"",
"redactedFinding":"[CREDIT_CARD_NUMBER]",
"detector":{
"name":"cc",
"uuid":"74c1815e-c0c3-4df5-8b1e-6cf98864a454"
},
"confidence":"VERY_LIKELY",
"location":{
"byteRange":{
"start":84,
"end":103
},
"codepointRange":{
"start":84,
"end":103
},
"rowRange":null,
"columnRange":null,
"commitHash":""
},
"redactedLocation":{
"byteRange":{
"start":84,
"end":103
},
"codepointRange":{
"start":84,
"end":103
},
"rowRange":null,
"columnRange":null,
"commitHash":""
},
"matchedDetectionRuleUUIDs":[
],
"matchedDetectionRules":[
"cc"
]
},
{
"finding":"123-45-5555",
"redactedFinding":"*REDACTED*",
"detector":{
"name":"ssn",
"uuid":"e30d9a87-f6c7-46b9-a8f4-16547901e069"
},
"confidence":"VERY_LIKELY",
"location":{
"byteRange":{
"start":10,
"end":21
},
"codepointRange":{
"start":10,
"end":21
},
"rowRange":null,
"columnRange":null,
"commitHash":""
},
"redactedLocation":{
"byteRange":{
"start":10,
"end":21
},
"codepointRange":{
"start":10,
"end":21
},
"rowRange":null,
"columnRange":null,
"commitHash":""
},
"matchedDetectionRuleUUIDs":[
],
"matchedDetectionRules":[
"cc"
]
}
],
[
{
"finding":"",
"redactedFinding":"[CREDIT_CARD_NUMBER]",
"detector":{
"name":"cc",
"uuid":"74c1815e-c0c3-4df5-8b1e-6cf98864a454"
},
"confidence":"VERY_LIKELY",
"location":{
"byteRange":{
"start":26,
"end":45
},
"codepointRange":{
"start":26,
"end":45
},
"rowRange":null,
"columnRange":null,
"commitHash":""
},
"redactedLocation":{
"byteRange":{
"start":26,
"end":45
},
"codepointRange":{
"start":26,
"end":45
},
"rowRange":null,
"columnRange":null,
"commitHash":""
},
"matchedDetectionRuleUUIDs":[
],
"matchedDetectionRules":[
"cc"
]
},
{
"finding":"03 23 4242",
"redactedFinding":"????????42",
"detector":{
"name":"DATE_OF_BIRTH",
"uuid":"540856cb-99cb-42e7-b8aa-cd4f22f019d7"
},
"confidence":"LIKELY",
"location":{
"byteRange":{
"start":20,
"end":30
},
"codepointRange":{
"start":20,
"end":30
},
"rowRange":null,
"columnRange":null,
"commitHash":""
},
"redactedLocation":{
"byteRange":{
"start":20,
"end":30
},
"codepointRange":{
"start":20,
"end":30
},
"rowRange":null,
"columnRange":null,
"commitHash":""
},
"matchedDetectionRuleUUIDs":[
],
"matchedDetectionRules":[
"cc"
]
}
]
],
"redactedPayload":[
"my ssn is *REDACTED* and date of birth is ??/??/??95 and my credit card number is [CREDIT_CARD_NUMBER] and my email is X8QL0mZGHZ+N47nPEccjsLHf2F/5cFqjF16P6wgYJhy8IaxHipHWMBRAufKR4T8FFkvTuTEanu6ZAA+V8NTkNmTLxHarcWPSVClJ8kjXAPltLuR4I2H4eeT+sWEvUP3ik/BF1KcxRpsYWDQO1bNYk+WReXkWlW72Q7rbWuTGFj2uDFCPS+DUraDh9wNBsMPELFOnh1GSQIKCp9U5GMp/kkpo/0idh83RVHXyjZPT4ReKEST2oG2lQ9UuP5LJy/mHX1VYgd8DwlETn8nkhqJ1T0mGs6kHSh22G6N0ic0PjHnj73RiMnQdPwlLw3qyPmFf6RRLKtFuzmFan8ZGtZhcKA==.",
"my date of birth is [REDACTED BY NIGHTFALL] amex"
]
}POST /policy/v1/{policyID}/scope/users HTTP/1.1
Host: api.nightfall.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 136
{
"add": {
"include": [
"[email protected]"
],
"exclude": [
"[email protected]"
]
},
"delete": {
"include": [
"[email protected]"
],
"exclude": [
"[email protected]"
]
}
}{
"includedUsers": [
"text"
],
"excludedUsers": [
"text"
]
}{
"includedDomains": [
"text"
],
"excludedDomains": [
"text"
]
}{
"includedUsers": [
"text"
],
"excludedUsers": [
"text"
]
}{
"includedDomains": [
"text"
],
"excludedDomains": [
"text"
]
}POST /policy/v1/{policyID}/scope/domains HTTP/1.1
Host: api.nightfall.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 96
{
"add": {
"include": [
"text"
],
"exclude": [
"text"
]
},
"delete": {
"include": [
"text"
],
"exclude": [
"text"
]
}
}POST /policy/v1/{policyID}/trigger/users HTTP/1.1
Host: api.nightfall.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 136
{
"add": {
"include": [
"[email protected]"
],
"exclude": [
"[email protected]"
]
},
"delete": {
"include": [
"[email protected]"
],
"exclude": [
"[email protected]"
]
}
}POST /policy/v1/{policyID}/trigger/domains HTTP/1.1
Host: api.nightfall.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 96
{
"add": {
"include": [
"text"
],
"exclude": [
"text"
]
},
"delete": {
"include": [
"text"
],
"exclude": [
"text"
]
}
}The maximum number of records to be returned in the response
100Cursor for getting the next page of results
Successful response
How many remaining requests you can make within the next second before being throttled
How many remaining requests you can make within the next quota period
When the current quota period expires
The GitHub repository ID
The name of the repository
Whether the repo is private
The URL of the repository
Unix timestamp, the last scan time of any file/commit in the repository. Omitted if not scanned yet.
Whether the repository is covered by a policy
GitHub username in case of a personal account and organization name in case of an organization
Next page cursor, omitted if end of results reached
Invalid request parameters
Authentication failure
Rate Limit Exceeded or Daily Quota Exceeded
Internal Nightfall Error
The maximum number of agents to be returned in the response
500Cursor for getting the next page of results
Prefix search across device name, device ID, and user email
Filter agents by version status
Filter agents by stealth mode status
Filter agents by profile status
Comma-delimited list of BROWSER:INSTALLED pairs to filter by browser extension status. Example: BROWSER_CHROME:true,BROWSER_EDGE:false. Supported browsers: BROWSER_CHROME, BROWSER_EDGE, BROWSER_FIREFOX, BROWSER_SAFARI, BROWSER_ARC, BROWSER_ATLAS, BROWSER_BRAVE, BROWSER_CHROME_BETA, BROWSER_COMET, BROWSER_VIVALDI. INSTALLED is true or false.
BROWSER_CHROME:true,BROWSER_EDGE:falseSuccessful response
How many remaining requests you can make within the next second before being throttled
How many remaining requests you can make within the next quota period
When the current quota period expires
Operating system of the endpoint device
Name of the endpoint device
Unique identifier for the endpoint device
MAC addresses of the endpoint device's network interfaces
Current connection status of the agent
Timestamp of the agent's last connection. Omitted if never connected.
Version of the installed agent
Version of the operating system
Email of the user associated with the agent
Stealth mode status of the agent
Configuration profile installation status
The browser name
Extension installation status for this browser
Whether the extension is connected for any profile
Total number of agents matching the filter criteria
Next page cursor, omitted if end of results reached
Invalid request parameters
Authentication failure
Rate Limit Exceeded or Daily Quota Exceeded
Internal Nightfall Error
GET /apps/v1/github/repositories HTTP/1.1
Host: api.nightfall.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"repositories": [
{
"repositoryID": 1,
"repositoryName": "text",
"isRepoPrivate": true,
"repoLink": "text",
"scannedAt": 1,
"isMonitored": true,
"githubUsername": "text"
}
],
"nextPageToken": "text"
}GET /apps/v1/endpoint/devices HTTP/1.1
Host: api.nightfall.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"agents": [
{
"os": "MAC_OS",
"deviceName": "text",
"deviceId": "text",
"macAddresses": [
"text"
],
"connectionStatus": "ONLINE",
"lastConnection": "2026-04-09T05:44:16.209Z",
"agentVersion": "text",
"osVersion": "text",
"userEmail": "text",
"stealthMode": "STEALTH_MODE_STATUS_UNKNOWN",
"profileStatus": "PROFILE_STATUS_UNKNOWN",
"missingPermissions": [
"AGENT_PERMISSION_FULL_DISK_ACCESS"
],
"errors": [
"AGENT_ERROR_CODE_USER_AGENT_NOT_CONNECTED"
],
"extensionInstallationStatuses": [
{
"browser": "BROWSER_CHROME",
"status": "BROWSER_EXTENSION_INSTALLATION_STATUS_UNKNOWN",
"extensionConnected": true
}
]
}
],
"totalAgents": 1,
"nextPageToken": "text"
}nightfall
Flask
Gunicornexport NIGHTFALL_API_KEY=<your_key_here>
export NIGHTFALL_SIGNING_SECRET=<your_secret_here>import os
from flask import Flask, request, render_template
from nightfall import Confidence, DetectionRule, Detector, RedactionConfig, MaskConfig, Nightfall
from datetime import datetime, timedelta
import urllib.request, urllib.parse, json
app = Flask(__name__)
nightfall = Nightfall(
key=os.getenv('NIGHTFALL_API_KEY'),
signing_secret=os.getenv('NIGHTFALL_SIGNING_SECRET')
)@app.route("/ping")
def ping():
return "Hello World", 200[2021-11-26 14:22:53 -0800] [61196] [INFO] Starting gunicorn 20.1.0
[2021-11-26 14:22:53 -0800] [61196] [INFO] Listening at: http://127.0.0.1:8000 (61196)
[2021-11-26 14:22:53 -0800] [61196] [INFO] Using worker: sync
[2021-11-26 14:22:53 -0800] [61246] [INFO] Booting worker with pid: 61246Account Nightfall Example
Version 2.3.40
Region United States (us)
Web Interface http://127.0.0.1:4040
Forwarding http://3ecedafba368.ngrok.io -> http://localhost:8000
Forwarding https://3ecedafba368.ngrok.io -> http://localhost:8000export NIGHTFALL_SERVER_URL=https://3ecedafba368.ngrok.io# respond to POST requests at /ingest
# Nightfall will send requests to this webhook endpoint with file scan results
@app.route("/ingest", methods=['POST'])
def ingest():
data = request.get_json(silent=True)
# validate webhook URL with challenge response
challenge = data.get("challenge")
if challenge:
return challenge
# challenge was passed, now validate the webhook payload
else:
# get details of the inbound webhook request for validation
request_signature = request.headers.get('X-Nightfall-Signature')
request_timestamp = request.headers.get('X-Nightfall-Timestamp')
request_data = request.get_data(as_text=True)
if nightfall.validate_webhook(request_signature, request_timestamp, request_data):
# check if any sensitive findings were found in the file, return if not
if not data["findingsPresent"]:
print("No sensitive data present!")
return "", 200
# there are sensitive findings in the file
# URL escape the temporary signed S3 URL where findings are available for download
escaped_url = urllib.parse.quote(data['findingsURL'])
# print the download URL and the URL where we can view the results in our web app
print(f"Sensitive data present. Findings available until {data['validUntil']}.\n\nDownload:\n{data['findingsURL']}\n\nView:\n{request.url_root}view?findings_url={escaped_url}\n")
return "", 200
else:
return "Invalid webhook", 500import os
from nightfall import Confidence, DetectionRule, Detector, RedactionConfig, MaskConfig, Nightfall
nightfall = Nightfall() # reads API key from NIGHTFALL_API_KEY environment variable by default
filepath = "sample-pci-xs.csv" # sample file with sensitive data
webhook_url = f"{os.getenv('NIGHTFALL_SERVER_URL')}/ingest"scan_id, message = nightfall.scan_file(filepath,
webhook_url=webhook_url,
detection_rules=[ DetectionRule([
Detector(
min_confidence=Confidence.LIKELY,
nightfall_detector="CREDIT_CARD_NUMBER",
display_name="Credit Card Number"
)])
])
print(scan_id, message)Sensitive data present. Findings available until 2021-11-28T00:29:00.479700877Z.
Download:
https://files.nightfall.ai/d2160270-6b07-4304-b1ee-e7b98498be82.json?Expires=1638059340&Signature=AjSdNGlXWGXO0QGSi-lOoDBtbhJdLPE7IWXA7IaBCfLr~3X2IcZ1vavHF5iaEDaoZ-3etnZA4Nu8K8Dq8Kd81ShuX6Ze1o87mzb~8lD6WBk8hXShgW-TPBPpLMoBx2sA9TnefTqy94gI4ykt4tt1MttB67Cj69Miw-46cpFkgY9tannNPOF-90b3vlcS44PwqDUGrtTpQiN6WdsTT6LbpN1N92KbPJIRj3PkGwQW7VvpfM8L4wKmyVmVnRO3ixaW-mXXiOWk9rmfHP9UFMYnk99yaGHp4dZ1JfJiClci~Z8dBx288CrvXVjGUCXBJbdlwo6UrKQJCEk9i9vSbCpI2Q__&Key-Pair-Id=K24YOPZ1EKX0YC
View:
https://d3vwatchtower.ngrok.io/ingest/view?findings_url=https%3A//files.nightfall.ai/d2160270-6b07-4304-b1ee-e7b98498be82.json%3FExpires%3D1638059340%26Signature%3DAjSdNGlXWGXO0QGSi-lOoDBtbhJdLPE7IWXA7IaBCfLr~3X2IcZ1vavHF5iaEDaoZ-3etnZA4Nu8K8Dq8Kd81ShuX6Ze1o87mzb~8lD6WBk8hXShgW-TPBPpLMoBx2sA9TnefTqy94gI4ykt4tt1MttB67Cj69Miw-46cpFkgY9tannNPOF-90b3vlcS44PwqDUGrtTpQiN6WdsTT6LbpN1N92KbPJIRj3PkGwQW7VvpfM8L4wKmyVmVnRO3ixaW-mXXiOWk9rmfHP9UFMYnk99yaGHp4dZ1JfJiClci~Z8dBx288CrvXVjGUCXBJbdlwo6UrKQJCEk9i9vSbCpI2Q__%26Key-Pair-Id%3DK24YOPZ1EKX0YC# respond to GET requests at /view
# Users can access this page to view their file scan results in a table
@app.route("/view")
def view():
# get the findings URL from the query parameters
findings_url = request.args.get('findings_url')
if findings_url:
# download the findings from the findings URL and parse them as JSON
with urllib.request.urlopen(findings_url) as url:
data = json.loads(url.read().decode())
# render the view.html template and provide the findings object to display in the template
return render_template('view.html', findings=data['findings'])<!DOCTYPE HTML>
<html>
<head>
<title>File Scan Viewer</title>
<style>
table, th, td {
border: 1px solid black;
}
table {
width: 100%;
}
</style>
</head>
<body>
<table>
<thead>
<tr>
<th>Detector</th>
<th>beforeContext</th>
<th>Finding</th>
<th>afterContext</th>
<th>byteRangeStart</th>
<th>byteRangeEnd</th>
<th>Confidence</th>
</tr>
</thead>
<tbody>
{% for finding in findings %}
<tr>
<td>{{ finding['detector']['name'] }}</td>
<td>{{ finding['beforeContext'] }}</td>
<td>{{ finding['finding'] }}</td>
<td>{{ finding['afterContext'] }}</td>
<td>{{ finding['location']['byteRange']['start'] }}</td>
<td>{{ finding['location']['byteRange']['start'] }}</td>
<td>{{ finding['confidence'] }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</body>
</html>NIGHTFALL_API_KEY
NIGHTFALL_SIGNING_SECRETexport NIGHTFALL_SERVER_URL=https://your-app-url.onrender.com
python3 scan.pyNov 26 04:29:06 PM Sensitive data present. Findings available until 2021-11-28T00:28:24.564972786Z.
Nov 26 04:29:06 PM
Nov 26 04:29:06 PM Download:
Nov 26 04:29:06 PM https://files.nightfall.ai/d6b6ee4f-d1a8-4fb6-b35a-cb6f88d58083.json?Expires=1638059304&Signature=hz1TN5UXjCGTxCxq~jT2wfuUWlj9Se-mWNL1K-tJhiAIXUg1FxJrCVP2iH1I4TNymFBuOnj5TTiLGpD8tZAKGm9J0lTHncZkaeaU8KZQ2j-~8qYQVlunNj019sqtTkMbVRfakzYzW-qWHEvLXN-PFcGYX05g3LZHvW802-lAVlM-WpGApw2u8BnzoY1pdWAxpJ0VIN1Zax4UuVeQBKieR7k8H9v9HdYYJlVGkVA5F9EzklLy99fyD8r4WR~jfqN5Fr1KceDtsxffC6MPuZ8nIIdSG5~tVtjCjgIjyh3IePPW1Wq-E8yZiVAhpDDbYX1wngUTwlAu~MU7N39vd8mlYQ__&Key-Pair-Id=K24YOPZ1EKX0YC
Nov 26 04:29:06 PM
Nov 26 04:29:06 PM View:
Nov 26 04:29:06 PM https://flask-file-scanner-example.onrender.com/view?findings_url=https%3A//files.nightfall.ai/d6b6ee4f-d1a8-4fb6-b35a-cb6f88d58083.json%3FExpires%3D1638059304%26Signature%3Dhz1TN5UXjCGTxCxq~jT2wfuUWlj9Se-mWNL1K-tJhiAIXUg1FxJrCVP2iH1I4TNymFBuOnj5TTiLGpD8tZAKGm9J0lTHncZkaeaU8KZQ2j-~8qYQVlunNj019sqtTkMbVRfakzYzW-qWHEvLXN-PFcGYX05g3LZHvW802-lAVlM-WpGApw2u8BnzoY1pdWAxpJ0VIN1Zax4UuVeQBKieR7k8H9v9HdYYJlVGkVA5F9EzklLy99fyD8r4WR~jfqN5Fr1KceDtsxffC6MPuZ8nIIdSG5~tVtjCjgIjyh3IePPW1Wq-E8yZiVAhpDDbYX1wngUTwlAu~MU7N39vd8mlYQ__%26Key-Pair-Id%3DK24YOPZ1EKX0YCnightfall
Flask
Gunicorn
watchdogexport NIGHTFALL_API_KEY=<your_key_here>
export NIGHTFALL_SIGNING_SECRET=<your_secret_here>import os
import time
from watchdog.observers import Observer
from watchdog.events import RegexMatchingEventHandler
from nightfall import Confidence, DetectionRule, Detector, RedactionConfig, MaskConfig, Nightfall
class MyHandler(RegexMatchingEventHandler):
# event handler callback that is called when a file is modified (created or changed)
def on_modified(self, event):
print(f'Event type: {event.event_type} | Path: {event.src_path}')
if __name__ == "__main__":
regexes = [ ".*" ]
# register event handler to monitor file paths that match our regex
event_handler = MyHandler(regexes)
observer = Observer()
observer.schedule(event_handler, path='', recursive=True)
observer.start()
try:
while True:
time.sleep(1)
except KeyboardInterrupt:
observer.stop()
observer.join()Event type: modified | Path: /Users/myuser/Library/Caches
Event type: modified | Path: /Users/myuser/Library/Caches/com.apple.nsservicescache.plist
Event type: modified | Path: /Users/myuser/Library/Caches
Event type: modified | Path: /Users/myuser/Library/Caches/Google/Chrome/Default/Cache
Event type: modified | Path: /private/tmp
Event type: modified | Path: /Users/myuser/Library/Preferences/ContextStoreAgent.plist
Event type: modified | Path: /private/tmp
Event type: modified | Path: /Users/myuser/Library/Assistant
Event type: modified | Path: /Users/myuser/Library/Assistant/SyncSnapshot.plist
...import os
import time
from watchdog.observers import Observer
from watchdog.events import RegexMatchingEventHandler
from nightfall import Confidence, DetectionRule, Detector, RedactionConfig, MaskConfig, Nightfall
class MyHandler(RegexMatchingEventHandler):
def scan_file(self, filepath):
nightfall = Nightfall() # reads API key from NIGHTFALL_API_KEY environment variable by default
webhook_url = f"{os.getenv('NIGHTFALL_SERVER_URL')}/ingest" # webhook server we'll create
try:
scan_id, message = nightfall.scan_file(
filepath,
webhook_url=webhook_url,
# detection rule to detect credit card numbers, SSNs, and API keys
detection_rules=[ DetectionRule([
Detector(
min_confidence=Confidence.LIKELY,
nightfall_detector="CREDIT_CARD_NUMBER",
display_name="Credit Card Number"),
Detector(
min_confidence=Confidence.LIKELY,
nightfall_detector="US_SOCIAL_SECURITY_NUMBER",
display_name="US Social Security Number"),
Detector(
min_confidence=Confidence.LIKELY,
nightfall_detector="API_KEY",
display_name="API Key")
])
])
return scan_id, message
except Exception as err:
print(f"Error processing {filepath} | {err}")
return None, None
def on_modified(self, event):
# scan file with Nightfall
scan_id, message = self.scan_file(event.src_path)
if scan_id:
print(f"Scan initiated | Path {event.src_path} | UploadID {scan_id}")
print(f'Event type: {event.event_type} | Path: {event.src_path}')
if __name__ == "__main__":
regexes = [ ".*/Downloads/.*", ".*/Desktop/.*", ".*/Documents/.*" ]
# register event handler to monitor file paths that match our regexes
event_handler = MyHandler(regexes)
observer = Observer()
observer.schedule(event_handler, path='', recursive=True)
observer.start()
try:
while True:
time.sleep(1)
except KeyboardInterrupt:
observer.stop()
observer.join()regexes = [ ".*/Downloads/.*", ".*/Desktop/.*", ".*/Documents/.*" ]regexes = [ "(?!/opt/|.*/Library/|.*/private/|/System/|/Applications/|/usr/).*" ]import os
from flask import Flask, request, render_template
from nightfall import Confidence, DetectionRule, Detector, RedactionConfig, MaskConfig, Nightfall
from datetime import datetime, timedelta
import urllib.request, urllib.parse, json
import csv
app = Flask(__name__)
nightfall = Nightfall(
key=os.getenv('NIGHTFALL_API_KEY'),
signing_secret=os.getenv('NIGHTFALL_SIGNING_SECRET')
)@app.route("/ping")
def ping():
return "Hello World", 200[2021-11-26 14:22:53 -0800] [61196] [INFO] Starting gunicorn 20.1.0
[2021-11-26 14:22:53 -0800] [61196] [INFO] Listening at: http://127.0.0.1:8000 (61196)
[2021-11-26 14:22:53 -0800] [61196] [INFO] Using worker: sync
[2021-11-26 14:22:53 -0800] [61246] [INFO] Booting worker with pid: 61246./ngrok http 8000Account Nightfall Example
Version 2.3.40
Region United States (us)
Web Interface http://127.0.0.1:4040
Forwarding http://3ecedafba368.ngrok.io -> http://localhost:8000
Forwarding https://3ecedafba368.ngrok.io -> http://localhost:8000export NIGHTFALL_SERVER_URL=https://3ecedafba368.ngrok.io# create CSV where sensitive findings will be written
headers = ["upload_id", "#", "datetime", "before_context", "finding", "after_context", "detector", "confidence", "loc", "detection_rules"]
with open(f"results.csv", 'a') as csvfile:
writer = csv.writer(csvfile)
writer.writerow(headers)
# respond to POST requests at /ingest
# Nightfall will send requests to this webhook endpoint with file scan results
@app.route("/ingest", methods=['POST'])
def ingest():
data = request.get_json(silent=True)
# validate webhook URL with challenge response
challenge = data.get("challenge")
if challenge:
return challenge
# challenge was passed, now validate the webhook payload
else:
# get details of the inbound webhook request for validation
request_signature = request.headers.get('X-Nightfall-Signature')
request_timestamp = request.headers.get('X-Nightfall-Timestamp')
request_data = request.get_data(as_text=True)
if nightfall.validate_webhook(request_signature, request_timestamp, request_data):
# check if any sensitive findings were found in the file, return if not
if not data["findingsPresent"]:
print("No sensitive data present!")
return "", 200
# there are sensitive findings in the file
output_results(data)
return "", 200
else:
return "Invalid webhook", 500def output_results(data):
findings_url = data['findingsURL']
# open findings URL provided by Nightfall to access findings
with urllib.request.urlopen(findings_url) as url:
findings = json.loads(url.read().decode())
findings = findings['findings']
print(f"Sensitive data found, outputting {len(findings)} finding(s) to CSV | UploadID {data['uploadID']}")
table = []
# loop through findings JSON, get relevant finding metadata, write each finding as a row into output CSV
for i, finding in enumerate(findings):
row = [
data['uploadID'],
i+1,
datetime.now(),
repr(finding['beforeContext']),
repr(finding['finding']),
repr(finding['afterContext']),
finding['detector']['name'],
finding['confidence'],
finding['location']['byteRange'],
finding['matchedDetectionRules']
]
table.append(row)
with open(f"results.csv", 'a') as csvfile:
writer = csv.writer(csvfile)
writer.writerow(row)
returnexport NIGHTFALL_SERVER_URL=https://3ecedafba368.ngrok.io
python scanner.pycurl https://raw.githubusercontent.com/nightfallai/dlp-sample-data/main/sample-pci.csv > ~/Downloads/sample-pci.csvEvent type: modified | Path: /Users/myuser/Downloads/sample-pci.csv
Scan initiated | Path /Users/myuser/Downloads/sample-pci.csv | UploadID c23fdde2-5e98-4183-90b0-31e2cdd20ac0Sensitive data found, outputting 10 finding(s) to CSV | UploadID ac6a4a9d-a7b9-4a78-810d-8a66f7644704upload_id,#,datetime,before_context,finding,after_context,detector,confidence,loc,detection_rules
ac6a4a9d-a7b9-4a78-810d-8a66f7644704,1,2021-12-04 22:12:21.039602,'Name\tCredit Card\nRep. Viviana Hintz\t','5433-9502-3725-7862','\nEloisa Champlin\t3457-389808-83234\nOmega',Credit Card Number,VERY_LIKELY,"{'start': 36, 'end': 55}",[]
...nohup python -u scanner.py > scanner.log &
nohup gunicorn app:app > server.log &teams.chat_participantsalesforce.file.session_level{
"mcpServers": {
"nightfall": {
"command": "npx",
"args": [
"-y",
"mcp-remote@latest",
"https://api.nightfall.ai/mcp",
"--header",
"Authorization: Bearer YOUR_NIGHTFALL_API_KEY"
]
}
}
}{
"mcpServers": {
"nightfall": {
"url": "https://api.nightfall.ai/mcp",
"headers": {
"Authorization": "Bearer YOUR_NIGHTFALL_API_KEY"
}
}
}
}{
"mcpServers": {
"nightfall": {
"serverUrl": "https://api.nightfall.ai/mcp",
"headers": {
"Authorization": "Bearer YOUR_NIGHTFALL_API_KEY"
}
}
}
}POST https://api.nightfall.ai/mcp
Authorization: Bearer YOUR_NIGHTFALL_API_KEY
Content-Type: application/jsonintegration_name:github AND risk_label:HIGH AND state:ACTIVEuser_email:[email protected] AND integration_name:slackuser_email:[email protected] OR user_email:[email protected]slack.channel_name:general AND state:PENDINGcreatedAfter=<unix_timestamp> AND risk_label:HIGHUnix timestamp in seconds, filters records created ≥ the value, defaults to -90 days UTC
Unix timestamp in seconds, filters records created < the value, defaults to end of the current day UTC
Unix timestamp in seconds, filters records updated > the value
The maximum number of records to be returned in the response
50Cursor for getting the next page of results
Successful response
How many remaining requests you can make within the next second before being throttled
How many remaining requests you can make within the next quota period
When the current quota period expires
The violation id
The integration name
Unix timestamp when the violation was created
Unix timestamp when the violation was updated
The current state of the violation
The link to the resource on the integration
The channel name in case of a message in a channel
Type of location
User name
ID - user
Link to message
Members for the location
Count of members for the location
ID - channel
Name of workspace
Name of item
Type of item
Archived status
Unix timestamp
Unix timestamp
List of labels
Name of space
Key of space
Link of space
Parent page
Name of author
Email of author
Link of author name
Link to resource
ID - Confluence internal
ID - Confluence user
Version of item
ID - parent page
Version of parent page
ID of file
The name of the file
Type of file
File size
Link to file
Permissions
User list shared with - external
User list shared with - internal
Available for viewers to download
File owner
In trash
Unix timestamp, when the file was created
Unix timestamp, when the file was updated
Drive name
Updated by user
Name of project
Ticket number
Type of project
ID for the issue
Link to project
Link to ticket
Link to comment
Link to attachment
Branch on which violation occurred
Name of the organization or username in case of an individual account
Name of the repository
Email of the user who pushed the changes to GitHub
Username of the user who pushed the changes to GitHub
Unix timestamp
Boolean to check if the repo is private or public
Path of the file on which violation occurred
Permalink to the version of the file where sensitive content was identified
Owner of the repository
Link to the repository
Name of the Salesforce organization
ID of the record
Name of the object
Attachment or Object
ID of the user
Salesforce username of the author
Unix timestamp when the object was last updated
Fields of the Object
File Type
Link to the attachment
Name of the attachment
Link to the object
Status of the ticket
Title of the ticket
Ticket requested by
Group the ticket is assigned to
Agent the ticket is assigned to
User role
ID of the ticket
Followers of the ticket
Tags for the ticket
Unix timestamp
Unix timestamp
Location
Sub-location
ID - ticket comment
ID - ticket group
Link to the ticket group
ID - ticket agent
Link - ticket agent
Ticket event
Role of the user
Name of the attachment
Link for the attachment
Page creator
Page update by
Workspace name
Link to workspace
ID of the page
Title of the page
Unix timestamp
Unix timestamp
Private page link
Public page link
Externally shared state
ID of the attachment
Page URL where the extension is launched
Specific location on the page
Browser type
Remediation comment from the user
Name of the team containing the channel where the message was sent
ID of the tenant
Domain name of the tenant
ID of the team containing the channel where the message was sent
Visibility of the team containing the channel where the message was sent
Web URL of the team containing the channel where the message was sent
ID of the channel where the message was sent
Name of the channel where the message was sent
Type of the channel where the message was sent
Web URL of the channel where the message was sent
ID of the message
Unix timestamp
Unix timestamp
Sender of the chat message
ID of the user who sent the message
Principal name of the user who sent the message
ID of the attachment present in the message
Name of the attachment present in the message
URL of the attachment present in the message
Importance of the sent message
ID of the chat conversation
Type of the chat conversation (one-on-one, group, meeting)
Topic or subject of the chat conversation
ID of the user participating in the chat conversation
email address of the chat participant
display name of the chat participant
ID of the tenant
Domain name of the tenant
ID of the drive item
Name of the drive item
URL of the drive item
Mime type of the drive item
Size of the drive item in bytes
Path to the drive item relative to the root of the drive
ID of the user who created the drive item
Email of the user who last updated the drive item
ID of the user who last updated the drive item
Name of the user who last updated the drive item
Unix timestamp when the drive item was created
Unix timestamp when the drive item was last updated
Name of the special folder if drive item is inside one
ID of the drive where the drive item is present
Name of user who owns the drive where the drive item is present
Email of user who owns the drive where the drive item is present
ID of user who owns the drive where the drive item is present
Domain of the company where email was sent from
User Name who sent the email
Email of the sender
Recipients of the Email
Recipients mentioned in the CC field of the Email
Recipients mentioned in the BCC field of the Email
Subject of the email
Unix timestamp of when email was sent
ThreadID of the email
Name of the attachment
Type of attachment
The name of the file
The file mime type
The link to the resource on the integration
Policies violated
Detection rules triggered
Detectors triggered
The risk label associated to this violation
The source of calculation of risk associated to this violation
The calculated score of the risk for this violation
Username as on the integration
User email as on the integration, may be empty
Next page cursor, omitted if end of results reached
Invalid request parameters
Authentication failure
Rate Limit Exceeded or Daily Quota Exceeded
Internal Nightfall Error
The UUID of the violation to fetch
Successful response
How many remaining requests you can make within the next second before being throttled
How many remaining requests you can make within the next quota period
When the current quota period expires
The violation id
The integration name
Unix timestamp when the violation was created
Unix timestamp when the violation was updated
The current state of the violation
The link to the resource on the integration
The channel name in case of a message in a channel
Type of location
User name
ID - user
Link to message
Members for the location
Count of members for the location
ID - channel
Name of workspace
Name of item
Type of item
Archived status
Unix timestamp
Unix timestamp
List of labels
Name of space
Key of space
Link of space
Parent page
Name of author
Email of author
Link of author name
Link to resource
ID - Confluence internal
ID - Confluence user
Version of item
ID - parent page
Version of parent page
ID of file
The name of the file
Type of file
File size
Link to file
Permissions
User list shared with - external
User list shared with - internal
Available for viewers to download
File owner
In trash
Unix timestamp, when the file was created
Unix timestamp, when the file was updated
Drive name
Updated by user
Name of project
Ticket number
Type of project
ID for the issue
Link to project
Link to ticket
Link to comment
Link to attachment
Branch on which violation occurred
Name of the organization or username in case of an individual account
Name of the repository
Email of the user who pushed the changes to GitHub
Username of the user who pushed the changes to GitHub
Unix timestamp
Boolean to check if the repo is private or public
Path of the file on which violation occurred
Permalink to the version of the file where sensitive content was identified
Owner of the repository
Link to the repository
Name of the Salesforce organization
ID of the record
Name of the object
Attachment or Object
ID of the user
Salesforce username of the author
Unix timestamp when the object was last updated
Fields of the Object
File Type
Link to the attachment
Name of the attachment
Link to the object
Status of the ticket
Title of the ticket
Ticket requested by
Group the ticket is assigned to
Agent the ticket is assigned to
User role
ID of the ticket
Followers of the ticket
Tags for the ticket
Unix timestamp
Unix timestamp
Location
Sub-location
ID - ticket comment
ID - ticket group
Link to the ticket group
ID - ticket agent
Link - ticket agent
Ticket event
Role of the user
Name of the attachment
Link for the attachment
Page creator
Page update by
Workspace name
Link to workspace
ID of the page
Title of the page
Unix timestamp
Unix timestamp
Private page link
Public page link
Externally shared state
ID of the attachment
Page URL where the extension is launched
Specific location on the page
Browser type
Remediation comment from the user
Name of the team containing the channel where the message was sent
ID of the tenant
Domain name of the tenant
ID of the team containing the channel where the message was sent
Visibility of the team containing the channel where the message was sent
Web URL of the team containing the channel where the message was sent
ID of the channel where the message was sent
Name of the channel where the message was sent
Type of the channel where the message was sent
Web URL of the channel where the message was sent
ID of the message
Unix timestamp
Unix timestamp
Sender of the chat message
ID of the user who sent the message
Principal name of the user who sent the message
ID of the attachment present in the message
Name of the attachment present in the message
URL of the attachment present in the message
Importance of the sent message
ID of the chat conversation
Type of the chat conversation (one-on-one, group, meeting)
Topic or subject of the chat conversation
ID of the user participating in the chat conversation
email address of the chat participant
display name of the chat participant
ID of the tenant
Domain name of the tenant
ID of the drive item
Name of the drive item
URL of the drive item
Mime type of the drive item
Size of the drive item in bytes
Path to the drive item relative to the root of the drive
ID of the user who created the drive item
Email of the user who last updated the drive item
ID of the user who last updated the drive item
Name of the user who last updated the drive item
Unix timestamp when the drive item was created
Unix timestamp when the drive item was last updated
Name of the special folder if drive item is inside one
ID of the drive where the drive item is present
Name of user who owns the drive where the drive item is present
Email of user who owns the drive where the drive item is present
ID of user who owns the drive where the drive item is present
Domain of the company where email was sent from
User Name who sent the email
Email of the sender
Recipients of the Email
Recipients mentioned in the CC field of the Email
Recipients mentioned in the BCC field of the Email
Subject of the email
Unix timestamp of when email was sent
ThreadID of the email
Name of the attachment
Type of attachment
The name of the file
The file mime type
The link to the resource on the integration
Policies violated
Detection rules triggered
Detectors triggered
The risk label associated to this violation
The source of calculation of risk associated to this violation
The calculated score of the risk for this violation
Username as on the integration
User email as on the integration, may be empty
Invalid request parameters
Authentication failure
Violation does not exist
Rate Limit Exceeded or Daily Quota Exceeded
Internal Nightfall Error
Unix timestamp in seconds, filters records created ≥ the value, defaults to -90 days UTC
Unix timestamp in seconds, filters records created < the value, defaults to end of the current day UTC
Unix timestamp in seconds, filters records updated > the value
The maximum number of records to be returned in the response
50Cursor for getting the next page of results
Sort key and direction, defaults to descending order by creation time
TIME_DESCPossible values: The query containing filter clauses
Query structure and terminology
A query clause consists of a field followed by an operator followed by a value:
| term | value |
|---|---|
| clause | user_email:"[email protected]" |
| field | user_email |
| operator | : |
| value | [email protected] |
You can combine multiple query clauses in a search by separating them with a space.
Field types, substring matching, and numeric comparators
Every search field supports exact matching with a :. Certain fields such as user_email and user_name support substring matching.
Quotes
You may use quotation marks around string values. Quotation marks are required in case the value contains spaces. For example:
user_mail:[email protected]user_name:"John Doe"Special Characters
+ - && || ! ( ) { } [ ] ^ " ~ * ? : are special characters need to be escaped using \. For example:
(1+1):2 should be searched for using \(1\+1)\:2Search Syntax
The following table lists the syntax that you can use to construct a query.
| SYNTAX | USAGE | DESCRIPTION | EXAMPLES |
|---|---|---|---|
: |
field:value | Exact match operator (case insensitive) | state:"pending" returns records where the currency is exactly "PENDING" in a case-insensitive comparison |
(space) |
field1:value1 field2:value2 | The query returns only records that match both clauses | state:active slack.channel_name:general |
OR |
field:(value1 OR value2) | The query returns records that match either of the values (case insensitive) | state:(active OR pending) |
Query Fields
| param | description |
|---|---|
| state | the violation states to filter on |
| user_email | the emails of users updating the resource resulting in the violation |
| user_name | the usernames of users updating the resource resulting in the violation |
| integration_name | the integration to filter on |
| confidence | one or more likelihoods/confidences |
| policy_id | one or more policy IDs |
| detection_rule_id | one or more detection rule IDs |
| detector_id | one or more detector IDs |
| risk_label | the risk label to filter on |
| risk_source | the risk determination source to filter on |
| slack.channel_name | the slack channel names to filter on |
| slack.channel_id | the slack channel IDs to filter on |
| slack.workspace | the slack workspaces to filter on |
| confluence.parent_page_name | the names of the parent pages in confluence to filter on |
| confluence.space_name | the names of the spaces in confluence to filter on |
| gdrive.drive | the drive names in gdrive to filter on |
| jira.project_name | the jira project names to filter on |
| jira.ticket_number | the jira ticket numbers to filter on |
| salesforce.org_name | the salesforce organization names to filter on |
| salesforce.object | the salesforce object names to filter on |
| salesforce.record_id | the salesforce record IDs to filter on |
| github.author_email | the github author emails to filter on |
| github.branch | the github branches to filter on |
| github.commit | the github commit ids to filter on |
| github.org | the github organizations to filter on |
| github.repository | the github repositories to filter on |
| github.repository_owner | the github repository owners to filter on |
| teams.team_name | the m365 teams team names to filter on |
| teams.channel_name | the m365 teams channels to filter on |
| teams.channel_type | the m365 teams channel types to filter on |
| teams.team_sensitivity | the m365 teams sensitivities to filter on |
| teams.sender | the m365 teams senders to filter on |
| teams.msg_importance | the m365 teams importance to filter on |
| teams.msg_attachment | the m365 teams attachment names to filter on |
| teams.chat_id | the m365 teams chat ID to filter on |
| teams.chat_type | the m365 teams chat type to filter on |
| teams.chat_topic | the m365 teams chat topic to filter on |
| teams.chat_participant | the m365 teams chat participant's display name to filter on |
| onedrive.drive_owner | drive owner's display name to filter on |
| onedrive.drive_owner_email | drive owner's email to filter on |
| onedrive.file_name | the file name to filter on |
| onedrive.created_by | the m365 user, who created the file in the drive, display name to filter on |
| onedrive.created_by_email | the m365 users, who created the file in the drive, email to filter on |
| onedrive.modified_by | the m365 users, who last modified the file in the drive, display name to filter on |
| onedrive.modified_by_email | the m365 users, who last modified the file in the drive, email to filter on |
| zendesk.ticket_status | the zendesk ticket status to filter on |
| zendesk.ticket_title | the zendesk ticket titles to filter on |
| zendesk.ticket_group_assignee | the zendesk ticket assignee groups to filter on |
| zendesk.current_user_role | the zendesk ticket current assignee user's roles to filter on |
| notion.created_by | the names of the users creating a resource in notion to filter on |
| notion.last_edited_by | the names of the users editing a resource in notion to filter on |
| notion.page_title | the page names in notion to filter on |
| notion.workspace_name | the workspace names in notion to filter on |
| gmail.user_name | the names of the sender to filter on |
| gmail.from | the email of sender to filter on |
| gmail.to | the email or name of recipients to filter on |
| gmail.cc | the email or name of cc to filter on |
| gmail.bcc | the email or name of bcc to filter on |
| gmail.thread_id | the thread id of email to filter on |
| gmail.subject | the subject of email to filter on |
| gmail.attachment_name | the name of attachment to filter on |
| gmail.attachment_type | the type of attachment to filter on |
| last_actioned_by | the entity that performed the last action on the violation, can be one of NIGHTFALL, ADMIN or END_USER |
Successful response
How many remaining requests you can make within the next second before being throttled
How many remaining requests you can make within the next quota period
When the current quota period expires
The violation id
The integration name
Unix timestamp when the violation was created
Unix timestamp when the violation was updated
The current state of the violation
The link to the resource on the integration
The channel name in case of a message in a channel
Type of location
User name
ID - user
Link to message
Members for the location
Count of members for the location
ID - channel
Name of workspace
Name of item
Type of item
Archived status
Unix timestamp
Unix timestamp
List of labels
Name of space
Key of space
Link of space
Parent page
Name of author
Email of author
Link of author name
Link to resource
ID - Confluence internal
ID - Confluence user
Version of item
ID - parent page
Version of parent page
ID of file
The name of the file
Type of file
File size
Link to file
Permissions
User list shared with - external
User list shared with - internal
Available for viewers to download
File owner
In trash
Unix timestamp, when the file was created
Unix timestamp, when the file was updated
Drive name
Updated by user
Name of project
Ticket number
Type of project
ID for the issue
Link to project
Link to ticket
Link to comment
Link to attachment
Branch on which violation occurred
Name of the organization or username in case of an individual account
Name of the repository
Email of the user who pushed the changes to GitHub
Username of the user who pushed the changes to GitHub
Unix timestamp
Boolean to check if the repo is private or public
Path of the file on which violation occurred
Permalink to the version of the file where sensitive content was identified
Owner of the repository
Link to the repository
Name of the Salesforce organization
ID of the record
Name of the object
Attachment or Object
ID of the user
Salesforce username of the author
Unix timestamp when the object was last updated
Fields of the Object
File Type
Link to the attachment
Name of the attachment
Link to the object
Status of the ticket
Title of the ticket
Ticket requested by
Group the ticket is assigned to
Agent the ticket is assigned to
User role
ID of the ticket
Followers of the ticket
Tags for the ticket
Unix timestamp
Unix timestamp
Location
Sub-location
ID - ticket comment
ID - ticket group
Link to the ticket group
ID - ticket agent
Link - ticket agent
Ticket event
Role of the user
Name of the attachment
Link for the attachment
Page creator
Page update by
Workspace name
Link to workspace
ID of the page
Title of the page
Unix timestamp
Unix timestamp
Private page link
Public page link
Externally shared state
ID of the attachment
Page URL where the extension is launched
Specific location on the page
Browser type
Remediation comment from the user
Name of the team containing the channel where the message was sent
ID of the tenant
Domain name of the tenant
ID of the team containing the channel where the message was sent
Visibility of the team containing the channel where the message was sent
Web URL of the team containing the channel where the message was sent
ID of the channel where the message was sent
Name of the channel where the message was sent
Type of the channel where the message was sent
Web URL of the channel where the message was sent
ID of the message
Unix timestamp
Unix timestamp
Sender of the chat message
ID of the user who sent the message
Principal name of the user who sent the message
ID of the attachment present in the message
Name of the attachment present in the message
URL of the attachment present in the message
Importance of the sent message
ID of the chat conversation
Type of the chat conversation (one-on-one, group, meeting)
Topic or subject of the chat conversation
ID of the user participating in the chat conversation
email address of the chat participant
display name of the chat participant
ID of the tenant
Domain name of the tenant
ID of the drive item
Name of the drive item
URL of the drive item
Mime type of the drive item
Size of the drive item in bytes
Path to the drive item relative to the root of the drive
ID of the user who created the drive item
Email of the user who last updated the drive item
ID of the user who last updated the drive item
Name of the user who last updated the drive item
Unix timestamp when the drive item was created
Unix timestamp when the drive item was last updated
Name of the special folder if drive item is inside one
ID of the drive where the drive item is present
Name of user who owns the drive where the drive item is present
Email of user who owns the drive where the drive item is present
ID of user who owns the drive where the drive item is present
Domain of the company where email was sent from
User Name who sent the email
Email of the sender
Recipients of the Email
Recipients mentioned in the CC field of the Email
Recipients mentioned in the BCC field of the Email
Subject of the email
Unix timestamp of when email was sent
ThreadID of the email
Name of the attachment
Type of attachment
The name of the file
The file mime type
The link to the resource on the integration
Policies violated
Detection rules triggered
Detectors triggered
The risk label associated to this violation
The source of calculation of risk associated to this violation
The calculated score of the risk for this violation
Username as on the integration
User email as on the integration, may be empty
Next page cursor, omitted if end of results reached
Invalid request parameters
Authentication failure
Rate Limit Exceeded or Daily Quota Exceeded
Internal Nightfall Error
The UUID of the violation
Cursor for getting the next page of results
Number of findings to fetch in one page (max 1000)
1000Successful response
How many remaining requests you can make within the next second before being throttled
How many remaining requests you can make within the next quota period
When the current quota period expires
The id of the findings
The id of the detector that was triggered
The sub detector id in case the detector uses a combination of detectors
The likelihood of the detection
The redacted sensitive data
Data preceding the sensitive data
Data after the sensitive data
Start point for a range
End point for a range
Start point for a range
End point for a range
Key status
Key type
Additional details about the key
Metadata/sub-location of the finding in the resource. For example - title or description for a Jira ticket.
The annotation id, if present
Next page cursor, omitted if end of results reached
Invalid request parameters
Authentication failure
Violation does not exist
Rate Limit Exceeded or Daily Quota Exceeded
Internal Nightfall Error
The UUIDs of the violations to perform the action on
The action to perform on the violations
Successful response (processed immediately)
How many remaining requests you can make within the next second before being throttled
How many remaining requests you can make within the next quota period
When the current quota period expires
violation UUIDs that were processed
Accepted response (queued for processing)
Invalid request parameters
Authentication failure
Rate Limit Exceeded or Daily Quota Exceeded
Internal Nightfall Error
The UUID of the annotation to fetch
Successful response
How many remaining requests you can make within the next second before being throttled
How many remaining requests you can make within the next quota period
When the current quota period expires
The annotation id
The annotation type
The annotation comment
Whether the annotation applies to all findings of this sensitive data
Invalid request parameters
Authentication failure
Annotation does not exist
Rate Limit Exceeded or Daily Quota Exceeded
Internal Nightfall Error
The UUID of the finding to annotate
The annotation type
The comment to add to the annotation
Whether the annotation applies to all findings of this sensitive data (defaults to true)
trueSuccessful response
How many remaining requests you can make within the next second before being throttled
How many remaining requests you can make within the next quota period
When the current quota period expires
The annotation id
The annotation type
The annotation comment
Whether the annotation applies to all findings of this sensitive data
Invalid request parameters
Authentication failure
Finding already annotated
Rate Limit Exceeded or Daily Quota Exceeded
Internal Nightfall Error
The UUID of the finding to unannotate
Successful response (even if annotation does not exist)
How many remaining requests you can make within the next second before being throttled
How many remaining requests you can make within the next quota period
When the current quota period expires
Invalid request parameters
Authentication failure
Rate Limit Exceeded or Daily Quota Exceeded
Internal Nightfall Error
No content
The UUID of the violation
Number of activity items to fetch in one page
50Unix timestamp in seconds, filters activity created > the value
Unix timestamp in seconds, filters activity created < the value
Whether to sort results in descending order (default false)
falseCursor for getting the next page of results
Successful response
How many remaining requests you can make within the next second before being throttled
How many remaining requests you can make within the next quota period
When the current quota period expires
Unique identifier for the activity log entry
Human-readable message describing the activity
Unix timestamp in seconds when the activity occurred
Next page cursor, omitted if end of results reached
Invalid request parameters
Authentication failure
Violation does not exist
Rate Limit Exceeded or Daily Quota Exceeded
Internal Nightfall Error
{
"violations": [
{
"id": "text",
"integration": "SLACK",
"createdAt": 1,
"updatedAt": 1,
"possibleActions": [
"ACKNOWLEDGE"
],
"state": "ACTIVE",
"resourceLink": "text",
"metadata": {
"slackMetadata": {
"location": "text",
"locationType": "text",
"username": "text",
"userID": "text",
"messagePermalink": "text",
"locationMembers": [
"text"
],
"locationMemberCount": 1,
"channelID": "text",
"workspaceName": "text"
},
"confluenceMetadata": {
"itemName": "text",
"itemType": "text",
"isArchived": true,
"createdAt": 1,
"updatedAt": 1,
"labels": [
"text"
],
"spaceName": "text",
"spaceKey": "text",
"spaceNameLink": "text",
"parentPageName": "text",
"authorName": "text",
"authorEmail": "text",
"authorNameLink": "text",
"permalink": "text",
"confluenceID": "text",
"confluenceUserID": "text",
"itemVersion": 1,
"parentPageID": "text",
"parentVersion": 1
},
"gdriveMetadata": {
"fileID": "text",
"fileName": "text",
"fileType": "text",
"fileSize": "text",
"fileLink": "text",
"permissionSetting": "text",
"sharingExternalUsers": [
"text"
],
"sharingInternalUsers": [
"text"
],
"canViewersDownload": true,
"fileOwner": "text",
"isInTrash": true,
"createdAt": 1,
"updatedAt": 1,
"drive": "text",
"updatedBy": "text"
},
"jiraMetadata": {
"projectName": "text",
"ticketNumber": "text",
"projectType": "text",
"issueID": "text",
"projectLink": "text",
"ticketLink": "text",
"commentLink": "text",
"attachmentLink": "text"
},
"githubMetadata": {
"branchName": "text",
"organization": "text",
"repository": "text",
"authorEmail": "text",
"authorUsername": "text",
"createdAt": 1,
"isRepoPrivate": true,
"filePath": "text",
"githubPermalink": "text",
"repositoryOwner": "text",
"githubRepoLink": "text"
},
"salesforceMetadata": {
"orgName": "text",
"recordID": "text",
"objectName": "text",
"contentType": "text",
"userID": "text",
"userName": "text",
"updatedAt": 1,
"fields": [
"text"
],
"fileType": "text",
"attachmentLink": "text",
"attachmentName": "text",
"objectLink": "text"
},
"zendeskMetadata": {
"ticketStatus": "text",
"ticketTitle": "text",
"ticketRequestor": "text",
"ticketGroupAssignee": "text",
"ticketAgentAssignee": "text",
"currentUserRole": "text",
"ticketID": 1,
"ticketFollowers": [
"text"
],
"ticketTags": "text",
"createdAt": 1,
"UpdatedAt": 1,
"location": "text",
"subLocation": "text",
"ticketCommentID": 1,
"ticketGroupID": 1,
"ticketGroupLink": "text",
"ticketAgentID": 1,
"ticketAgentLink": "text",
"ticketEvent": "text",
"userRole": "text",
"attachmentName": "text",
"attachmentLink": "text"
},
"notionMetadata": {
"createdBy": "text",
"updatedBy": "text",
"workspaceName": "text",
"workspaceLink": "text",
"pageID": "text",
"pageTitle": "text",
"createdAt": 1,
"updatedAt": 1,
"privatePageLink": "text",
"publicPageLink": "text",
"sharedExternally": true,
"attachmentID": "text"
},
"browserMetadata": {
"location": "text",
"subLocation": "text",
"browserName": "text",
"userComment": "text"
},
"m365TeamsMetadata": {
"teamName": "text",
"tenantID": "text",
"tenantDomain": "text",
"teamID": "text",
"teamVisibility": "text",
"teamWebURL": "text",
"channelID": "text",
"channelName": "text",
"channelType": "text",
"channelWebURL": "text",
"messageID": "text",
"createdAt": 1,
"updatedAt": 1,
"chatMessageSender": "text",
"userID": "text",
"userPrincipalName": "text",
"attachments": [
{
"attachmentID": "text",
"attachmentName": "text",
"attachmentURL": "text"
}
],
"chatMessageImportance": "text",
"chatID": "text",
"chatType": "text",
"chatTopic": "text",
"chatParticipants": [
{
"userID": "text",
"email": "text",
"displayName": "text"
}
]
},
"m365OnedriveMetadata": {
"tenantID": "text",
"tenantDomain": "text",
"driveItemID": "text",
"driveItemName": "text",
"driveItemURL": "text",
"driveItemMimeType": "text",
"driveItemSize": 1,
"parentPath": "text",
"createdByID": "text",
"updatedByEmail": "text",
"updatedByID": "text",
"updatedByName": "text",
"createdAt": 1,
"updatedAt": 1,
"specialFolderName": "text",
"driveID": "text",
"driveOwnerName": "text",
"driveOwnerEmail": "text",
"driveOwnerID": "text"
},
"inlineEmailMetadata": {
"domain": "text",
"user_name": "text",
"from": "text",
"to": [
"text"
],
"cc": [
"text"
],
"bcc": [
"text"
],
"subject": "text",
"sent_at": 1,
"thread_id": "text",
"attachment_name": "text",
"attachment_type": "text"
}
},
"fileDetails": {
"fileName": "text",
"mimeType": "text",
"permalink": "text"
},
"policyUUIDs": [
"text"
],
"detectionRuleUUIDs": [
"text"
],
"detectorUUIDs": [
"text"
],
"risk": "UNSPECIFIED",
"riskSource": "NIGHTFALL",
"riskScore": 1,
"userInfo": {
"username": "text",
"userEmail": "text"
}
}
],
"nextPageToken": "text"
}{
"violations": [
{
"id": "text",
"integration": "SLACK",
"createdAt": 1,
"updatedAt": 1,
"possibleActions": [
"ACKNOWLEDGE"
],
"state": "ACTIVE",
"resourceLink": "text",
"metadata": {
"slackMetadata": {
"location": "text",
"locationType": "text",
"username": "text",
"userID": "text",
"messagePermalink": "text",
"locationMembers": [
"text"
],
"locationMemberCount": 1,
"channelID": "text",
"workspaceName": "text"
},
"confluenceMetadata": {
"itemName": "text",
"itemType": "text",
"isArchived": true,
"createdAt": 1,
"updatedAt": 1,
"labels": [
"text"
],
"spaceName": "text",
"spaceKey": "text",
"spaceNameLink": "text",
"parentPageName": "text",
"authorName": "text",
"authorEmail": "text",
"authorNameLink": "text",
"permalink": "text",
"confluenceID": "text",
"confluenceUserID": "text",
"itemVersion": 1,
"parentPageID": "text",
"parentVersion": 1
},
"gdriveMetadata": {
"fileID": "text",
"fileName": "text",
"fileType": "text",
"fileSize": "text",
"fileLink": "text",
"permissionSetting": "text",
"sharingExternalUsers": [
"text"
],
"sharingInternalUsers": [
"text"
],
"canViewersDownload": true,
"fileOwner": "text",
"isInTrash": true,
"createdAt": 1,
"updatedAt": 1,
"drive": "text",
"updatedBy": "text"
},
"jiraMetadata": {
"projectName": "text",
"ticketNumber": "text",
"projectType": "text",
"issueID": "text",
"projectLink": "text",
"ticketLink": "text",
"commentLink": "text",
"attachmentLink": "text"
},
"githubMetadata": {
"branchName": "text",
"organization": "text",
"repository": "text",
"authorEmail": "text",
"authorUsername": "text",
"createdAt": 1,
"isRepoPrivate": true,
"filePath": "text",
"githubPermalink": "text",
"repositoryOwner": "text",
"githubRepoLink": "text"
},
"salesforceMetadata": {
"orgName": "text",
"recordID": "text",
"objectName": "text",
"contentType": "text",
"userID": "text",
"userName": "text",
"updatedAt": 1,
"fields": [
"text"
],
"fileType": "text",
"attachmentLink": "text",
"attachmentName": "text",
"objectLink": "text"
},
"zendeskMetadata": {
"ticketStatus": "text",
"ticketTitle": "text",
"ticketRequestor": "text",
"ticketGroupAssignee": "text",
"ticketAgentAssignee": "text",
"currentUserRole": "text",
"ticketID": 1,
"ticketFollowers": [
"text"
],
"ticketTags": "text",
"createdAt": 1,
"UpdatedAt": 1,
"location": "text",
"subLocation": "text",
"ticketCommentID": 1,
"ticketGroupID": 1,
"ticketGroupLink": "text",
"ticketAgentID": 1,
"ticketAgentLink": "text",
"ticketEvent": "text",
"userRole": "text",
"attachmentName": "text",
"attachmentLink": "text"
},
"notionMetadata": {
"createdBy": "text",
"updatedBy": "text",
"workspaceName": "text",
"workspaceLink": "text",
"pageID": "text",
"pageTitle": "text",
"createdAt": 1,
"updatedAt": 1,
"privatePageLink": "text",
"publicPageLink": "text",
"sharedExternally": true,
"attachmentID": "text"
},
"browserMetadata": {
"location": "text",
"subLocation": "text",
"browserName": "text",
"userComment": "text"
},
"m365TeamsMetadata": {
"teamName": "text",
"tenantID": "text",
"tenantDomain": "text",
"teamID": "text",
"teamVisibility": "text",
"teamWebURL": "text",
"channelID": "text",
"channelName": "text",
"channelType": "text",
"channelWebURL": "text",
"messageID": "text",
"createdAt": 1,
"updatedAt": 1,
"chatMessageSender": "text",
"userID": "text",
"userPrincipalName": "text",
"attachments": [
{
"attachmentID": "text",
"attachmentName": "text",
"attachmentURL": "text"
}
],
"chatMessageImportance": "text",
"chatID": "text",
"chatType": "text",
"chatTopic": "text",
"chatParticipants": [
{
"userID": "text",
"email": "text",
"displayName": "text"
}
]
},
"m365OnedriveMetadata": {
"tenantID": "text",
"tenantDomain": "text",
"driveItemID": "text",
"driveItemName": "text",
"driveItemURL": "text",
"driveItemMimeType": "text",
"driveItemSize": 1,
"parentPath": "text",
"createdByID": "text",
"updatedByEmail": "text",
"updatedByID": "text",
"updatedByName": "text",
"createdAt": 1,
"updatedAt": 1,
"specialFolderName": "text",
"driveID": "text",
"driveOwnerName": "text",
"driveOwnerEmail": "text",
"driveOwnerID": "text"
},
"inlineEmailMetadata": {
"domain": "text",
"user_name": "text",
"from": "text",
"to": [
"text"
],
"cc": [
"text"
],
"bcc": [
"text"
],
"subject": "text",
"sent_at": 1,
"thread_id": "text",
"attachment_name": "text",
"attachment_type": "text"
}
},
"fileDetails": {
"fileName": "text",
"mimeType": "text",
"permalink": "text"
},
"policyUUIDs": [
"text"
],
"detectionRuleUUIDs": [
"text"
],
"detectorUUIDs": [
"text"
],
"risk": "UNSPECIFIED",
"riskSource": "NIGHTFALL",
"riskScore": 1,
"userInfo": {
"username": "text",
"userEmail": "text"
}
}
],
"nextPageToken": "text"
}{
"submitted": [
"123e4567-e89b-12d3-a456-426614174000"
]
}{
"id": "123e4567-e89b-12d3-a456-426614174000",
"type": "DETECTOR_FALSE_POSITIVE",
"comment": "text",
"autoApply": true
}{
"activities": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"message": "text",
"timestamp": 1,
"type": "CREATION",
"data": {
"action": "ACKNOWLEDGE",
"userUUID": "123e4567-e89b-12d3-a456-426614174000",
"userName": "text",
"userEmail": "text",
"receiverEmail": "text",
"actionLogData": {
"applyLabelsActionLogData": {
"activityType": "LABELS_SUCCESSFULLY_APPLIED",
"labels": [
"text"
],
"labelUpdatesOnResource": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"failureReason": "text"
},
"setExpirationActionLogData": {
"expirationTime": 1
},
"revokeAccessActionLogData": {
"revokedEmails": [
"text"
],
"unRevokedEmails": [
"text"
]
},
"notifyEmailActionLogData": {
"receiverEmail": "text"
},
"genericActionLogData": {
"additionalContext": "text"
}
}
}
}
],
"nextPageToken": "text"
}GET /dlp/v1/violations HTTP/1.1
Host: api.nightfall.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
GET /dlp/v1/violations/{violationId} HTTP/1.1
Host: api.nightfall.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"id": "text",
"integration": "SLACK",
"createdAt": 1,
"updatedAt": 1,
"possibleActions": [
"ACKNOWLEDGE"
],
"state": "ACTIVE",
"resourceLink": "text",
"metadata": {
"slackMetadata": {
"location": "text",
"locationType": "text",
"username": "text",
"userID": "text",
"messagePermalink": "text",
"locationMembers": [
"text"
],
"locationMemberCount": 1,
"channelID": "text",
"workspaceName": "text"
},
"confluenceMetadata": {
"itemName": "text",
"itemType": "text",
"isArchived": true,
"createdAt": 1,
"updatedAt": 1,
"labels": [
"text"
],
"spaceName": "text",
"spaceKey": "text",
"spaceNameLink": "text",
"parentPageName": "text",
"authorName": "text",
"authorEmail": "text",
"authorNameLink": "text",
"permalink": "text",
"confluenceID": "text",
"confluenceUserID": "text",
"itemVersion": 1,
"parentPageID": "text",
"parentVersion": 1
},
"gdriveMetadata": {
"fileID": "text",
"fileName": "text",
"fileType": "text",
"fileSize": "text",
"fileLink": "text",
"permissionSetting": "text",
"sharingExternalUsers": [
"text"
],
"sharingInternalUsers": [
"text"
],
"canViewersDownload": true,
"fileOwner": "text",
"isInTrash": true,
"createdAt": 1,
"updatedAt": 1,
"drive": "text",
"updatedBy": "text"
},
"jiraMetadata": {
"projectName": "text",
"ticketNumber": "text",
"projectType": "text",
"issueID": "text",
"projectLink": "text",
"ticketLink": "text",
"commentLink": "text",
"attachmentLink": "text"
},
"githubMetadata": {
"branchName": "text",
"organization": "text",
"repository": "text",
"authorEmail": "text",
"authorUsername": "text",
"createdAt": 1,
"isRepoPrivate": true,
"filePath": "text",
"githubPermalink": "text",
"repositoryOwner": "text",
"githubRepoLink": "text"
},
"salesforceMetadata": {
"orgName": "text",
"recordID": "text",
"objectName": "text",
"contentType": "text",
"userID": "text",
"userName": "text",
"updatedAt": 1,
"fields": [
"text"
],
"fileType": "text",
"attachmentLink": "text",
"attachmentName": "text",
"objectLink": "text"
},
"zendeskMetadata": {
"ticketStatus": "text",
"ticketTitle": "text",
"ticketRequestor": "text",
"ticketGroupAssignee": "text",
"ticketAgentAssignee": "text",
"currentUserRole": "text",
"ticketID": 1,
"ticketFollowers": [
"text"
],
"ticketTags": "text",
"createdAt": 1,
"UpdatedAt": 1,
"location": "text",
"subLocation": "text",
"ticketCommentID": 1,
"ticketGroupID": 1,
"ticketGroupLink": "text",
"ticketAgentID": 1,
"ticketAgentLink": "text",
"ticketEvent": "text",
"userRole": "text",
"attachmentName": "text",
"attachmentLink": "text"
},
"notionMetadata": {
"createdBy": "text",
"updatedBy": "text",
"workspaceName": "text",
"workspaceLink": "text",
"pageID": "text",
"pageTitle": "text",
"createdAt": 1,
"updatedAt": 1,
"privatePageLink": "text",
"publicPageLink": "text",
"sharedExternally": true,
"attachmentID": "text"
},
"browserMetadata": {
"location": "text",
"subLocation": "text",
"browserName": "text",
"userComment": "text"
},
"m365TeamsMetadata": {
"teamName": "text",
"tenantID": "text",
"tenantDomain": "text",
"teamID": "text",
"teamVisibility": "text",
"teamWebURL": "text",
"channelID": "text",
"channelName": "text",
"channelType": "text",
"channelWebURL": "text",
"messageID": "text",
"createdAt": 1,
"updatedAt": 1,
"chatMessageSender": "text",
"userID": "text",
"userPrincipalName": "text",
"attachments": [
{
"attachmentID": "text",
"attachmentName": "text",
"attachmentURL": "text"
}
],
"chatMessageImportance": "text",
"chatID": "text",
"chatType": "text",
"chatTopic": "text",
"chatParticipants": [
{
"userID": "text",
"email": "text",
"displayName": "text"
}
]
},
"m365OnedriveMetadata": {
"tenantID": "text",
"tenantDomain": "text",
"driveItemID": "text",
"driveItemName": "text",
"driveItemURL": "text",
"driveItemMimeType": "text",
"driveItemSize": 1,
"parentPath": "text",
"createdByID": "text",
"updatedByEmail": "text",
"updatedByID": "text",
"updatedByName": "text",
"createdAt": 1,
"updatedAt": 1,
"specialFolderName": "text",
"driveID": "text",
"driveOwnerName": "text",
"driveOwnerEmail": "text",
"driveOwnerID": "text"
},
"inlineEmailMetadata": {
"domain": "text",
"user_name": "text",
"from": "text",
"to": [
"text"
],
"cc": [
"text"
],
"bcc": [
"text"
],
"subject": "text",
"sent_at": 1,
"thread_id": "text",
"attachment_name": "text",
"attachment_type": "text"
}
},
"fileDetails": {
"fileName": "text",
"mimeType": "text",
"permalink": "text"
},
"policyUUIDs": [
"text"
],
"detectionRuleUUIDs": [
"text"
],
"detectorUUIDs": [
"text"
],
"risk": "UNSPECIFIED",
"riskSource": "NIGHTFALL",
"riskScore": 1,
"userInfo": {
"username": "text",
"userEmail": "text"
}
}GET /dlp/v1/violations/{violationId}/findings HTTP/1.1
Host: api.nightfall.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
POST /dlp/v1/violations/actions HTTP/1.1
Host: api.nightfall.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 82
{
"violationUUIDs": [
"123e4567-e89b-12d3-a456-426614174000"
],
"action": "ACKNOWLEDGE"
}GET /dlp/v1/annotations/{annotationId} HTTP/1.1
Host: api.nightfall.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"type": "DETECTOR_FALSE_POSITIVE",
"comment": "text",
"autoApply": true
}POST /dlp/v1/findings/{findingId}/annotate HTTP/1.1
Host: api.nightfall.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 68
{
"type": "DETECTOR_FALSE_POSITIVE",
"comment": "text",
"autoApply": true
}POST /dlp/v1/findings/{findingId}/unannotate HTTP/1.1
Host: api.nightfall.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
GET /dlp/v1/violations/{violationId}/activity HTTP/1.1
Host: api.nightfall.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
GET /dlp/v1/violations/search?query=text HTTP/1.1
Host: api.nightfall.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"findings": [
{
"id": "text",
"detectorUUID": "text",
"subDetectorUUID": "text",
"confidence": "text",
"redactedSensitiveText": "text",
"redactedContext": {
"beforeContext": "text",
"afterContext": "text"
},
"redactedLocation": {
"byteRange": {
"start": 1,
"end": 1
},
"lineRange": {
"start": 1,
"end": 1
}
},
"metadata": {
"apiKeyMetaData": {
"status": "UNVERIFIED",
"kind": "UNSPECIFIED",
"description": "text"
}
},
"subLocation": "text",
"annotationUUID": "text"
}
],
"nextPageToken": "text"
}Success
the content type of the response
The string that triggered a match during the scan.
The redacted version of finding. This key is omitted if no redactionConfig was configured the detector that triggered the match.
The sequence of bytes that occurred directly prior to the matched finding. The number of bytes is usually equal to the requested number from the request config, but it could be smaller if the finding occurs near the beginning of the payload. This key is omitted if no context was requested.
The sequence of bytes that occurred directly after the matched finding. The number of bytes is usually equal to the requested number from the request config, but it could be smaller if the finding occurs near the end of the payload. This key is omitted if no context was requested.
The display name of the detector that matched the finding.
The UUID of the detector that matched the finding. This UUID can be looked up in the Nightfall dashboard.
The display name of the subdetector that matched the finding.
The UUID of the subdetector that matched the finding. This UUID can be looked up in the Nightfall dashboard.
The confidence level of a finding.
The index of the fragment's starting byte.
The index of the fragment's ending byte.
The index of the fragment's starting codepoint character.
The index of the fragment's ending codepoint character.
The index of the fragment's starting byte.
The index of the fragment's ending byte.
The index of the fragment's starting codepoint character.
The index of the fragment's ending codepoint character.
A list containing the the redacted version of each string in the input payload. If no redactions were applied, the corresponding string will be empty.
Invalid request payload
Authentication failure
Unprocessable request payload
Rate Limit Exceeded or Monthly Quota Exceeded
Internal Nightfall Error
the number of bytes representing the size of the file to-be-uploaded.
Success
the content type of the response
a UUID to uniquely identify a particular file upload
the size of the file in bytes
the number of bytes to upload in each chunk upload request
an RFC2045 media type that describes the underlying content type
Invalid request payload
Authentication failure
Rate Limit Exceeded or Monthly Quota Exceeded
Internal Nightfall Error
a file ID returned from a previous file creation request
The numeric offset at which the bytes contained in the body should be written. This offset must be a multiple of the chunk size returned when the file upload was created.
The payload bytes to upload; the size of the request body must exactly match the chunkSize that was returned when the file upload was created.
Success
Invalid request payload
Authentication failure
Invalid File ID
Rate Limit Exceeded or Monthly Quota Exceeded
Internal Nightfall Error
a file ID returned from a previous file creation request
Success
the content type of the response
a UUID to uniquely identify a particular file upload
the size of the file in bytes
the number of bytes to upload in each chunk upload request
an RFC2045 media type that describes the underlying content type
Invalid request payload
Authentication failure
Invalid File ID
File Upload in Incorrect State
Rate Limit Exceeded or Monthly Quota Exceeded
Internal Nightfall Error
a file ID returned from a previous file creation request
Success
the content type of the response
a UUID to uniquely identify a particular file upload
message indicating that file scanning has been initiated
Invalid request payload
Authentication failure
Invalid File ID
Incorrect File State
Unprocessable request payload
Rate Limit Exceeded or Monthly Quota Exceeded
Internal Nightfall Error
The request body of the /v3/scan endpoint
A list of UUIDs referring to policies to use to scan the request payload. Policies can be built in the Nightfall Dashboard. Maximum 1.
A list of UUIDs referring to detection rules to use to scan the request payload. Detection rules can be built in the Nightfall dashboard. Maximum 20.
An optional name for the detection rule.
Supported values ALL or ANY. Applies a logical "AND" or "OR" (respectively) to the list of detectors to decide when a finding should be surfaced.
The minimum number of findings required in order for this detector to be reported.
The confidence level of a finding.
The UUID of a pre-existing detector to use. If this value is provided, all below fields are ignored.
The display name for this detector's findings in the response.
The type of detector.
The name for a Nightfall detector.
The regex pattern to match on.
The case sensitivity for the regex pattern.
A list of words for wordList.
The case sensitivity for words in the wordList. If false, ignore the case of findings.
The regex pattern to match on.
The case sensitivity for the regex pattern.
The number of leading characters to include as context before the finding itself.
The number of trailing characters to include as context after the finding itself.
The confidence level of a finding.
The type of match for a pattern.
The type of exclusion rule.
The regex pattern to match on.
The case sensitivity for the regex pattern.
A list of words for wordList.
The case sensitivity for words in the wordList. If false, ignore the case of findings.
The UTF-8 character used to mask a finding. If not provided, we will mask with an asterisk "*". Other examples include "#", "X", "🙅🏽", "🙈", etc.
A list of characters that will not be masked. For example, you could set this field to ["-","@"] to preserve formatting context that is typically present in credit cards or emails (e.g. --- versus *********, or ***************** versus @).
The number of characters that will be left unmasked. For instance, if you want to mask all but the last 4 digits of a credit card number, set this value to 4 so that the redacted finding would look like ***************4242.
Determines if masking is applied left to right (/1984) instead of right to left (01/01). By default, this value is false.
A config that substitutes a sensitive finding with the name of the NIGHTFALL_DETECTOR that triggered it. This config is only valid for detector's with detectorType NIGHTFALL_DETECTOR. e.g. '4242-4242-4242-4242' can be configured to be redacted to '[CREDIT_CARD_NUMBER]'.
The value that will replace a sensitive finding. e.g. '<oh no!🙈>'
The PEM formatted public key block that will be used to encrypt findings. Currently, only RSA encryption is supported.
Here's an example PEM formatted public key block:
-----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAydYMwOYUGyBXDgHkzv19 YR/dYQES4kYTMUps39qv/amNDywz4nsBDvCUqUvcN3nEpplHlYGH5ShSeA4G/Fcm RqynSLVyFPZat/8E7n+EeHsgihFrr8oDWo5UBjCwRinTrC0m11q/5SeNzwVCWkf9 x40u94QBz13dQoa9yPwaZBX5uBzyH86R7yeZHpad2cLq0ltpmJ3j5UfsFilkOb3J B60TNpNDdfabprot/y30CEnDDOgAXGtV1m0AhQpQjKRnkUs39DntqSbS+i0Ugbyq zEGNUkeR1WsotXekW4KnbWA7k6S8SfkO27vnTSY5b9g/KKaOdysn5YaWJPfTVT/n ywIDAQAB -----END PUBLIC KEY-----
Determines if the response object will contain the un-redacted sensitive finding that was triggered by the scan. Defaults to false.
The scope to run the detector over. Setting any detector to File will cause it to run against the file name.
The number of bytes to include as before / after context when a finding is returned. Maximum 40.
The UTF-8 character used to mask a finding. If not provided, we will mask with an asterisk "*". Other examples include "#", "X", "🙅🏽", "🙈", etc.
A list of characters that will not be masked. For example, you could set this field to ["-","@"] to preserve formatting context that is typically present in credit cards or emails (e.g. --- versus *********, or ***************** versus @).
The number of characters that will be left unmasked. For instance, if you want to mask all but the last 4 digits of a credit card number, set this value to 4 so that the redacted finding would look like ***************4242.
Determines if masking is applied left to right (/1984) instead of right to left (01/01). By default, this value is false.
A config that substitutes a sensitive finding with the name of the NIGHTFALL_DETECTOR that triggered it. This config is only valid for detector's with detectorType NIGHTFALL_DETECTOR. e.g. '4242-4242-4242-4242' can be configured to be redacted to '[CREDIT_CARD_NUMBER]'.
The value that will replace a sensitive finding. e.g. '<oh no!🙈>'
The PEM formatted public key block that will be used to encrypt findings. Currently, only RSA encryption is supported.
Here's an example PEM formatted public key block:
-----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAydYMwOYUGyBXDgHkzv19 YR/dYQES4kYTMUps39qv/amNDywz4nsBDvCUqUvcN3nEpplHlYGH5ShSeA4G/Fcm RqynSLVyFPZat/8E7n+EeHsgihFrr8oDWo5UBjCwRinTrC0m11q/5SeNzwVCWkf9 x40u94QBz13dQoa9yPwaZBX5uBzyH86R7yeZHpad2cLq0ltpmJ3j5UfsFilkOb3J B60TNpNDdfabprot/y30CEnDDOgAXGtV1m0AhQpQjKRnkUs39DntqSbS+i0Ugbyq zEGNUkeR1WsotXekW4KnbWA7k6S8SfkO27vnTSY5b9g/KKaOdysn5YaWJPfTVT/n ywIDAQAB -----END PUBLIC KEY-----
Determines if the response object will contain the un-redacted sensitive finding that was triggered by the scan. Defaults to false.
The name of the Slack conversation to which alerts should be sent. Currently, Nightfall supports sending alerts to public channels, formatted like "#general".
The email address to which alerts should be sent.
The URL to which alerts should be sent. This URL must (1) use the HTTPS scheme, (2) be able to accept requests made with the POST verb, and (3) respond with a 200 status code upon receipt of the event.
The URL to which alerts should be sent. This URL must (1) use the HTTPS scheme, (2) be able to accept requests made with the POST verb, and (3) respond with a 200 status code upon receipt of the event.
The text sample(s) you wish to scan. This data is passed as a string list, so you may choose to segment your text into multiple items for better granularity. The aggregate size of your text (summed across all items in the list) must not exceed 500 KB for any individual request, and the number of items in that list may not exceed 50,000.
No content
the UUID of the Detection Policy to be used with this scan. Exactly one of this field or "policy" should be provided.
the URL that Nightfall shall deliver webhooks to when the scan completes. The URL must use the HTTPS scheme. This field has been deprecated in favor of the more general 'alertConfig'.
A list of pre-existing detection rule UUIDs to scan a file against. These UUIDs can be fetched from the Nightfall Dashboard.
An optional name for the detection rule.
Supported values ALL or ANY. Applies a logical "AND" or "OR" (respectively) to the list of detectors to decide when a finding should be surfaced.
The minimum number of findings required in order for this detector to be reported.
The confidence level of a finding.
The UUID of a pre-existing detector to use. If this value is provided, all below fields are ignored.
The display name for this detector's findings in the response.
The type of detector.
The name for a Nightfall detector.
The regex pattern to match on.
The case sensitivity for the regex pattern.
A list of words for wordList.
The case sensitivity for words in the wordList. If false, ignore the case of findings.
The regex pattern to match on.
The case sensitivity for the regex pattern.
The number of leading characters to include as context before the finding itself.
The number of trailing characters to include as context after the finding itself.
The confidence level of a finding.
The type of match for a pattern.
The type of exclusion rule.
The regex pattern to match on.
The case sensitivity for the regex pattern.
A list of words for wordList.
The case sensitivity for words in the wordList. If false, ignore the case of findings.
The UTF-8 character used to mask a finding. If not provided, we will mask with an asterisk "*". Other examples include "#", "X", "🙅🏽", "🙈", etc.
A list of characters that will not be masked. For example, you could set this field to ["-","@"] to preserve formatting context that is typically present in credit cards or emails (e.g. --- versus *********, or ***************** versus @).
The number of characters that will be left unmasked. For instance, if you want to mask all but the last 4 digits of a credit card number, set this value to 4 so that the redacted finding would look like ***************4242.
Determines if masking is applied left to right (/1984) instead of right to left (01/01). By default, this value is false.
A config that substitutes a sensitive finding with the name of the NIGHTFALL_DETECTOR that triggered it. This config is only valid for detector's with detectorType NIGHTFALL_DETECTOR. e.g. '4242-4242-4242-4242' can be configured to be redacted to '[CREDIT_CARD_NUMBER]'.
The value that will replace a sensitive finding. e.g. '<oh no!🙈>'
The PEM formatted public key block that will be used to encrypt findings. Currently, only RSA encryption is supported.
Here's an example PEM formatted public key block:
-----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAydYMwOYUGyBXDgHkzv19 YR/dYQES4kYTMUps39qv/amNDywz4nsBDvCUqUvcN3nEpplHlYGH5ShSeA4G/Fcm RqynSLVyFPZat/8E7n+EeHsgihFrr8oDWo5UBjCwRinTrC0m11q/5SeNzwVCWkf9 x40u94QBz13dQoa9yPwaZBX5uBzyH86R7yeZHpad2cLq0ltpmJ3j5UfsFilkOb3J B60TNpNDdfabprot/y30CEnDDOgAXGtV1m0AhQpQjKRnkUs39DntqSbS+i0Ugbyq zEGNUkeR1WsotXekW4KnbWA7k6S8SfkO27vnTSY5b9g/KKaOdysn5YaWJPfTVT/n ywIDAQAB -----END PUBLIC KEY-----
Determines if the response object will contain the un-redacted sensitive finding that was triggered by the scan. Defaults to false.
The scope to run the detector over. Setting any detector to File will cause it to run against the file name.
The name of the Slack conversation to which alerts should be sent. Currently, Nightfall supports sending alerts to public channels, formatted like "#general".
The email address to which alerts should be sent.
The URL to which alerts should be sent. This URL must (1) use the HTTPS scheme, (2) be able to accept requests made with the POST verb, and (3) respond with a 200 status code upon receipt of the event.
The URL to which alerts should be sent. This URL must (1) use the HTTPS scheme, (2) be able to accept requests made with the POST verb, and (3) respond with a 200 status code upon receipt of the event.
The UTF-8 character used to mask a finding. If not provided, we will mask with an asterisk "*". Other examples include "#", "X", "🙅🏽", "🙈", etc.
A list of characters that will not be masked. For example, you could set this field to ["-","@"] to preserve formatting context that is typically present in credit cards or emails (e.g. --- versus *********, or ***************** versus @).
The number of characters that will be left unmasked. For instance, if you want to mask all but the last 4 digits of a credit card number, set this value to 4 so that the redacted finding would look like ***************4242.
Determines if masking is applied left to right (/1984) instead of right to left (01/01). By default, this value is false.
A config that substitutes a sensitive finding with the name of the NIGHTFALL_DETECTOR that triggered it. This config is only valid for detector's with detectorType NIGHTFALL_DETECTOR. e.g. '4242-4242-4242-4242' can be configured to be redacted to '[CREDIT_CARD_NUMBER]'.
The value that will replace a sensitive finding. e.g. '<oh no!🙈>'
The PEM formatted public key block that will be used to encrypt findings. Currently, only RSA encryption is supported.
Here's an example PEM formatted public key block:
-----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAydYMwOYUGyBXDgHkzv19 YR/dYQES4kYTMUps39qv/amNDywz4nsBDvCUqUvcN3nEpplHlYGH5ShSeA4G/Fcm RqynSLVyFPZat/8E7n+EeHsgihFrr8oDWo5UBjCwRinTrC0m11q/5SeNzwVCWkf9 x40u94QBz13dQoa9yPwaZBX5uBzyH86R7yeZHpad2cLq0ltpmJ3j5UfsFilkOb3J B60TNpNDdfabprot/y30CEnDDOgAXGtV1m0AhQpQjKRnkUs39DntqSbS+i0Ugbyq zEGNUkeR1WsotXekW4KnbWA7k6S8SfkO27vnTSY5b9g/KKaOdysn5YaWJPfTVT/n ywIDAQAB -----END PUBLIC KEY-----
Determines if the response object will contain the un-redacted sensitive finding that was triggered by the scan. Defaults to false.
Determines if a redacted version of the file will be returned, if available for the mime type. Current supported mime types are CSV and TSV. Defaults to false.
A string containing arbitrary metadata. Callers may opt to use this to help identify their input file upon receiving a webhook response. Maximum length 10 KB.
{
"findings": [
[
{
"finding": "text",
"redactedFinding": "text",
"beforeContext": "text",
"afterContext": "text",
"detector": {
"name": "text",
"uuid": "123e4567-e89b-12d3-a456-426614174000",
"subdetector": {
"name": "text",
"uuid": "123e4567-e89b-12d3-a456-426614174000"
}
},
"confidence": "VERY_UNLIKELY",
"location": {
"byteRange": {
"start": 1,
"end": 1
},
"codepointRange": {
"start": 1,
"end": 1
}
},
"redactedLocation": {
"byteRange": {
"start": 1,
"end": 1
},
"codepointRange": {
"start": 1,
"end": 1
}
}
}
]
],
"redactedPayload": [
"text"
]
}{
"id": "123e4567-e89b-12d3-a456-426614174000",
"fileSizeBytes": 1,
"chunkSize": 1,
"mimeType": "text"
}{
"id": "123e4567-e89b-12d3-a456-426614174000",
"message": "text"
}POST /v3/scan HTTP/1.1
Host: api.nightfall.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 1595
{
"policyUUIDs": [
"text"
],
"policy": {
"detectionRuleUUIDs": [
"text"
],
"detectionRules": [
{
"name": "text",
"logicalOp": "ANY",
"detectors": [
{
"minNumFindings": 1,
"minConfidence": "VERY_UNLIKELY",
"detectorUUID": "text",
"displayName": "text",
"detectorType": "NIGHTFALL_DETECTOR",
"nightfallDetector": "AMERICAN_BANKERS_CUSIP_ID",
"regex": {
"pattern": "text",
"isCaseSensitive": true
},
"wordList": {
"values": [
"text"
],
"isCaseSensitive": true
},
"contextRules": [
{
"regex": {
"pattern": "text",
"isCaseSensitive": true
},
"proximity": {
"windowBefore": 1,
"windowAfter": 1
},
"confidenceAdjustment": {
"fixedConfidence": "VERY_UNLIKELY"
}
}
],
"exclusionRules": [
{
"matchType": "PARTIAL",
"exclusionType": "REGEX",
"regex": {
"pattern": "text",
"isCaseSensitive": true
},
"wordList": {
"values": [
"text"
],
"isCaseSensitive": true
}
}
],
"redactionConfig": {
"maskConfig": {
"maskingChar": "text",
"charsToIgnore": [
"text"
],
"numCharsToLeaveUnmasked": 1,
"maskLeftToRight": true
},
"infoTypeSubstitutionConfig": {},
"substitutionConfig": {
"substitutionPhrase": "text"
},
"cryptoConfig": {
"publicKey": "text"
},
"removeFinding": true
},
"scope": "Content"
}
]
}
],
"contextBytes": 1,
"defaultRedactionConfig": {
"maskConfig": {
"maskingChar": "text",
"charsToIgnore": [
"text"
],
"numCharsToLeaveUnmasked": 1,
"maskLeftToRight": true
},
"infoTypeSubstitutionConfig": {},
"substitutionConfig": {
"substitutionPhrase": "text"
},
"cryptoConfig": {
"publicKey": "text"
},
"removeFinding": true
},
"alertConfig": {
"slack": {
"target": "text"
},
"email": {
"address": "text"
},
"url": {
"address": "text"
},
"siem": {
"address": "text",
"sensitiveHeaders": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"plainTextHeaders": {
"ANY_ADDITIONAL_PROPERTY": "text"
}
}
}
},
"payload": [
"text"
]
}POST /v3/upload HTTP/1.1
Host: api.nightfall.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 19
{
"fileSizeBytes": 1
}PATCH /v3/upload/{fileId} HTTP/1.1
Host: api.nightfall.ai
Authorization: Bearer YOUR_SECRET_TOKEN
X-Upload-Offset: 1
Content-Type: application/octet-stream
Accept: */*
POST /v3/upload/{fileId}/finish HTTP/1.1
Host: api.nightfall.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"fileSizeBytes": 1,
"chunkSize": 1,
"mimeType": "text"
}POST /v3/upload/{fileId}/scan HTTP/1.1
Host: api.nightfall.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 1672
{
"policyUUID": "123e4567-e89b-12d3-a456-426614174000",
"policy": {
"detectionRuleUUIDs": [
"123e4567-e89b-12d3-a456-426614174000"
],
"detectionRules": [
{
"name": "text",
"logicalOp": "ANY",
"detectors": [
{
"minNumFindings": 1,
"minConfidence": "VERY_UNLIKELY",
"detectorUUID": "text",
"displayName": "text",
"detectorType": "NIGHTFALL_DETECTOR",
"nightfallDetector": "AMERICAN_BANKERS_CUSIP_ID",
"regex": {
"pattern": "text",
"isCaseSensitive": true
},
"wordList": {
"values": [
"text"
],
"isCaseSensitive": true
},
"contextRules": [
{
"regex": {
"pattern": "text",
"isCaseSensitive": true
},
"proximity": {
"windowBefore": 1,
"windowAfter": 1
},
"confidenceAdjustment": {
"fixedConfidence": "VERY_UNLIKELY"
}
}
],
"exclusionRules": [
{
"matchType": "PARTIAL",
"exclusionType": "REGEX",
"regex": {
"pattern": "text",
"isCaseSensitive": true
},
"wordList": {
"values": [
"text"
],
"isCaseSensitive": true
}
}
],
"redactionConfig": {
"maskConfig": {
"maskingChar": "text",
"charsToIgnore": [
"text"
],
"numCharsToLeaveUnmasked": 1,
"maskLeftToRight": true
},
"infoTypeSubstitutionConfig": {},
"substitutionConfig": {
"substitutionPhrase": "text"
},
"cryptoConfig": {
"publicKey": "text"
},
"removeFinding": true
},
"scope": "Content"
}
]
}
],
"alertConfig": {
"slack": {
"target": "text"
},
"email": {
"address": "text"
},
"url": {
"address": "text"
},
"siem": {
"address": "text",
"sensitiveHeaders": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"plainTextHeaders": {
"ANY_ADDITIONAL_PROPERTY": "text"
}
}
},
"defaultRedactionConfig": {
"maskConfig": {
"maskingChar": "text",
"charsToIgnore": [
"text"
],
"numCharsToLeaveUnmasked": 1,
"maskLeftToRight": true
},
"infoTypeSubstitutionConfig": {},
"substitutionConfig": {
"substitutionPhrase": "text"
},
"cryptoConfig": {
"publicKey": "text"
},
"removeFinding": true
},
"enableFileRedaction": true
},
"requestMetadata": "text"
}Unix timestamp in seconds, filters records created ≥ the value, defaults to -180 days UTC
Unix timestamp in seconds, filters records created < the value, defaults to end of the current day UTC
Unix timestamp in seconds, filters records updated > the value
The maximum number of records to be returned in the response
50Cursor for getting the next page of results
Sort key and direction, defaults to descending order by creation time
TIME_DESCPossible values: The query containing filter clauses
Query structure and terminology
A query clause consists of a field followed by an operator followed by a value:
| term | value |
|---|---|
| clause | user_email:"[email protected]" |
| field | user_email |
| operator | : |
| value | [email protected] |
You can combine multiple query clauses in a search by separating them with a space.
Field types, substring matching, and numeric comparators
Every search field supports exact matching with a :. Certain fields such as user_email and user_name support substring matching.
Quotes
You may use quotation marks around string values. Quotation marks are required in case the value contains spaces. For example:
user_mail:[email protected]user_name:"John Doe"Special Characters
+ - && || ! ( ) { } [ ] ^ " ~ * ? : are special characters need to be escaped using \. For example:
(1+1):2 should be searched for using \(1\+1)\:2Search Syntax
The following table lists the syntax that you can use to construct a query.
| SYNTAX | USAGE | DESCRIPTION | EXAMPLES |
|---|---|---|---|
: |
field:value | Exact match operator (case insensitive) | state:"pending" returns records where the currency is exactly "PENDING" in a case-insensitive comparison |
(space) |
field1:value1 field2:value2 | The query returns only records that match both clauses | state:active slack.channel_name:general |
OR |
field:(value1 OR value2) | The query returns records that match either of the values (case insensitive) | state:(active OR pending) |
Query Fields
| param | description |
|---|---|
| event_id | the unique identifier of the posture event to filter on |
| integration_name | the name of the integration to filter on |
| state | the state of the event to filter on (active, pending, resolved, expired) |
| event_type | the type of posture event to filter on |
| actor_name | the name of the actor who performed the action to filter on |
| actor_email | the email of the actor who performed the action to filter on |
| user_name | the username of the user to filter on (backward compatibility) |
| user_email | the email of the user to filter on (backward compatibility) |
| notes | the comment or notes associated with the event to filter on |
| policy_id | the unique identifier of the policy to filter on |
| policy_name | the name of the policy to filter on |
| resource_id | the identifier of the resource to filter on |
| resource_name | the name of the resource to filter on |
| resource_owner_name | the name of the resource owner to filter on |
| resource_owner_email | the email of the resource owner to filter on |
| resource_content_type | the content type of the resource to filter on |
| endpoint.device_id | the device identifier for endpoint events to filter on |
| endpoint.machine_name | the machine name for endpoint events to filter on |
| gdrive.permission | the permission setting for Google Drive files to filter on |
| gdrive.shared_internal_email | the internal emails with which the file is shared to filter on |
| gdrive.shared_external_email | the external emails with which the file is shared to filter on |
| gdrive.drive | the Google Drive name to filter on |
| gdrive.file_owner | the owner of the Google Drive file to filter on |
| gdrive.label_name | the label name applied to Google Drive files to filter on |
| salesforce.report.scope | the scope of the Salesforce report to filter on |
| salesforce.report.event_source | the event source of the Salesforce report to filter on |
| salesforce.report.source_ip | the source IP address of the Salesforce report to filter on |
| salesforce.report.session_level | the session level of the Salesforce report to filter on |
| salesforce.report.operation | the operation type of the Salesforce report to filter on |
| salesforce.report.description | the description of the Salesforce report to filter on |
| salesforce.file.source_ip | the source IP address for Salesforce file events to filter on |
| salesforce.file.session_level | the session level for Salesforce file events to filter on |
Successful response
How many remaining requests you can make within the next second before being throttled
How many remaining requests you can make within the next quota period
When the current quota period expires
Unique identifier for the posture event
Integration type that generated the event (e.g., GDRIVE, ES_WINDOWS, ES_MAC)
Unix timestamp in seconds indicating when the event was created
Current state of the event (e.g., ACTIVE, RESOLVED, EXPIRED, PENDING)
Type of exfiltration event (e.g., PERMISSION_CHANGE, ADD_EXTERNAL_USER)
List of policy UUIDs that triggered the event
Number of assets involved in the posture event
Username of the associated user
Email of the associated user
Link to the user's profile
Device identifier for endpoint events
Machine name for endpoint events
Whether the user is external to the organization
Identifier of the application
Name of the application
Next page cursor, omitted if end of results reached
Invalid request parameters
Authentication failure
Rate Limit Exceeded or Daily Quota Exceeded
Internal Nightfall Error
Unix timestamp in seconds, filters records created ≥ the value, defaults to -90 days UTC
Unix timestamp in seconds, filters records created < the value, defaults to end of the current day UTC
Unix timestamp in seconds, filters records updated > the value
The maximum number of records to be returned in the response
50Cursor for getting the next page of results
Successful response
How many remaining requests you can make within the next second before being throttled
How many remaining requests you can make within the next quota period
When the current quota period expires
Unique identifier for the posture event
Integration type that generated the event (e.g., GDRIVE, ES_WINDOWS, ES_MAC)
Unix timestamp in seconds indicating when the event was created
Current state of the event (e.g., ACTIVE, RESOLVED, EXPIRED, PENDING)
Type of exfiltration event (e.g., PERMISSION_CHANGE, ADD_EXTERNAL_USER)
List of policy UUIDs that triggered the event
Number of assets involved in the posture event
Username of the associated user
Email of the associated user
Link to the user's profile
Device identifier for endpoint events
Machine name for endpoint events
Whether the user is external to the organization
Identifier of the application
Name of the application
Next page cursor, omitted if end of results reached
Invalid request parameters
Authentication failure
Rate Limit Exceeded or Daily Quota Exceeded
Internal Nightfall Error
The UUID of the event to fetch
Successful response
How many remaining requests you can make within the next second before being throttled
How many remaining requests you can make within the next quota period
When the current quota period expires
Unique identifier for the asset
Name of the asset
Path to the asset
Size of the asset in bytes
MIME type of the asset
Unique identifier for the actor in Nightfall
Email of the actor
Comment or notes associated with the event
Groups the user belongs to
Whether the user is an admin
Whether the user is suspended
Timestamp when the user was created
Salesforce user metadata (currently empty as per spec)
Comment or notes associated with the asset
array to strings to DDR violations ids associated with the resource
ID of the file
Name of the file
Size of the file
Link to the file
Permission setting for the file
External users with whom the file is shared
Internal users with whom the file is shared
Whether viewers can download the file
Owner of the file
Whether the file is in trash
Timestamp when the file was created
Timestamp when the file was last updated
Drive where the file is located
Labels associated with the file
Type of file permission
Type of Salesforce resource
Action performed on the file
Source IP address
Level of the session
Description of the report
Entity fields displayed in the report
Name of the dashboard
Scope of the report
Operation performed
Number of records
Entities queried in the report
Grouped column headers
Number of columns
Number of rows processed
Source IP address
Source of the event
Level of the session
Query executed
Identifier of the event
Source IP address
Key of the session
Level of the session
Unique identifier for the actor in Nightfall
Email of the actor
Comment or notes associated with the event
Groups the user belongs to
Whether the user is an admin
Whether the user is suspended
Timestamp when the user was created
Salesforce user metadata (currently empty as per spec)
Type of the event
Timestamp of the event
ID of the originating app
Name of the originating app
Whether this is a client sync event
Source IP address
Level of the session
Key of the session
Salesforce user ID
array to string with asset IDs associated with the event
Invalid request parameters
Authentication failure
Event does not exist
Rate Limit Exceeded or Daily Quota Exceeded
Internal Nightfall Error
The UUID of the posture event
Number of activity items to fetch in one page
50Unix timestamp in seconds, filters activity created > the value
Unix timestamp in seconds, filters activity created < the value
Whether to sort results in descending order (default false)
falseCursor for getting the next page of results
Successful response
How many remaining requests you can make within the next second before being throttled
How many remaining requests you can make within the next quota period
When the current quota period expires
Unique identifier for the activity log entry
Human-readable message describing the activity
Unix timestamp in seconds when the activity occurred
Next page cursor, omitted if end of results reached
Invalid request parameters
Authentication failure
Event does not exist
Rate Limit Exceeded or Daily Quota Exceeded
Internal Nightfall Error
The ID of the asset to fetch activities for
Unix timestamp in seconds, filters activities created ≥ the value
Unix timestamp in seconds, filters activities created < the value
Cursor for getting the next page of results
Successful response
How many remaining requests you can make within the next second before being throttled
How many remaining requests you can make within the next quota period
When the current quota period expires
Type of the activity
Email of the user who performed the activity
Unix timestamp in seconds indicating when the activity occurred
Names of asset involved in the activity
Source of the download
Name of the downloaded file
Domain where the upload occurred
Name of the uploaded file
Cloud application used for synchronization
Name of the synchronized file
Domain related to the clipboard activity
Next page cursor, omitted if end of results reached
Invalid request parameters
Authentication failure
Rate Limit Exceeded or Daily Quota Exceeded
Internal Nightfall Error
The Nightfall ID of the actor to fetch activities for
Unix timestamp in seconds, filters activities created ≥ the value
Unix timestamp in seconds, filters activities created < the value
Cursor for getting the next page of results
Successful response
How many remaining requests you can make within the next second before being throttled
How many remaining requests you can make within the next quota period
When the current quota period expires
Type of the activity
Email of the user who performed the activity
Unix timestamp in seconds indicating when the activity occurred
Names of asset involved in the activity
Source of the download
Name of the downloaded file
Domain where the upload occurred
Name of the uploaded file
Cloud application used for synchronization
Name of the synchronized file
Domain related to the clipboard activity
Next page cursor, omitted if end of results reached
Invalid request parameters
Authentication failure
Rate Limit Exceeded or Daily Quota Exceeded
Internal Nightfall Error
{
"events": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"integration": "text",
"createdAt": 1,
"state": "text",
"eventType": "text",
"policyUUIDs": [
"123e4567-e89b-12d3-a456-426614174000"
],
"assetsCount": 1,
"userInfo": {
"username": "text",
"userEmail": "[email protected]",
"userProfileLink": "https://example.com",
"deviceId": "text",
"machineName": "text",
"isExternal": true
},
"appInfo": {
"id": "text",
"name": "text"
}
}
],
"nextPageToken": "text"
}{
"events": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"integration": "text",
"createdAt": 1,
"state": "text",
"eventType": "text",
"policyUUIDs": [
"123e4567-e89b-12d3-a456-426614174000"
],
"assetsCount": 1,
"userInfo": {
"username": "text",
"userEmail": "[email protected]",
"userProfileLink": "https://example.com",
"deviceId": "text",
"machineName": "text",
"isExternal": true
},
"appInfo": {
"id": "text",
"name": "text"
}
}
],
"nextPageToken": "text"
}{
"activities": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"message": "text",
"timestamp": 1,
"type": "CREATION",
"data": {
"action": "ACKNOWLEDGE",
"userUUID": "123e4567-e89b-12d3-a456-426614174000",
"userName": "text",
"userEmail": "text",
"receiverEmail": "text",
"actionLogData": {
"applyLabelsActionLogData": {
"activityType": "LABELS_SUCCESSFULLY_APPLIED",
"labels": [
"text"
],
"labelUpdatesOnResource": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"failureReason": "text"
},
"setExpirationActionLogData": {
"expirationTime": 1
},
"revokeAccessActionLogData": {
"revokedEmails": [
"text"
],
"unRevokedEmails": [
"text"
]
},
"notifyEmailActionLogData": {
"receiverEmail": "text"
},
"genericActionLogData": {
"additionalContext": "text"
}
}
}
}
],
"nextPageToken": "text"
}{
"activities": [
{
"type": "DOWNLOAD",
"userEmail": "[email protected]",
"eventTime": 1,
"assetNames": [
"text"
],
"metadata": {
"downloadEventMetadata": {
"source": "text",
"fileName": "text"
},
"browserUploadMetadata": {
"domain": "text",
"fileName": "text"
},
"cloudSyncMetadata": {
"cloudApp": "text",
"fileName": "text"
},
"clipboardMetadata": {
"browserMetadata": {
"domain": "text"
}
}
}
}
],
"nextPageToken": "text"
}{
"activities": [
{
"type": "DOWNLOAD",
"userEmail": "[email protected]",
"eventTime": 1,
"assetNames": [
"text"
],
"metadata": {
"downloadEventMetadata": {
"source": "text",
"fileName": "text"
},
"browserUploadMetadata": {
"domain": "text",
"fileName": "text"
},
"cloudSyncMetadata": {
"cloudApp": "text",
"fileName": "text"
},
"clipboardMetadata": {
"browserMetadata": {
"domain": "text"
}
}
}
}
],
"nextPageToken": "text"
}GET /posture/v1/events HTTP/1.1
Host: api.nightfall.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
GET /posture/v1/events/{eventId} HTTP/1.1
Host: api.nightfall.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"assets": {
"id": "text",
"name": "text",
"path": "text",
"sizeBytes": 1,
"mimetype": "text",
"owner": {
"id": "text",
"email": "[email protected]",
"comment": "text",
"metadata": {
"gdrive": {
"userBelongsToGroups": [
"text"
],
"isAdmin": true,
"isSuspended": true,
"createdAt": 1
},
"salesforce": {}
}
},
"comment": "text",
"ddrViolationIDs": [],
"metadata": {
"gdrive": {
"fileID": "text",
"fileName": "text",
"fileSize": "text",
"fileLink": "text",
"permissionSetting": "text",
"sharingExternalUsers": [
"text"
],
"sharingInternalUsers": [
"text"
],
"canViewersDownload": true,
"fileOwner": "text",
"isInTrash": true,
"createdAt": 1,
"updatedAt": 1,
"drive": "text",
"labels": [
"text"
],
"filePermissionType": "text"
},
"salesforce": {
"resourceType": "text",
"fileResourceMetadata": {
"fileAction": "text",
"sourceIP": "text",
"sessionLevel": "text"
},
"reportResourceMetadata": {
"description": "text",
"displayEntityFields": [
"text"
],
"dashboardName": "text",
"scope": "text",
"operation": "text",
"recordCount": 1,
"queriedEntities": [
"text"
],
"groupedColumnHeaders": [
"text"
],
"columnCount": 1,
"processedRowCount": 1,
"sourceIP": "text",
"eventSource": "text",
"sessionLevel": "text"
},
"bulkApiResourceMetadata": {
"query": "text",
"eventIdentifier": "text",
"sourceIP": "text",
"sessionKey": "text",
"sessionLevel": "text"
}
}
}
},
"actor": {
"id": "text",
"email": "[email protected]",
"comment": "text",
"metadata": {
"gdrive": {
"userBelongsToGroups": [
"text"
],
"isAdmin": true,
"isSuspended": true,
"createdAt": 1
},
"salesforce": {}
}
},
"events": {
"type": "PERMISSION_CHANGE",
"timestamp": 1,
"metadata": {
"gdrive": {
"originatingAppId": "text",
"originatingAppName": "text",
"isClientSyncEvent": true
},
"salesforce": {
"sourceIP": "text",
"sessionLevel": "text",
"sessionKey": "text",
"sfUserId": "text"
}
},
"assetIDs": []
}
}GET /posture/v1/events/{eventId}/activity HTTP/1.1
Host: api.nightfall.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
GET /posture/v1/asset/activity?assetID=text&rangeStart=1&rangeEnd=1 HTTP/1.1
Host: api.nightfall.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
GET /posture/v1/actor/activity?actorID=text&rangeStart=1&rangeEnd=1 HTTP/1.1
Host: api.nightfall.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
GET /posture/v1/events/search?query=text HTTP/1.1
Host: api.nightfall.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Unix timestamp in seconds, filters records created ≥ the value, defaults to -180 days UTC
Unix timestamp in seconds, filters records created < the value, defaults to end of the current day UTC
Unix timestamp in seconds, filters records updated > the value
The maximum number of records to be returned in the response
50Cursor for getting the next page of results
Sort key and direction, defaults to descending order by creation time
TIME_DESCPossible values: The query containing filter clauses
Query structure and terminology
A query clause consists of a field followed by an operator followed by a value:
| term | value |
|---|---|
| clause | user_email:"[email protected]" |
| field | user_email |
| operator | : |
| value | [email protected] |
You can combine multiple query clauses in a search by separating them with a space.
Field types, substring matching, and numeric comparators
Every search field supports exact matching with a :. Certain fields such as user_email and user_name support substring matching.
Quotes
You may use quotation marks around string values. Quotation marks are required in case the value contains spaces. For example:
user_mail:[email protected]user_name:"John Doe"Special Characters
+ - && || ! ( ) { } [ ] ^ " ~ * ? : are special characters need to be escaped using \. For example:
(1+1):2 should be searched for using \(1\+1)\:2Search Syntax
The following table lists the syntax that you can use to construct a query.
| SYNTAX | USAGE | DESCRIPTION | EXAMPLES |
|---|---|---|---|
: |
field:value | Exact match operator (case insensitive) | state:"pending" returns records where the currency is exactly "PENDING" in a case-insensitive comparison |
(space) |
field1:value1 field2:value2 | The query returns only records that match both clauses | state:active slack.channel_name:general |
OR |
field:(value1 OR value2) | The query returns records that match either of the values (case insensitive) | state:(active OR pending) |
Query Fields
| param | description |
|---|---|
| event_id | the unique identifier of the exfiltration event to filter on |
| integration_name | the name of the integration to filter on |
| state | the state of the event to filter on (active, pending, resolved, expired) |
| event_type | the type of exfiltration event to filter on |
| actor_name | the name of the actor who performed the action to filter on |
| actor_email | the email of the actor who performed the action to filter on |
| user_name | the username of the user to filter on (backward compatibility) |
| user_email | the email of the user to filter on (backward compatibility) |
| notes | the comment or notes associated with the event to filter on |
| policy_id | the unique identifier of the policy to filter on |
| policy_name | the name of the policy to filter on |
| resource_id | the identifier of the resource to filter on |
| resource_name | the name of the resource to filter on |
| resource_owner_name | the name of the resource owner to filter on |
| resource_owner_email | the email of the resource owner to filter on |
| resource_content_type | the content type of the resource to filter on |
| endpoint.device_id | the device identifier for endpoint events to filter on |
| endpoint.machine_name | the machine name for endpoint events to filter on |
| gdrive.permission | the permission setting for Google Drive files to filter on |
| gdrive.shared_internal_email | the internal emails with which the file is shared to filter on |
| gdrive.shared_external_email | the external emails with which the file is shared to filter on |
| gdrive.drive | the Google Drive name to filter on |
| gdrive.file_owner | the owner of the Google Drive file to filter on |
| gdrive.label_name | the label name applied to Google Drive files to filter on |
| salesforce.report.scope | the scope of the Salesforce report to filter on |
| salesforce.report.event_source | the event source of the Salesforce report to filter on |
| salesforce.report.source_ip | the source IP address of the Salesforce report to filter on |
| salesforce.report.session_level | the session level of the Salesforce report to filter on |
| salesforce.report.operation | the operation type of the Salesforce report to filter on |
| salesforce.report.description | the description of the Salesforce report to filter on |
| salesforce.file.source_ip | the source IP address for Salesforce file events to filter on |
| salesforce.file.session_level | the session level for Salesforce file events to filter on |
| last_actioned_by | the entity that performed the last action on the violation, can be one of NIGHTFALL, ADMIN or END_USER |
Successful response
How many remaining requests you can make within the next second before being throttled
How many remaining requests you can make within the next quota period
When the current quota period expires
Unique identifier for the exfiltration event
Integration type that generated the event (e.g., GDRIVE, ES_WINDOWS, ES_MAC)
Unix timestamp in seconds indicating when the event was created
Current state of the event (e.g., ACTIVE, RESOLVED, EXPIRED, PENDING)
Type of exfiltration event (e.g., DOWNLOAD, ENDPOINTDLP_BROWSER_UPLOAD)
List of policy UUIDs that triggered the event
Number of assets involved in the exfiltration event
Username of the associated user
Email of the associated user
Link to the user's profile
Device identifier for endpoint events
Machine name for endpoint events
Whether the user is external to the organization
Identifier of the application
Name of the application
Next page cursor, omitted if end of results reached
Invalid request parameters
Authentication failure
Rate Limit Exceeded or Daily Quota Exceeded
Internal Nightfall Error
Unix timestamp in seconds, filters records created ≥ the value, defaults to -90 days UTC
Unix timestamp in seconds, filters records created < the value, defaults to end of the current day UTC
Unix timestamp in seconds, filters records updated > the value
The maximum number of records to be returned in the response
50Cursor for getting the next page of results
Successful response
How many remaining requests you can make within the next second before being throttled
How many remaining requests you can make within the next quota period
When the current quota period expires
Unique identifier for the exfiltration event
Integration type that generated the event (e.g., GDRIVE, ES_WINDOWS, ES_MAC)
Unix timestamp in seconds indicating when the event was created
Current state of the event (e.g., ACTIVE, RESOLVED, EXPIRED, PENDING)
Type of exfiltration event (e.g., DOWNLOAD, ENDPOINTDLP_BROWSER_UPLOAD)
List of policy UUIDs that triggered the event
Number of assets involved in the exfiltration event
Username of the associated user
Email of the associated user
Link to the user's profile
Device identifier for endpoint events
Machine name for endpoint events
Whether the user is external to the organization
Identifier of the application
Name of the application
Next page cursor, omitted if end of results reached
Invalid request parameters
Authentication failure
Rate Limit Exceeded or Daily Quota Exceeded
Internal Nightfall Error
The UUID of the event to fetch
Successful response
How many remaining requests you can make within the next second before being throttled
How many remaining requests you can make within the next quota period
When the current quota period expires
Unique identifier for the asset
Name of the asset
Path to the asset
Size of the asset in bytes
MIME type of the asset
Unique identifier for the actor in Nightfall
Email of the actor
Comment or notes associated with the event
Groups the user belongs to
Whether the user is an admin
Whether the user is suspended
Timestamp when the user was created
Salesforce user metadata (currently empty as per spec)
ID of the device
Name of the machine/device
Comment or notes associated with the asset
DDR violations IDs associated with the resource
ID of the file
Name of the file
Size of the file
Link to the file
Permission setting for the file
External users with whom the file is shared
Internal users with whom the file is shared
Whether viewers can download the file
Owner of the file
Whether the file is in trash
Timestamp when the file was created
Timestamp when the file was last updated
Drive where the file is located
Labels associated with the file
Type of file permission
Type of Salesforce resource
Action performed on the file
Source IP address
Level of the session
Description of the report
Entity fields displayed in the report
Name of the dashboard
Scope of the report
Operation performed
Number of records
Entities queried in the report
Grouped column headers
Number of columns
Number of rows processed
Source IP address
Source of the event
Level of the session
Query executed
Identifier of the event
Source IP address
Key of the session
Level of the session
Medium used
Name of the medium
User of the endpoint agent
Unique identifier for the actor in Nightfall
Email of the actor
Comment or notes associated with the event
Groups the user belongs to
Whether the user is an admin
Whether the user is suspended
Timestamp when the user was created
Salesforce user metadata (currently empty as per spec)
ID of the device
Name of the machine/device
Type of the event
Timestamp of the event
Name of the browser
Version of the browser
Domain where the upload occurred
URL of the active browser tab
Title of the active browser tab
Unix timestamp when the upload started
Unix timestamp when the upload ended
Name of the uploaded file
Unix timestamp of the origin event
Name of the browser
Version of the browser
Domain where the download occurred
URL of the browser tab
Title of the browser tab
Unix timestamp when the download started
Unix timestamp when the download ended
Type of content copied to clipboard
Name of the browser
Version of the browser
Domain of the browser
URL of the browser tab
Title of the browser tab
Cloud sync application
Type of account
Name of the account
Email associated with the account
Path where the file was synced
Unix timestamp when the upload started
Unix timestamp when the upload ended
Name of the synced file
Type of content in the clipboard
Unix timestamp of the origin event
Name of the browser
Version of the browser
Domain where the download occurred
URL of the browser tab
Title of the browser tab
Unix timestamp when the download started
Unix timestamp when the download ended
Type of content copied to clipboard
Name of the browser
Version of the browser
Domain of the browser
URL of the browser tab
Title of the browser tab
Name of the browser
Version of the browser
Domain of the browser
URL of the browser tab
Title of the browser tab
ID of the originating app
Name of the originating app
Whether this is a client sync event
Source IP address
Level of the session
Key of the session
Salesforce user ID
asset IDs associated with the event
Invalid request parameters
Authentication failure
Event does not exist
Rate Limit Exceeded or Daily Quota Exceeded
Internal Nightfall Error
The UUID of the exfiltration event
Number of activity items to fetch in one page
50Unix timestamp in seconds, filters activity created > the value
Unix timestamp in seconds, filters activity created < the value
Whether to sort results in descending order (default false)
falseCursor for getting the next page of results
Successful response
How many remaining requests you can make within the next second before being throttled
How many remaining requests you can make within the next quota period
When the current quota period expires
Unique identifier for the activity log entry
Human-readable message describing the activity
Unix timestamp in seconds when the activity occurred
Next page cursor, omitted if end of results reached
Invalid request parameters
Authentication failure
Event does not exist
Rate Limit Exceeded or Daily Quota Exceeded
Internal Nightfall Error
The ID of the asset to fetch activities for
Unix timestamp in seconds, filters activities created ≥ the value
Unix timestamp in seconds, filters activities created < the value
Cursor for getting the next page of results
Successful response
How many remaining requests you can make within the next second before being throttled
How many remaining requests you can make within the next quota period
When the current quota period expires
Type of the activity
Email of the user who performed the activity
Unix timestamp in seconds indicating when the activity occurred
Names of assets involved in the activity
Source of the download
Name of the downloaded file
Domain where the upload occurred
Name of the uploaded file
Cloud application used for synchronization
Name of the synchronized file
Domain related to the clipboard activity
Next page cursor, omitted if end of results reached
Invalid request parameters
Authentication failure
Rate Limit Exceeded or Daily Quota Exceeded
Internal Nightfall Error
The Nightfall ID of the actor to fetch activities for
Unix timestamp in seconds, filters activities created ≥ the value
Unix timestamp in seconds, filters activities created < the value
Cursor for getting the next page of results
Successful response
How many remaining requests you can make within the next second before being throttled
How many remaining requests you can make within the next quota period
When the current quota period expires
Type of the activity
Email of the user who performed the activity
Unix timestamp in seconds indicating when the activity occurred
Names of assets involved in the activity
Source of the download
Name of the downloaded file
Domain where the upload occurred
Name of the uploaded file
Cloud application used for synchronization
Name of the synchronized file
Domain related to the clipboard activity
Next page cursor, omitted if end of results reached
Invalid request parameters
Authentication failure
Rate Limit Exceeded or Daily Quota Exceeded
Internal Nightfall Error
{
"events": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"integration": "text",
"createdAt": 1,
"state": "text",
"eventType": "text",
"policyUUIDs": [
"123e4567-e89b-12d3-a456-426614174000"
],
"assetsCount": 1,
"userInfo": {
"username": "text",
"userEmail": "[email protected]",
"userProfileLink": "https://example.com",
"deviceId": "text",
"machineName": "text",
"isExternal": true
},
"appInfo": {
"id": "text",
"name": "text"
}
}
],
"nextPageToken": "text"
}{
"events": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"integration": "text",
"createdAt": 1,
"state": "text",
"eventType": "text",
"policyUUIDs": [
"123e4567-e89b-12d3-a456-426614174000"
],
"assetsCount": 1,
"userInfo": {
"username": "text",
"userEmail": "[email protected]",
"userProfileLink": "https://example.com",
"deviceId": "text",
"machineName": "text",
"isExternal": true
},
"appInfo": {
"id": "text",
"name": "text"
}
}
],
"nextPageToken": "text"
}{
"activities": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"message": "text",
"timestamp": 1,
"type": "CREATION",
"data": {
"action": "ACKNOWLEDGE",
"userUUID": "123e4567-e89b-12d3-a456-426614174000",
"userName": "text",
"userEmail": "text",
"receiverEmail": "text",
"actionLogData": {
"applyLabelsActionLogData": {
"activityType": "LABELS_SUCCESSFULLY_APPLIED",
"labels": [
"text"
],
"labelUpdatesOnResource": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"failureReason": "text"
},
"setExpirationActionLogData": {
"expirationTime": 1
},
"revokeAccessActionLogData": {
"revokedEmails": [
"text"
],
"unRevokedEmails": [
"text"
]
},
"notifyEmailActionLogData": {
"receiverEmail": "text"
},
"genericActionLogData": {
"additionalContext": "text"
}
}
}
}
],
"nextPageToken": "text"
}{
"activities": [
{
"type": "DOWNLOAD",
"userEmail": "[email protected]",
"eventTime": 1,
"assetNames": [
"text"
],
"metadata": {
"downloadEventMetadata": {
"source": "text",
"fileName": "text"
},
"browserUploadMetadata": {
"domain": "text",
"fileName": "text"
},
"cloudSyncMetadata": {
"cloudApp": "text",
"fileName": "text"
},
"clipboardMetadata": {
"browserMetadata": {
"domain": "text"
}
}
}
}
],
"nextPageToken": "text"
}{
"activities": [
{
"type": "DOWNLOAD",
"userEmail": "[email protected]",
"eventTime": 1,
"assetNames": [
"text"
],
"metadata": {
"downloadEventMetadata": {
"source": "text",
"fileName": "text"
},
"browserUploadMetadata": {
"domain": "text",
"fileName": "text"
},
"cloudSyncMetadata": {
"cloudApp": "text",
"fileName": "text"
},
"clipboardMetadata": {
"browserMetadata": {
"domain": "text"
}
}
}
}
],
"nextPageToken": "text"
}GET /exfiltration/v1/events HTTP/1.1
Host: api.nightfall.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
GET /exfiltration/v1/events/{eventId} HTTP/1.1
Host: api.nightfall.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"assets": [
{
"id": "text",
"name": "text",
"path": "text",
"sizeBytes": 1,
"mimetype": "text",
"owner": {
"id": "text",
"email": "[email protected]",
"comment": "text",
"metadata": {
"gdrive": {
"userBelongsToGroups": [
"text"
],
"isAdmin": true,
"isSuspended": true,
"createdAt": 1
},
"salesforce": {},
"endpointAgent": {
"deviceID": "text",
"machineName": "text"
}
}
},
"comment": "text",
"ddrViolationIDs": [
"123e4567-e89b-12d3-a456-426614174000"
],
"metadata": {
"gdrive": {
"fileID": "text",
"fileName": "text",
"fileSize": "text",
"fileLink": "text",
"permissionSetting": "text",
"sharingExternalUsers": [
"text"
],
"sharingInternalUsers": [
"text"
],
"canViewersDownload": true,
"fileOwner": "text",
"isInTrash": true,
"createdAt": 1,
"updatedAt": 1,
"drive": "text",
"labels": [
"text"
],
"filePermissionType": "text"
},
"salesforce": {
"resourceType": "text",
"fileResourceMetadata": {
"fileAction": "text",
"sourceIP": "text",
"sessionLevel": "text"
},
"reportResourceMetadata": {
"description": "text",
"displayEntityFields": [
"text"
],
"dashboardName": "text",
"scope": "text",
"operation": "text",
"recordCount": 1,
"queriedEntities": [
"text"
],
"groupedColumnHeaders": [
"text"
],
"columnCount": 1,
"processedRowCount": 1,
"sourceIP": "text",
"eventSource": "text",
"sessionLevel": "text"
},
"bulkApiResourceMetadata": {
"query": "text",
"eventIdentifier": "text",
"sourceIP": "text",
"sessionKey": "text",
"sessionLevel": "text"
}
},
"endpointAgent": {
"medium": "EXFIL_MEDIUM_USB",
"mediumName": "text",
"user": "text"
}
}
}
],
"actor": {
"id": "text",
"email": "[email protected]",
"comment": "text",
"metadata": {
"gdrive": {
"userBelongsToGroups": [
"text"
],
"isAdmin": true,
"isSuspended": true,
"createdAt": 1
},
"salesforce": {},
"endpointAgent": {
"deviceID": "text",
"machineName": "text"
}
}
},
"events": [
{
"type": "DOWNLOAD",
"timestamp": 1,
"metadata": {
"endpointAgent": {
"endpointBrowserUploadMetadata": {
"browserName": "text",
"browserVersion": "text",
"domain": "text",
"browserTabURL": "text",
"browserTabTitle": "text",
"uploadStartTime": 1,
"uploadEndTime": 1,
"fileName": "text",
"originMetadata": [
{
"timestamp": 1,
"browserDownloadMetadata": {
"browserName": "text",
"browserVersion": "text",
"domain": "text",
"browserTabURL": "text",
"browserTabTitle": "text",
"downloadStartTime": 1,
"downloadEndTime": 1
},
"clipboardCopyMetadata": {
"contentType": "CCT_TEXT",
"browserMetadata": {
"browserName": "text",
"browserVersion": "text",
"domain": "text",
"browserTabURL": "text",
"browserTabTitle": "text"
}
}
}
]
},
"endpointCloudSyncMetadata": {
"app": "text",
"accountType": "text",
"accountName": "text",
"email": "text",
"destinationFilePath": "text",
"uploadStartTime": 1,
"uploadEndTime": 1,
"fileName": "text"
},
"endpointClipboardMetadata": {
"contentType": "text",
"originMetadata": [
{
"timestamp": 1,
"browserDownloadMetadata": {
"browserName": "text",
"browserVersion": "text",
"domain": "text",
"browserTabURL": "text",
"browserTabTitle": "text",
"downloadStartTime": 1,
"downloadEndTime": 1
},
"clipboardCopyMetadata": {
"contentType": "CCT_TEXT",
"browserMetadata": {
"browserName": "text",
"browserVersion": "text",
"domain": "text",
"browserTabURL": "text",
"browserTabTitle": "text"
}
}
}
],
"destinationMetadata": {
"browserMetadata": {
"browserName": "text",
"browserVersion": "text",
"domain": "text",
"browserTabURL": "text",
"browserTabTitle": "text"
}
}
}
},
"gdrive": {
"originatingAppId": "text",
"originatingAppName": "text",
"isClientSyncEvent": true
},
"salesforce": {
"sourceIP": "text",
"sessionLevel": "text",
"sessionKey": "text",
"sfUserId": "text"
}
},
"assetIDs": [
"text"
]
}
]
}GET /exfiltration/v1/events/{eventId}/activity HTTP/1.1
Host: api.nightfall.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
GET /exfiltration/v1/asset/activity?assetID=text&rangeStart=1&rangeEnd=1 HTTP/1.1
Host: api.nightfall.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
GET /exfiltration/v1/actor/activity?actorID=text&rangeStart=1&rangeEnd=1 HTTP/1.1
Host: api.nightfall.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
GET /exfiltration/v1/events/search?query=text HTTP/1.1
Host: api.nightfall.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*