Scan Methods
Scan content and create incidents
Scan provided content for hardcoded secrets and create incidents that will be reflected on the GitGuardian dashboard.
⚠️ Beta Version: This endpoint is in beta and may be subject to changes in future releases.
This endpoint will:
- Scan the provided content for hardcoded secrets
- Create incidents for any detected secrets
- Store the incidents in the GitGuardian dashboard for tracking and management
- Return the scan results
Request body shouldn't exceed 1MB.
post/v1/scan/create-incidents
Request body
Example request
{
"source_uuid": "550e8400-e29b-41d4-a716-446655440000",
"documents": [
{
"filename": "document.txt",
"location": {
"url": "https://wiki.example.com/my-config-page"
}
}
]
}Response
Successful Scan and Incident Creation
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
}