Fetch Compliance Posture for an Image

Qualys Container Security supports image-compliance scanning. It allows you to evaluate and report compliance during image scans. 

GET/v1.3/images/{imageSha}/compliance

Input ParametersInput Parameters

Parameter

Mandatory/Optional

Data Type

Description

imageSha

Mandatory

string

Specify the SHA value of a specific image in the user’s scope.

controlId Optional integer Control ID values can be:
  1. 19388
  2. 19386
  3. 19378
criticality Optional string Criticality levels can be:
  1. LOW: MINIMAL
  2. MEDIUM: Combines MEDIUM and SERIOUS
  3. HIGH: Combines CRITICAL and URGENT

Sample: Fetch Compliance Posture for an ImageSample: Fetch Compliance Posture for an Image

API request

curl -X 'GET' \
'<qualys_base_url>/csapi/v1.3/images/2724e40d4303391e1a46884134da358e20a6d0b03f32ee6c412079ddb4ac6783/compliance' \
-H 'accept: application/json' \
-H 'Authorization: Bearer <token>'

Response

{
  "uuid": "9badf287-5629-33a0-8059-3673720ddd11",
  "sha": "1111e40d4303391e1a46884134da358e20a6d0b03f32ee6c412079ddb4ac1111",
  "customerUuid": "1162741d-fb3f-6d14-824e-762226d61411",
  "created": "1728035800000",
  "updated": "1773727409392",
  "controls": [
    {
      "controlId": 19388,
      "policyUuid": "e07da90a-dc32-48e0-9bbb-2eae68012333",
      "technologyId": 283,
      "criticality": "MEDIUM",
      "posture": "FAIL",
      "lastEvaluated": "1773727201621",
      "datapoints": [],
      "statement": null,
      "findings": [
        "USER not created"
      ]
    },
    {
      "controlId": 19386,
      "policyUuid": "e07da90a-dc32-48e0-9bbb-2eae68012333",
      "technologyId": 283,
      "criticality": "MEDIUM",
      "posture": "FAIL",
      "lastEvaluated": "1773727202110",
      "datapoints": [],
      "statement": null,
      "findings": [
        "update instruction found in layer #5",
        "update instruction found in layer #3",
        "update instruction found in layer #9"
      ]
    },
    {
      "controlId": 10826,
      "policyUuid": "e07da90a-dc32-48e0-9bbb-2eae68012333",
      "technologyId": 283,
      "criticality": "MEDIUM",
      "posture": "FAIL",
      "lastEvaluated": "1773727201866",
      "datapoints": [],
      "statement": null,
      "findings": [
        "HEALTHCHECK not configured"
      ]
    },
    {
      "controlId": 19511,
      "policyUuid": "e07da90a-dc32-48e0-9bbb-2eae68012333",
      "technologyId": 283,
      "criticality": "MEDIUM",
      "posture": "PASS",
      "lastEvaluated": "1773727202355",
      "datapoints": [],
      "statement": null,
      "findings": []
    },
    {
      "controlId": 19378,
      "policyUuid": "e07da90a-dc32-48e0-9bbb-2eae68012333",
      "technologyId": 283,
      "criticality": "HIGH",
      "posture": "PASS",
      "lastEvaluated": "1773727202600",
      "datapoints": [],
      "statement": null,
      "findings": []
    }
  ],
  "lastComplianceScanned": "1773727203912"
}

Error Response

The following error response is seen when the sub-users don't have permission to the specified image.

{
  "errorCode": "403 FORBIDDEN",
  "message": "Request Forbidden",
  "timestamp": 1700721586546
}