Scan Methods
Content scan
Scan provided document content for policy breaks.
Request body shouldn't exceed 1MB.
This endpoint is stateless and as such will not store in our servers neither the documents nor the secrets found.
post/v1/scan
Request body
Example request
{
"filename": ".env",
"document": "\nimport urllib.request\nurl = 'http://jen_barber:correcthorsebatterystaple@cake.gitguardian.com/isreal.json'\nresponse = urllib.request.urlopen(url)\nconsume(response.read())\n"
}Response
Successful Scan
Example response
{
"policy_break_count": 2,
"policies": [
"Filename",
"File extensions",
"Secrets detection"
],
"policy_breaks": [
{
"type": ".env",
"policy": "Filenames",
"matches": [
{
"type": "filename",
"match": ".env"
}
]
},
{
"type": "Basic Auth String",
"policy": "Secrets detection",
"validity": "cannot_check",
"matches": [
{
"type": "username",
"match": "jen_barber",
"index_start": 52,
"index_end": 61,
"line_start": 2,
"line_end": 2
},
{
"type": "password",
"match": "correcthorsebatterystaple",
"index_start": 63,
"index_end": 87,
"line_start": 2,
"line_end": 2
},
{
"type": "host",
"match": "cake.gitguardian.com",
"index_start": 89,
"index_end": 108,
"line_start": 2,
"line_end": 2
}
]
}
],
"is_diff": true
}