As of December 31st, 2023 ThreadFix 2.X has reached End of Life and is no longer supported. For any further information please contact the Success and Implementation team.

Get All Policies - API

/rest/{version}/policies

Descriptor

Value

HTTP Method

GET

Description

Get a list of all policies in ThreadFix.

Required Permission

Manage Policies

Version Introduced

2.4.0

Changes in 2.4.1

Added the statusLastChanged and lastEvaluated fields to the response.  These fields are also now in the older versions of the call.

Changes in 2.5.1.12

Changed the "passing" field to "currentStatus".  The values are "PASSING", "FAILING", and "NO SCANS FOUND".

Changes in 2.6

Added the "addedManually", "addedByTeam", and "addedByTag" to the response. 

Changes in 2.7.5

Added "testEnvironment", "releaseFrequency", and "isInternal" to the REST call response.

Changes in 2.8

Added "timeToRemediateCriteria" to the REST call response, and added "type" parameter.

Request Header Parameters

Parameter

Value

Required

Description

Accept

String

Yes

A value of ‘application/json’ must be provided.

GET Parameters

Parameter

Value

Required

Description

type

String

No

Types of Policies to return.  Leave out or provide "all" to see all policies, provide "filter" to see policies that evaluate on filter criteria, or provide "remediation" to see Time to Remediate policies.

Sample Call:

curl --insecure -H 'Accept: application/json' -H "Authorization: APIKEY {apiKey}" http://localhost:8080/threadfix/rest/latest/policies?type=all

Sample Output:

Values for statusLastChanged and lastEvaluated are returned as Epoch time in milliseconds.

{     "message": "",     "success": true,     "responseCode": -1,     "object": [         {             "id": 1,             "name": "Critical Policy",             "policyStatuses": [                 {                     "id": 2,                     "currentStatus": "PASSING",                     "emailLists": [],                     "emailAddresses": [                         "email1@testemail.com",                         "email3@testemail.com"                     ],                     "sendEmail": false,                     "statusLastChanged": 1469133001000, "addedManually": true, "addedByTeam": false, "addedByTag": false,                     "name": "Passing App",                     "lastEvaluated": 1469133001000,                     "policy": {                         "name": "Critical Policy",                         "filterName": "Critical Filter",                         "id": 1                     },                     "application": {                         "name": "Passing App",                         "id": 1,                         "team": {                             "name": "Test Team",                             "id": 1                         }                     }                 },                 {                     "id": 1,                     "currentStatus": "FAILING",                     "emailLists": [                         {                             "id": 1,                             "name": "Sample Email List",                             "emailAddresses": [                                 "email1@testemail.com",                                 "email2@testemail.com"                             ]                         }                     ],                     "emailAddresses": [],                     "sendEmail": false,                     "statusLastChanged": null,                     "name": "Failing App",                     "lastEvaluated": 1469132998000,                     "policy": {                         "name": "Critical Policy",                         "filterName": "Critical Filter",                         "id": 1                     },                     "application": {                         "name": "Failing App",                         "id": 2,                         "team": {                             "name": "Test Team",                             "id": 1                         }                     }                 }             ],             "filterJsonBlob": {                 "id": 1,                 "json": "{\"scanners\":[],\"genericVulnerabilities\":[],\"severities\":{\"critical\":true},\"numberMerged\":null,\"path\":null,\"parameter\":null,\"numberVulnerabilities\":10,\"showOpen\":true,\"showClosed\":false,\"showFalsePositive\":false,\"showHidden\":false,\"showDefectPresent\":false,\"showDefectNotPresent\":false,\"showDefectOpen\":false,\"showDefectClosed\":false,\"showInconsistentClosedDefectNeedsScan\":false,\"showInconsistentClosedDefectOpenInScan\":false,\"showInconsistentOpenDefect\":false,\"daysOldModifier\":null,\"daysOld\":null,\"startDate\":null,\"endDate\":null,\"filterType\":{\"isVulnSearchFilter\":true},\"genericSeverities\":[{\"intValue\":5}],\"channelTypes\":[],\"usingComponentsWithKnownVulnerabilities\":false}",                 "name": "Critical Filter",                 "defaultTrending": false             }, "timeToRemediateCriteria": null,             "emailLists": [                 {                     "id": 1,                     "name": "Sample Email List",                     "emailAddresses": [                         "email1@testemail.com",                         "email2@testemail.com"                     ]                 }             ],             "emailAddresses": [                 "email3@testemail.com"             ],             "sendEmail": false,             "applications": [                 { "id": 1, "name": "Example", "url": null, "applicationCriticality": { "id": 2, "name": "Medium" }, "policyStatuses": [ { "id": 1, "currentStatus": "FAILING", "emailLists": [], "emailAddresses": [], "sendEmail": false, "statusLastChanged": 1849573918375, "addedManually": true, "addedByTeam": false, "addedByTag": false, "name": "Example", "lastEvaluated": 19467593748947, "application": { "name": "Example", "id": 1, "team": { "name": "Example", "id": 1 } }, "policy": { "name": "New Policy", "filterName": "Default", "id": 1 } } ], "description": null, "releaseFrequency": "UNKNOWN", "testEnvironment": null, "isInternal": false, "team": { "name": "Example", "id": 1 } }                 {                     "id": 2,                     "name": "Failing App",                     "url": null,                     "applicationCriticality": {                         "id": 2,                         "name": "Medium"                     },                     "team": {                         "name": "Team name",                         "id": 1                     }                 }             ]         }, { "id": 2, "name": "Test", "policyStatuses": [ { "id": 20, "currentStatus": "FAILING", "emailLists": [], "emailAddresses": [], "sendEmail": false, "statusLastChanged": 1587158441000, "addedManually": true, "addedByTeam": false, "addedByTag": false, "name": "7526", "lastEvaluated": 1587158474000, "policy": { "name": "Test", "filterName": null, "id": 2 }, "application": { "name": "7526", "id": 28, "team": { "name": "Test Team", "id": 1 } } } ], "filterJsonBlob": null, "timeToRemediateCriteria": { "id": 1, "criteriaMap": { "critical": 1 } }, "emailLists": [], "emailAddresses": [], "sendEmail": false, "tags": [], "applications": [ { "id": 28, "name": "7526", "url": null, "applicationCriticality": { "id": 2, "name": "Medium" }, "policyStatuses": [ { "id": 21, "currentStatus": "FAILING", "emailLists": [], "emailAddresses": [], "sendEmail": false, "statusLastChanged": 1587399731000, "addedManually": true, "addedByTeam": false, "addedByTag": false, "name": "7526", "lastEvaluated": 1587399731000, "policy": { "name": "Policy", "filterName": "Filter", "id": 1 }, "application": { "name": "7526", "id": 28, "team": { "name": "Test Team", "id": 1 } } }, { "id": 20, "currentStatus": "FAILING", "emailLists": [], "emailAddresses": [], "sendEmail": false, "statusLastChanged": 1587158441000, "addedManually": true, "addedByTeam": false, "addedByTag": false, "name": "7526", "lastEvaluated": 1587158474000, "policy": { "name": "Test", "filterName": null, "id": 2 }, "application": { "name": "7526", "id": 28, "team": { "name": "Test Team", "id": 1 } } } ], "description": null, "releaseFrequency": "UNKNOWN", "testEnvironment": null, "isInternal": false, "team": { "name": "Test Team", "id": 1 } } ], "teams": [] }     ] }



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.