This is a DLP detection rule template that you can implement easily in the Nightfall platform.
Description: | Detects personally identifiable information (PII) related to Canadian identification numbers. |
---|---|
Logical operator: | ANY i.e. This rule will evaluate to TRUE if any of the Detectors meet their criteria below. |
Detector | Minimum Confidence | Minimum Number of Findings | Scope |
---|---|---|---|
Canada BC PHN | VERY_LIKELY | 1 | content |
Canada Driver's License Number | VERY_LIKELY | 1 | content |
Canada Government ID | VERY_LIKELY | 1 | content |
Canada OHIP | VERY_LIKELY | 1 | content |
Canada Passport | VERY_LIKELY | 1 | content |
Canada Permanent Resident Number | VERY_LIKELY | 1 | content |
Canada Quebec HIN | VERY_LIKELY | 1 | content |
Canada Social Insurance Number | VERY_LIKELY | 1 | content |
curl --request POST \
--url https://api.nightfall.ai/v3/scan \
--header 'Accept: application/json' \
--header 'Authorization: Bearer REPLACE-WITH-YOUR-KEY' \
--header 'Content-Type: application/json' \
--data '
{
"policy": {
"detectionRules": [
{
"detectors": [
{
"minNumFindings": 1,
"minConfidence": "VERY_LIKELY",
"displayName": "Canada BC PHN",
"detectorType": "NIGHTFALL_DETECTOR",
"nightfallDetector": "CANADA_BC_PHN"
}, {
"minNumFindings": 1,
"minConfidence": "VERY_LIKELY",
"displayName": "Canada Driver's License Number",
"detectorType": "NIGHTFALL_DETECTOR",
"nightfallDetector": "CANADA_DRIVERS_LICENSE_NUMBER"
}, {
"minNumFindings": 1,
"minConfidence": "VERY_LIKELY",
"displayName": "Canada Government ID",
"detectorType": "NIGHTFALL_DETECTOR",
"nightfallDetector": "CANADA_GOVERNMENT_ID"
}, {
"minNumFindings": 1,
"minConfidence": "VERY_LIKELY",
"displayName": "Canada OHIP",
"detectorType": "NIGHTFALL_DETECTOR",
"nightfallDetector": "CANADA_OHIP"
}, {
"minNumFindings": 1,
"minConfidence": "VERY_LIKELY",
"displayName": "Canada Passport",
"detectorType": "NIGHTFALL_DETECTOR",
"nightfallDetector": "CANADA_PASSPORT"
}, {
"minNumFindings": 1,
"minConfidence": "VERY_LIKELY",
"displayName": "Canada Permanent Resident Number",
"detectorType": "NIGHTFALL_DETECTOR",
"nightfallDetector": "CANADA_PERMANENT_RESIDENT_NUMBER"
}, {
"minNumFindings": 1,
"minConfidence": "VERY_LIKELY",
"displayName": "Canada Quebec HIN",
"detectorType": "NIGHTFALL_DETECTOR",
"nightfallDetector": "CANADA_QUEBEC_HIN"
}, {
"minNumFindings": 1,
"minConfidence": "VERY_LIKELY",
"displayName": "Canada Social Insurance Number",
"detectorType": "NIGHTFALL_DETECTOR",
"nightfallDetector": "CANADA_SOCIAL_INSURANCE_NUMBER"
}
],
"name": "My Inline Detection Rule",
"logicalOp": "ANY"
}
]
},
"payload": [
"INSERT 1+ PAYLOAD(S)",
"INSERT 1+ PAYLOAD(S)"
]
}
'
import requests
import json
api_key = "REPLACE-WITH-YOUR-KEY"
url = "https://api.nightfall.ai/v3/scan"
headers = {
"Accept": "application/json",
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json"
}
payload = {
"policy": {
"detectionRules": [
{
"detectors": [
{
"minNumFindings": 1,
"minConfidence": "VERY_LIKELY",
"displayName": "Canada BC PHN",
"detectorType": "NIGHTFALL_DETECTOR",
"nightfallDetector": "CANADA_BC_PHN"
},
{
"minNumFindings": 1,
"minConfidence": "VERY_LIKELY",
"displayName": "Canada Driver's License Number",
"detectorType": "NIGHTFALL_DETECTOR",
"nightfallDetector": "CANADA_DRIVERS_LICENSE_NUMBER"
},
{
"minNumFindings": 1,
"minConfidence": "VERY_LIKELY",
"displayName": "Canada Government ID",
"detectorType": "NIGHTFALL_DETECTOR",
"nightfallDetector": "CANADA_GOVERNMENT_ID"
},
{
"minNumFindings": 1,
"minConfidence": "VERY_LIKELY",
"displayName": "Canada OHIP",
"detectorType": "NIGHTFALL_DETECTOR",
"nightfallDetector": "CANADA_OHIP"
},
{
"minNumFindings": 1,
"minConfidence": "VERY_LIKELY",
"displayName": "Canada Passport",
"detectorType": "NIGHTFALL_DETECTOR",
"nightfallDetector": "CANADA_PASSPORT"
},
{
"minNumFindings": 1,
"minConfidence": "VERY_LIKELY",
"displayName": "Canada Permanent Resident Number",
"detectorType": "NIGHTFALL_DETECTOR",
"nightfallDetector": "CANADA_PERMANENT_RESIDENT_NUMBER"
},
{
"minNumFindings": 1,
"minConfidence": "VERY_LIKELY",
"displayName": "Canada Quebec HIN",
"detectorType": "NIGHTFALL_DETECTOR",
"nightfallDetector": "CANADA_QUEBEC_HIN"
},
{
"minNumFindings": 1,
"minConfidence": "VERY_LIKELY",
"displayName": "Canada Social Insurance Number",
"detectorType": "NIGHTFALL_DETECTOR",
"nightfallDetector": "CANADA_SOCIAL_INSURANCE_NUMBER"
}
],
"name": "My Inline Detection Rule",
"logicalOp": "ANY"
}
]
},
"payload": [
"INSERT 1+ PAYLOAD(S)",
"INSERT 1+ PAYLOAD(S)"
]
}
response = requests.post(url, headers=headers, data=json.dumps(payload))
print(response.status_code)
print(response.json())
Input any text to validate or test. The default minimum confidence is set to "Possible".