List locations of a secret incident
List the files that still hold the secret of an incident, on the default branch of each source of your perimeter.
One location is one file of one source. It carries the position of every match of the secret in that file, so that you can point a developer at the exact lines to change. A location disappears once the secret is removed from the file. Locations are only computed for VCS sources.
Path parameters
The id of the incident to retrieve
Query parameters
Pagination cursor.
Number of items to list per page.
Locations of the following source ids.
When true, only return the locations held by sources that GitGuardian currently monitors, that is sources that are not unmonitored, archived nor deleted, and that are not installed through a revoked installation. When false, only return the locations held by the other sources.
Locations mentioning the secret at least this number of times.
Locations mentioning the secret at most this number of times.
Locations whose code fix request has the following status. Use none to filter locations without any code fix request.
Locations whose filepath contains this value.
Sort the results by their field value. The default sort is ASC, DESC if the field is preceded by a '-'.
Response
Secret Incident Location List
Example response
[
{
"id": 4421,
"incident_id": 3759,
"filepath": "config/settings.py",
"matches": [
{
"name": "apikey",
"line_start": 12,
"line_end": 12,
"index_start": 320,
"index_end": 352
}
],
"number_of_mentions": 2,
"last_updated_at": "2021-05-20T12:40:55.662949Z",
"source": {
"id": 6531,
"type": "github",
"full_name": "gitguardian/gg-shield",
"default_branch": "main",
"visibility": "private"
},
"remediation_prs": [
{
"created_at": "2021-05-20T12:40:55.662949Z",
"url": "https://github.com/GitGuardian/ggshield/pull/123",
"branch_name": "gitguardian/remove-secret",
"target_branch_name": "main",
"status": "OPEN",
"title": "Remove hardcoded GitGuardian token",
"description": "Replaces the hardcoded token with an environment variable.",
"last_actor_name": "Eric",
"external_id": "123"
}
],
"branch_name": "main",
"external_url": "https://github.com/GitGuardian/ggshield/blob/main/config/settings.py",
"external_url_matches_highlighted": "https://github.com/GitGuardian/ggshield/blob/main/config/settings.py#L12"
}
]