As we reach the end of September 2024, ThreadFix version 3.x on-premises has officially reached its End-of-Life. Therefore, there is no longer support or updates for this version of the product. We have fully transitioned our product and development teams to focus ThreadFix SaaS and migrating all customers over from the on-premises versions. Our Customer Success and Support teams are here to help you in migrating to ThreadFix SaaS and maximizing the value you see from this improved offering from Coalfire. This is the next phase of ThreadFix and our team is looking forward to continuing to support you on this journey.
Complete Task 3.0 - API
/rest/{version}/tasks/completeTask
Descriptor | Value |
---|---|
HTTP Method | POST |
Description | Marks a task as completed and uploads the scan file to the task’s application. |
Required Permission | Manage Scan Agents |
Version Introduced | 2.4.0 |
Request Header Parameters
Parameter | Value | Required | Description |
---|---|---|---|
Accept | String | Yes | A value of ‘application/json’ must be provided. |
Request POST Data Parameters
Parameter | Value | Required | Description |
---|---|---|---|
scanQueueTaskId | Integer | Yes | ID for the Scan Agent Task to mark as complete. |
file | File | Yes | The File to upload to ThreadFix |
scanAgentSecureKey | String | Yes | A Secure Scan Agent Key obtained from the “Request Scan Agent Key” call. Must be the same one used to assign the Task from the queue. |
secureTaskKey | String | Yes | The Secure Task Key that was returned when the Task was assigned from the queue. |
Sample Call:
curl --insecure -H 'Accept: application/json' -H "Authorization: APIKEY {apiKey}" -X POST -F 'scanQueueTaskId=1' -F 'scanAgentSecureKey=yMFCvtcmBtAARYS5QX8x54zvMruNLIvNMzqMI44K4JG8' -F 'secureTaskKey=KVS1TiifaYeILnchqbdmU24JEyljgNy0NTOgvSLzS3Y' -F 'file=@C:/path/to/scanResults.xml' http://localhost:8080/threadfix/rest/latest/tasks/completeTask
Sample Output:
Values for createTime, startTime, endTime, timeoutTime, and uploadedDate are returned as Epoch time in milliseconds.
{
"message": "",
"success": true,
"responseCode": -1,
"object": {
"id": 1,
"active": true,
"scanStatuses": [
{
"id": 1,
"active": true,
"message": "Scan queued at: 28-09-16:15:25:893 -0500"
},
{
"id": 2,
"active": true,
"message": "Assigning task to an agent with agentConfig:\nC:\\ThreadFix\\scanagent\\scanagent.properties"
},
{
"id": 4,
"active": true,
"message": "This task is still in progress"
},
{
"id": 5,
"active": true,
"message": "This task is still in progress"
},
{
"id": 6,
"active": true,
"message": "Scan completed successfully at: 28-09-16:16:40:957 -0500"
}
],
"scanner": "Burp Suite Pro",
"version": null,
"createTime": 1475094356000,
"startTime": 1475094996000,
"endTime": 1475098826957,
"timeoutTime": 1475137556000,
"status": 3,
"scanAgentInfo": null,
"secureKey": "KVS1TiifaYeILnchqbdmU24JEyljgNy0NTOgvSLzS3Y",
"scanAgentInstanceSecureKey": "yMFCvtcmBtAARYS5QX8x54zvMruNLIvNMzqMI44K4JG8",
"scanConfig": {
"id": 1,
"active": true,
"name": "burp",
"type": "scanagtcfg",
"contentType": "application/octet-stream",
"uploadedDate": 1475094354000
},
"targetUrl": "http://targeturl/app",
"taskStatus": "STATUS_COMPLETE_SUCCESSFUL",
"scannerShortName": "burp",
"statusString": "COMPLETE_SUCCESSFUL"
}
}
www.threadfix.it | www.coalfire.com
Copyright © 2024 Coalfire. All rights reserved.
This Information Security Policy is CoalFire - Public: Distribution of this material is not limited.