Remediate a finding
Starts a Remediation run for a finding, as Remediate in Hacktron does. A Hacktron agent writes a fix. Your organisation’s Remediation pull requests setting decides whether it opens a pull or merge request or keeps the fix in Hacktron. With Ask every time, runs started through the API open a pull request. Use the finding’s UUID or display id. You need the member role or above.
Only one run per finding goes at a time. started is false when Hacktron returns the finding’s latest run instead of starting another: one in progress, one with an open fix pull request, one with a fix ready in Hacktron, or one that ended without a fix. A new run starts only when the finding has none, or its latest failed or had its pull request closed.
The run is charged to the organisation’s automation credits. When the organisation has run out, the API returns 403 Forbidden. Check the balance with GET /credits/automation.
Follow the run with GET /findings/{id}/remediation until pr_url is set or status is fix_ready or another final state.
Request
POST /findings/{id}/remediate
Send an API key with the write scope in the X-Api-Key header.
Path parameters
| Parameter | Description |
|---|---|
idstring, required | Finding UUID or display id (KEY-FD-NUMBER, e.g. HAC-FD-1104). |
Responses
201 Created
| Field | Description |
|---|---|
idstring (uuid), required | Run id. |
finding_uuidstring (uuid), required | Finding the run fixes. |
statusstring, required | dispatched while the fix is generated; pr_created when its pull request is open; fix_ready when the fix is ready in Hacktron without a pull request; no_fix, false_positive, failed, or stopped_cap_exceeded when the run ends without a fix; pr_closed when the finding was fixed some other way. |
pr_urlstring, required, nullable | The fix pull request, once it is open. |
failure_reasonstring, required, nullable | Why the run failed or found no fix. |
created_atstring, required | When the run started. |
urlstring, required | The run in Hacktron. |
startedboolean, required | False when the finding’s latest run is returned instead of starting another: one in progress, one with an open fix pull request, one with a fix ready in Hacktron, or one that ended without a fix (no_fix, false_positive, stopped_cap_exceeded). A new run starts only when the finding has none or its latest failed or had its pull request closed. |