Show Details of a Centralized Policy

Shows details of a policy.

GET/csapi/v1.3/centralizedPolicy/{policyId}

Input ParametersInput Parameters

Parameter Mandatory/Optional Data Type Description
policyId Mandatory string Specify the UUID of the policy of which you want to fetch details.
policyType Mandatory string  Mention the type of policy.  

Example: CICD, K8S Admission Controller

centralizedPolicyRules:
         name
Mandatory string Specify the name of the policy rule
  • Block known compliance using Controls
  • Limit Compliance using Criticality
centralizedPolicyRules:
         type
Mandatory string Specify the type of policy rule
  • IMAGESCAN_VULN_RESTRICTED_CIDS
  • IMAGESCAN_VULN_CONTROL_CRITICALITYCOUNT

Sample: Fetch Details of a PolicySample: Fetch Details of a Policy

API Request

curl -X "GET"
"<qualys_base_url>/csapi/v1.3/centralizedPolicy/7a64bbd7-67a8-4c39-981e-6345c62bacb2?version=2"
-H "accept: application/json"
-H "Authorization: Bearer <Token>"

Response

{
    "uuid": "7a64bbd7-67a8-4c39-981e-6345c62bacb2",
    "policyName": "Policy123",
    "policyType": "CICD",
    "policyMode": "ACTIVE",
    "description": "Policy123",
    "createdBy": "user1",
    "created": "1683537516989",
    "updatedBy": "user1",
    "updated": "1683537516989",
    "centralizedPolicyRules": [
        {
            "name": "Rule123",
            "type": "IMAGESCAN_VULN_SEVERITYCOUNT",
            "action": "DENY",
            "isEnabled": true,
            "stopProcessing": false,
            "sortOrder": 0,
            "metaData": "{\"operator\":\"GREATER_THAN\",\"severityLevel\":1,\"threshold\":1}"
        }
    ],
    "version": 2,
    "assetType": "CICD",
    "isDefault": false,
    "tagIds": [
        {
            "uuid": "cf203e51-490f-47d4-b271-bdc4822f6181",
            "id": 7624640,
            "name": "Tag-101",
            "backgroundColor": "#B6D7A8",
            "foregroundColor": "#000000",
            "icon": null,
            "criticalityScore": 0,
            "tagType": null
        },
        {
            "uuid": "383318ae-3e32-420a-a3dc-4deaab5ee283",
            "id": 7624639,
            "name": "Tag-10",
            "backgroundColor": "#F9CB9C",
            "foregroundColor": "#000000",
            "icon": null,
            "criticalityScore": 0,
            "tagType": null
        }
    ]
}

Sample: Fetch Details of a CICD Policy using Compliance RulesSample: Fetch Details of a CICD Policy using Compliance Rules

API Request

curl -X 'GET' \
  '<qualys_base_url>/csapi/v1.3/centralizedPolicy/f0c6ebef-1246-4d61-be1b-0c11075aaebb' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer <token>' 

API Response 
 

{
  "uuid": "f0c6ebef-1246-4d61-be1b-0c11075aaebb",
  "policyName": "Test-Compliance related rules",
  "policyType": "CICD",
  "policyMode": "ACTIVE",
  "description": "test Policy",
  "createdBy": "john_doe",
  "created": "1769684140646",
  "updatedBy": "john_doe",
  "updated": "1769685855150",
  "centralizedPolicyRules": [
    {
      "name": "Block known compliance using Controls",
      "type": "IMAGESCAN_VULN_RESTRICTED_CIDS",
      "isEnabled": true,
      "stopProcessing": false,
      "order": 0,
      "kind": "IMAGE_SECURITY",
      "metaData": {
        "values": [
          10826,
          19378,
          19386,
          19388,
          19511
        ]
      },
      "action": "FAIL"
    },
    {
      "name": "Limit Compliance using Criticality",
      "type": "IMAGESCAN_VULN_CONTROL_CRITICALITYCOUNT",
      "isEnabled": true,
      "stopProcessing": false,
      "order": 0,
      "kind": "IMAGE_SECURITY",
      "metaData": {
        "value": "MEDIUM",
        "operator": "GREATER_THAN",
        "threshold": 1
      },
      "action": "FAIL"
    }
  ],
  "exclusionPolicyRules": [
    {
      "isEnabled": true,
      "order": 0,
      "sortOrder": 0,
      "stopProcessing": false,
      "kind": "EXCLUSION",
      "action": "FAIL",
      "metaData": {
        "values": [
          19386,
          19378
        ]
      },
      "name": "Exclude CIDs",
      "type": "EX_IMAGESCAN_VULN_CIDS"
    }
  ],
  "version": 4,
  "isDefault": false,
  "tagIds": [
    "b3b02b72-c74c-4b5a-82a5-12c52b0a7d86",
    "5d877004-14df-490b-b522-89cc51a1e1e6",
    "2f5afc01-8148-4576-b39c-22232ae85632"
  ],
  "k8sFilters": null
} 

Sample: Fetch a K8S Admission Controller Policy Compliance RulesSample: Fetch a K8S Admission Controller Policy Compliance Rules

API Request

curl -X 'GET' \
  '<qualys_base_url>/csapi/v1.3/centralizedPolicy/f18f35a9-3362-490f-87e6-bc33814dd056' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer <token>'

API Response 
 

{
  "uuid": "f18f35a9-3362-490f-87e6-bc33814dd056",
  "policyName": "TEST2",
  "policyType": "K8S_ADMISSION_CONTROLLER",
  "policyMode": "ACTIVE",
  "policyBehavior": "BLOCK",
  "description": "",
  "createdBy": "john_doe",
  "created": "1776228725396",
  "updatedBy": "john_doe",
  "updated": "1776228725396",
  "centralizedPolicyRules": [
    {
      "name": "rule2",
      "type": "IMAGESCAN_VULN_RESTRICTED_CIDS",
      "action": "FAIL",
      "isEnabled": true,
      "stopProcessing": false,
      "sortOrder": 0,
      "metaData": "{\"values\":[10826,19388,19511]}",
      "kind": "IMAGE_SECURITY"
    },
    {
      "name": "rule1",
      "type": "IMAGESCAN_VULN_CONTROL_CRITICALITYCOUNT",
      "action": "FAIL",
      "isEnabled": true,
      "stopProcessing": false,
      "sortOrder": 0,
      "metaData": "{\"operator\":\"GREATER_THAN\",\"threshold\":1,\"value\":\"MEDIUM\"}",
      "kind": "IMAGE_SECURITY"
    }
  ],
  "exclusionPolicyRules": [],
  "version": 1,
  "isDefault": false,
  "tagIds": null,
  "excludedTagIds": null,
  "k8sFilters": [
    {
      "cluster": {
        "clusterUid": "957e3031-c6d1-4a00-9c7e-6406e1bc3bcb",
        "clusterName": "surtest-ekstest"
      },
      "namespace": null,
      "deployment": null
    }
  ],
  "excludedK8sFilters": null
}