- Created by Kyle Pippin (Unlicensed), last modified by Andrew Swint (Unlicensed) on Apr 13, 2020
You are viewing an old version of this page. View the current version.
Compare with Current View Page History
« Previous Version 9 Next »
/rest/{version}/policies/{policyId}
Descriptor | Value |
---|---|
HTTP Method | GET |
Description | Get details for a single policy |
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 the Application Metadata to the response. Only if using v2.7.5 or later. Also added "testEnviroement", "releaseFrequency", and "isInternal" to the REST call response. |
Request Header Parameters
Parameter | Value | Required | Description |
---|---|---|---|
Accept | String | Yes | A value of ‘application/json’ must be provided. |
Sample Call:
curl --insecure -H 'Accept: application/json' -H "Authorization: APIKEY {apiKey}" http://localhost:8080/threadfix/rest/latest/policies/1
Sample Output:
{ "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 }, "emailLists": [ { "id": 1, "name": "Sample Email List", "emailAddresses": [ "email1@testemail.com", "email2@testemail.com" ] } ], "emailAddresses": [ "email3@testemail.com" ], "sendEmail": false, "applications": [ { "id": 1, "name": "Passing App", "url": null, "applicationCriticality": { "id": 2, "name": "Medium" }, "policyStatuses": [ { "id": 1, "currentStatus": "FAILING", "emailLists": [], "emailAddresses": [], "sendEmail": false, "statusLastChanged": 15672839461538, "addedManually": true, "addedByTeam": false, "addedByTag": false, "name": "example", "lastEvaluated": 1859364956284, "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": "denim group", "id": 1 } } ] } }
- No labels