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.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

/rest/{version}/applications/{appId}/policy/eval?policyId={policyId}


Descriptor

Value

HTTP Method

GET

Description

Gets the status of a policy even if the policy is not attached to the application.

Required Permission

Read Access (Any Role)

Version Introduced2.6
Changes in 2.8Added additional request parameter "type".


Request Header Parameters

Parameter

Value

Required

Description

Accept

String

Yes

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


Request GET Parameters

Parameter

Value

Required

Description

policyId

String

No*

Evaluate the status of the policy with this id.

policyNameStringNo*

Evaluate the status of the policy with this name. Parameter "type" is needed when using policyName.

typeStringNo*

The type of the policy being evaluated. Accepted values are "filter" or "remediation".

*Required when using parameter policyName.

*Either 'policyId' or 'policyName' parameter must be provided.


Sample Call (using policyId):

curl -X GET 'http://localhost:8080/threadfix/rest/Latest/applications/1/policy/eval?policyId=1' -H 'Authorization: APIKEY {apiKey}'

Sample Call (using policyName):

curl -X GET 'http://localhost:8080/threadfix/rest/Latest/applications/1/policy/eval?policyName=TTR-Policy-1&type=remediation' -H 'Authorization: APIKEY {apiKey}'


Sample Output:

Sample return for application having a scan.

{
    "message": "",
    "success": true,
    "responseCode": -1,
    "object": {
        "id": null,
        "currentStatus": "FAILING",
        "statusLastChanged": null,
        "name": "ThreadFix Scan",
        "lastEvaluated": 1524505539031,
        "policy": {
            "name": "Low Policy",
            "filterName": "Low Filter",
            "id": 3
        }
    }
}

Sample return for an application with no scan.

{
    "message": "",
    "success": true,
    "responseCode": -1,
    "object": {
        "id": null,
        "currentStatus": "NO SCANS FOUND",
        "statusLastChanged": null,
        "name": "ThreadFix No Scan",
        "lastEvaluated": 1524505897127,
        "policy": {
            "name": "Low Policy",
            "filterName": "Low Filter",
            "id": 3
        }
    }
}



  • No labels