Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help


title: Clair Container Analyzer v1.2.0 language_tabs:

  • python: Python
  • go: Golang
  • javascript: Javascript language_clients:
  • python: ""
  • go: ""
  • javascript: "" toc_footers:
  • External documentation includes: [] search: false highlight_theme: darkula headingLevel: 2

Clair Container Analyzer v1.2.0

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

Clair is a set of cooperating microservices which can index and match a container image's content with known vulnerabilities.

Note: Any endpoints tagged "internal" are documented for completeness but are considered exempt from versioning.

Email: Clair Team Web: Clair Team License: Apache License 2.0

Authentication

  • HTTP Authentication, scheme: bearer Clair's authentication scheme.

This is a JWT signed with a configured pre-shared key containing an allowlisted iss claim.

indexer

Indexer service endpoints.

These are responsible for determining the contents of containers.

Index a Manifest

Code samples

import requests
headers = {
  'Content-Type': 'application/vnd.clair.manifest.v1+json',
  'Accept': 'application/vnd.clair.index_report.v1+json'
}

r = requests.post('/indexer/api/v1/index_report', headers = headers)

print(r.json())

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/vnd.clair.manifest.v1+json"},
        "Accept": []string{"application/vnd.clair.index_report.v1+json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "/indexer/api/v1/index_report", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

const inputBody = '{
  "hash": "sha256:fc84b5febd328eccaa913807716887b3eb5ed08bc22cc6933a9ebf82766725e3",
  "layers": [
    {
      "hash": "sha256:2f077db56abccc19f16f140f629ae98e904b4b7d563957a7fc319bd11b82ba36",
      "uri": "https://storage.example.com/blob/2f077db56abccc19f16f140f629ae98e904b4b7d563957a7fc319bd11b82ba36",
      "headers": {
        "Authoriztion": [
          "Bearer hunter2"
        ]
      }
    }
  ]
}';
const headers = {
  'Content-Type':'application/vnd.clair.manifest.v1+json',
  'Accept':'application/vnd.clair.index_report.v1+json'
};

fetch('/indexer/api/v1/index_report',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

POST /indexer/api/v1/index_report

By submitting a Manifest object to this endpoint Clair will fetch the layers, scan each layer's contents, and provide an index of discovered packages, repository and distribution information.

Body parameter

{
  "hash": "sha256:fc84b5febd328eccaa913807716887b3eb5ed08bc22cc6933a9ebf82766725e3",
  "layers": [
    {
      "hash": "sha256:2f077db56abccc19f16f140f629ae98e904b4b7d563957a7fc319bd11b82ba36",
      "uri": "https://storage.example.com/blob/2f077db56abccc19f16f140f629ae98e904b4b7d563957a7fc319bd11b82ba36",
      "headers": {
        "Authoriztion": [
          "Bearer hunter2"
        ]
      }
    }
  ]
}

Parameters

NameInTypeRequiredDescription
bodybodymanifesttrueManifest to index.

Example responses

201 Response

{
  "manifest_hash": null,
  "state": "string",
  "err": "string",
  "success": true,
  "packages": {},
  "distributions": {},
  "repository": {},
  "environments": {
    "property1": [],
    "property2": []
  }
}

Responses

StatusMeaningDescriptionSchema
201CreatedIndexReport created.

Clients may want to avoid reading the body if simply submitting the manifest for later vulnerability reporting.|index_report| |400|Bad Request|Bad Request|error| |412|Precondition Failed|Precondition Failed|None| |415|Unsupported Media Type|Unsupported Media Type|error| |default|Default|Internal Server Error|error|

Response Headers

StatusHeaderTypeFormatDescription
201LocationstringHTTP Location header
201LinkstringWeb Linking Link header

Delete Indexed Manifests

Code samples

import requests
headers = {
  'Content-Type': 'application/vnd.clair.bulk_delete.v1+json',
  'Accept': 'application/vnd.clair.bulk_delete.v1+json'
}

r = requests.delete('/indexer/api/v1/index_report', headers = headers)

print(r.json())

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/vnd.clair.bulk_delete.v1+json"},
        "Accept": []string{"application/vnd.clair.bulk_delete.v1+json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "/indexer/api/v1/index_report", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

const inputBody = '[
  "sha256:fc84b5febd328eccaa913807716887b3eb5ed08bc22cc6933a9ebf82766725e3"
]';
const headers = {
  'Content-Type':'application/vnd.clair.bulk_delete.v1+json',
  'Accept':'application/vnd.clair.bulk_delete.v1+json'
};

fetch('/indexer/api/v1/index_report',
{
  method: 'DELETE',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

DELETE /indexer/api/v1/index_report

Given a Manifest's content addressable hash, any data related to it will be removed if it exists.

Body parameter

[
  "sha256:fc84b5febd328eccaa913807716887b3eb5ed08bc22cc6933a9ebf82766725e3"
]

Parameters

NameInTypeRequiredDescription
bodybodybulk_deletetrueArray of manifest digests to delete.

Example responses

200 Response

[
  "sha256:fc84b5febd328eccaa913807716887b3eb5ed08bc22cc6933a9ebf82766725e3"
]

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully deleted manifests.bulk_delete
400Bad RequestBad Requesterror
415Unsupported Media TypeUnsupported Media Typeerror
defaultDefaultInternal Server Errorerror

Response Headers

StatusHeaderTypeFormatDescription
200Clair-ErrorstringThis is a trailer containing any errors encountered while writing the response.

Delete an Indexed Manifest

Code samples

import requests
headers = {
  'Accept': 'application/vnd.clair.error.v1+json'
}

r = requests.delete('/indexer/api/v1/index_report/{digest}', headers = headers)

print(r.json())

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/vnd.clair.error.v1+json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "/indexer/api/v1/index_report/{digest}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}


const headers = {
  'Accept':'application/vnd.clair.error.v1+json'
};

fetch('/indexer/api/v1/index_report/{digest}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

DELETE /indexer/api/v1/index_report/{digest}

Given a Manifest's content addressable hash, any data related to it will be removed it it exists.

Parameters

NameInTypeRequiredDescription
digestpathdigesttrueOCI-compatible digest of a referred object.

Example responses

400 Response

{
  "code": "string",
  "message": "string"
}

Responses

StatusMeaningDescriptionSchema
204No ContentSuccessNone
400Bad RequestBad Requesterror
415Unsupported Media TypeUnsupported Media Typeerror
defaultDefaultInternal Server Errorerror

Retrieve the IndexReport for a Manifest

Code samples

import requests
headers = {
  'Accept': 'application/vnd.clair.index_report.v1+json'
}

r = requests.get('/indexer/api/v1/index_report/{digest}', headers = headers)

print(r.json())

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/vnd.clair.index_report.v1+json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/indexer/api/v1/index_report/{digest}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}


const headers = {
  'Accept':'application/vnd.clair.index_report.v1+json'
};

fetch('/indexer/api/v1/index_report/{digest}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

GET /indexer/api/v1/index_report/{digest}

Given a Manifest's content addressable hash, an IndexReport will be retrieved if it exists.

Parameters

NameInTypeRequiredDescription
digestpathdigesttrueOCI-compatible digest of a referred object.

Example responses

200 Response

{
  "manifest_hash": null,
  "state": "string",
  "err": "string",
  "success": true,
  "packages": {},
  "distributions": {},
  "repository": {},
  "environments": {
    "property1": [],
    "property2": []
  }
}

Responses

StatusMeaningDescriptionSchema
200OKIndexReport retrievedindex_report
400Bad RequestBad Requesterror
404Not FoundNot Founderror
415Unsupported Media TypeUnsupported Media Typeerror
defaultDefaultInternal Server Errorerror

Response Headers

StatusHeaderTypeFormatDescription
200Clair-ErrorstringThis is a trailer containing any errors encountered while writing the response.

Report the Indexer's State

Code samples

import requests
headers = {
  'Accept': 'application/vnd.clair.index_state.v1+json'
}

r = requests.get('/indexer/api/v1/index_state', headers = headers)

print(r.json())

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/vnd.clair.index_state.v1+json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/indexer/api/v1/index_state", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}


const headers = {
  'Accept':'application/vnd.clair.index_state.v1+json'
};

fetch('/indexer/api/v1/index_state',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

GET /indexer/api/v1/index_state

The index state endpoint returns a json structure indicating the indexer's internal configuration state. A client may be interested in this as a signal that manifests may need to be re-indexed.

Example responses

200 Response

{
  "state": "string"
}

Responses

StatusMeaningDescriptionSchema
200OKIndexer Stateindex_state
304Not ModifiedNot ModifiedNone

Response Headers

StatusHeaderTypeFormatDescription
200EtagstringHTTP ETag header

matcher

Matcher service endpoints.

These are responsible for generating reports against current vulnerability data.

Retrieve a VulnerabilityReport for a Manifest

Code samples

import requests
headers = {
  'Accept': 'application/vnd.clair.vulnerability_report.v1+json'
}

r = requests.get('/matcher/api/v1/vulnerability_report/{digest}', headers = headers)

print(r.json())

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/vnd.clair.vulnerability_report.v1+json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/matcher/api/v1/vulnerability_report/{digest}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}


const headers = {
  'Accept':'application/vnd.clair.vulnerability_report.v1+json'
};

fetch('/matcher/api/v1/vulnerability_report/{digest}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

GET /matcher/api/v1/vulnerability_report/{digest}

Given a Manifest's content addressable hash a VulnerabilityReport will be created. The Manifest must have been Indexed first via the Index endpoint.

Parameters

NameInTypeRequiredDescription
digestpathdigesttrueOCI-compatible digest of a referred object.

Example responses

201 Response

{
  "manifest_hash": null,
  "packages": {},
  "distributions": {},
  "repository": {},
  "environments": {
    "property1": [],
    "property2": []
  },
  "vulnerabilities": {},
  "package_vulnerabilities": {
    "property1": [
      "string"
    ],
    "property2": [
      "string"
    ]
  },
  "enrichments": {
    "property1": [],
    "property2": []
  }
}

Responses

StatusMeaningDescriptionSchema
201CreatedVulnerability Report Createdvulnerability_report
400Bad RequestBad Requesterror
404Not FoundNot Founderror
415Unsupported Media TypeUnsupported Media Typeerror
defaultDefaultInternal Server Errorerror

notifier

Matcher service endpoints.

These are responsible for serving notifications.

Delete a Notification Set

Code samples

import requests
headers = {
  'Accept': 'application/vnd.clair.error.v1+json'
}

r = requests.delete('/notifier/api/v1/notification/{id}', headers = headers)

print(r.json())

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/vnd.clair.error.v1+json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "/notifier/api/v1/notification/{id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}


const headers = {
  'Accept':'application/vnd.clair.error.v1+json'
};

fetch('/notifier/api/v1/notification/{id}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

DELETE /notifier/api/v1/notification/{id}

Issues a delete of the provided notification ID and all associated notifications. After this delete clients will no longer be able to retrieve notifications.

Parameters

NameInTypeRequiredDescription
idpathtokentrueA notification ID returned by a callback

Example responses

400 Response

{
  "code": "string",
  "message": "string"
}

Responses

StatusMeaningDescriptionSchema
200OKDelete the notification referenced by the "id" parameter.None
400Bad RequestBad Requesterror
415Unsupported Media TypeUnsupported Media Typeerror
defaultDefaultInternal Server Errorerror

Response Headers

StatusHeaderTypeFormatDescription
200Clair-ErrorstringThis is a trailer containing any errors encountered while writing the response.

Retrieve Pages of a Notification Set

Code samples

import requests
headers = {
  'Accept': 'application/vnd.clair.notification_page.v1+json'
}

r = requests.get('/notifier/api/v1/notification/{id}', headers = headers)

print(r.json())

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/vnd.clair.notification_page.v1+json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/notifier/api/v1/notification/{id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}


const headers = {
  'Accept':'application/vnd.clair.notification_page.v1+json'
};

fetch('/notifier/api/v1/notification/{id}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

GET /notifier/api/v1/notification/{id}

By performing a GET with an id as a path parameter, the client will retrieve a paginated response of notification objects.

Parameters

NameInTypeRequiredDescription
page_sizequeryintegerfalseThe maximum number of notifications to deliver in a single page.
nextquerytokenfalseThe next page to fetch via id. Typically this number is provided on initial response in the "page.next" field. The first request should omit this field.
idpathtokentrueA notification ID returned by a callback

Example responses

200 Response

{
  "page": {
    "size": 100,
    "next": "1b4d0db2-e757-4150-bbbb-543658144205"
  },
  "notifications": [
    {
      "id": "5e4b387e-88d3-4364-86fd-063447a6fad2",
      "manifest": "sha256:35c102085707f703de2d9eaad8752d6fe1b8f02b5d2149f1d8357c9cc7fb7d0a",
      "reason": "added",
      "vulnerability": {
        "name": "CVE-2009-5155",
        "fixed_in_version": "v0.0.1",
        "links": "http://example.com/CVE-2009-5155",
        "description": "In the GNU C Library (aka glibc or libc6) before 2.28, parse_reg_exp in posix/regcomp.c misparses alternatives, which allows attackers to cause a denial of service (assertion failure and application exit) or trigger an incorrect result by attempting a regular-expression match.\"",
        "normalized_severity": "Unknown",
        "package": {
          "id": "10",
          "name": "libapt-pkg5.0",
          "version": "1.6.11",
          "kind": "BINARY",
          "arch": "x86",
          "source": {
            "id": "9",
            "name": "apt",
            "version": "1.6.11",
            "kind": "SOURCE",
            "source": null
          }
        },
        "distribution": {
          "id": "1",
          "did": "ubuntu",
          "name": "Ubuntu",
          "version": "18.04.3 LTS (Bionic Beaver)",
          "version_code_name": "bionic",
          "version_id": "18.04",
          "pretty_name": "Ubuntu 18.04.3 LTS"
        }
      }
    }
  ]
}

Responses

StatusMeaningDescriptionSchema
200OKA paginated list of notificationsnotification_page
304Not ModifiedNot ModifiedNone
400Bad RequestBad Requesterror
415Unsupported Media TypeUnsupported Media Typeerror
defaultDefaultInternal Server Errorerror

Response Headers

StatusHeaderTypeFormatDescription
200Clair-ErrorstringThis is a trailer containing any errors encountered while writing the response.

internal

These are internal endpoints, documented for completeness.

They are exempted from API stability guarentees.

Retrieve Manifests Affected by a Vulnerability

Code samples

import requests
headers = {
  'Content-Type': 'application/vnd.clair.vulnerability_summaries.v1+json',
  'Accept': 'application/vnd.clair.affected_manifests.v1+json'
}

r = requests.post('/indexer/api/v1/internal/affected_manifest', headers = headers)

print(r.json())

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/vnd.clair.vulnerability_summaries.v1+json"},
        "Accept": []string{"application/vnd.clair.affected_manifests.v1+json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "/indexer/api/v1/internal/affected_manifest", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

const inputBody = '[]';
const headers = {
  'Content-Type':'application/vnd.clair.vulnerability_summaries.v1+json',
  'Accept':'application/vnd.clair.affected_manifests.v1+json'
};

fetch('/indexer/api/v1/internal/affected_manifest',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

POST /indexer/api/v1/internal/affected_manifest

The provided vulnerability summaries are attempted to be run "backwards" through the indexer to produce a set of manifests.

Body parameter

[]

Parameters

NameInTypeRequiredDescription
bodybodyvulnerability_summariestrueArray of vulnerability summaries to report on.

Example responses

200 Response

{
  "vulnerabilities": {
    "42": {
      "id": "42"
    }
  },
  "vulnerable_manifests": {
    "sha256:01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b": [
      "42"
    ]
  }
}

Responses

StatusMeaningDescriptionSchema
200OKThe list of manifests and the corresponding vulnerabilities.affected_manifests
400Bad RequestBad Requesterror
415Unsupported Media TypeUnsupported Media Typeerror
defaultDefaultInternal Server Errorerror

Response Headers

StatusHeaderTypeFormatDescription
200Clair-ErrorstringThis is a trailer containing any errors encountered while writing the response.

Retrieve Vulnerability Changes Between Two Update Operations

Code samples

import requests
headers = {
  'Accept': 'application/vnd.clair.update_diff.v1+json'
}

r = requests.get('/matcher/api/v1/internal/update_diff', params={
  'prev': 'string'
}, headers = headers)

print(r.json())

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/vnd.clair.update_diff.v1+json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/matcher/api/v1/internal/update_diff", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}


const headers = {
  'Accept':'application/vnd.clair.update_diff.v1+json'
};

fetch('/matcher/api/v1/internal/update_diff?prev=string',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

GET /matcher/api/v1/internal/update_diff

Given IDs for two Update Operations, this will return the difference between them. This is used in the notification flow.

Parameters

NameInTypeRequiredDescription
curquerytokenfalse"Current" Update Operation ref.
prevquerytokentrue"Previous" Update Operation ref.

Example responses

200 Response

{
  "prev": null,
  "cur": null,
  "added": [],
  "removed": []
}

Responses

StatusMeaningDescriptionSchema
200OKChanges between two Update Operations.update_diff
400Bad RequestBad Requesterror
415Unsupported Media TypeUnsupported Media Typeerror
defaultDefaultInternal Server Errorerror

Response Headers

StatusHeaderTypeFormatDescription
200Clair-ErrorstringThis is a trailer containing any errors encountered while writing the response.

Retrieve Update Operations

Code samples

import requests
headers = {
  'Accept': 'application/vnd.clair.update_operations.v1+json'
}

r = requests.get('/matcher/api/v1/internal/update_operation', headers = headers)

print(r.json())

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/vnd.clair.update_operations.v1+json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/matcher/api/v1/internal/update_operation", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}


const headers = {
  'Accept':'application/vnd.clair.update_operations.v1+json'
};

fetch('/matcher/api/v1/internal/update_operation',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

GET /matcher/api/v1/internal/update_operation

Retrive all known or just the latest Update Operations.

Parameters

NameInTypeRequiredDescription
kindqueryanyfalseThe "kind" of updaters to query.
latestquerybooleanfalseReturn only the latest Update Operations instead of all known Update Operations.

Enumerated Values

ParameterValue
kindvulnerability
kindenrichment

Example responses

200 Response

{
  "property1": [],
  "property2": []
}

Responses

StatusMeaningDescriptionSchema
200OKUpdate Operations, keyed by updater.update_operations
400Bad RequestBad Requesterror
415Unsupported Media TypeUnsupported Media Typeerror
defaultDefaultInternal Server Errorerror

Response Headers

StatusHeaderTypeFormatDescription
200Clair-ErrorstringThis is a trailer containing any errors encountered while writing the response.

Delete an Update Operation

Code samples

import requests
headers = {
  'Accept': 'application/vnd.clair.error.v1+json'
}

r = requests.delete('/matcher/api/v1/internal/update_operation/{digest}', headers = headers)

print(r.json())

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/vnd.clair.error.v1+json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "/matcher/api/v1/internal/update_operation/{digest}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}


const headers = {
  'Accept':'application/vnd.clair.error.v1+json'
};

fetch('/matcher/api/v1/internal/update_operation/{digest}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

DELETE /matcher/api/v1/internal/update_operation/{digest}

Issues a delete of the provided Update Operation ID and all associated data. After this delete clients will no longer be able to generate a diff against this Update Operation.

Parameters

NameInTypeRequiredDescription
digestpathdigesttrueOCI-compatible digest of a referred object.

Example responses

400 Response

{
  "code": "string",
  "message": "string"
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessNone
400Bad RequestBad Requesterror
415Unsupported Media TypeUnsupported Media Typeerror
defaultDefaultInternal Server Errorerror

Response Headers

StatusHeaderTypeFormatDescription
200Clair-ErrorstringThis is a trailer containing any errors encountered while writing the response.

Schemas

token

"string"

An opaque token previously obtained from the service.

Properties

NameTypeRequiredRestrictionsDescription
anonymousstringfalsenoneAn opaque token previously obtained from the service.

affected_manifests

{
  "vulnerabilities": {
    "42": {
      "id": "42"
    }
  },
  "vulnerable_manifests": {
    "sha256:01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b": [
      "42"
    ]
  }
}

Affected Manifests

Properties

NameTypeRequiredRestrictionsDescription
vulnerabilitiesobjecttruenoneVulnerability objects.
» additionalPropertiesvulnerability.schema.jsonfalsenonenone
vulnerable_manifestsobjecttruenoneMapping of manifest digests to vulnerability identifiers.
» additionalProperties[string]falsenonenone

bulk_delete

[
  "sha256:fc84b5febd328eccaa913807716887b3eb5ed08bc22cc6933a9ebf82766725e3"
]

Bulk Delete

Properties

NameTypeRequiredRestrictionsDescription
Bulk Delete[digest.schema.json]falsenoneArray of manifest digests to delete from the system.

cpe

"cpe:/a:microsoft:internet_explorer:8.0.6001:beta"

Common Platform Enumeration Name

Properties

NameTypeRequiredRestrictionsDescription
Common Platform Enumeration NameanyfalsenoneThis is a CPE Name in either v2.2 "URI" form or v2.3 "Formatted String" form.

oneOf

NameTypeRequiredRestrictionsDescription
anonymousstringfalsenoneThis is the CPE 2.2 regexp: https://cpe.mitre.org/specification/2.2/cpe-language_2.2.xsd

xor

NameTypeRequiredRestrictionsDescription
anonymousstringfalsenoneThis is the CPE 2.3 regexp: https://csrc.nist.gov/schema/cpe/2.3/cpe-naming_2.3.xsd

digest

"sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a"

Digest

Properties

NameTypeRequiredRestrictionsDescription
DigeststringfalsenoneA digest acts as a content identifier, enabling content addressability.

anyOf

NameTypeRequiredRestrictionsDescription
anonymousstringfalsenoneSHA256

or

NameTypeRequiredRestrictionsDescription
anonymousstringfalsenoneSHA512

or

NameTypeRequiredRestrictionsDescription
anonymousstringfalsenoneBLAKE3

Currently not implemented.

distribution

{
  "id": "1",
  "did": "ubuntu",
  "name": "Ubuntu",
  "version": "18.04.3 LTS (Bionic Beaver)",
  "version_code_name": "bionic",
  "version_id": "18.04",
  "pretty_name": "Ubuntu 18.04.3 LTS"
}

Distribution

Properties

NameTypeRequiredRestrictionsDescription
idstringtruenoneUnique ID for this Distribution. May be unique to the response document, not the whole system.
didstringfalsenoneA lower-case string (no spaces or other characters outside of 0–9, a–z, ".", "_", and "-") identifying the operating system, excluding any version information and suitable for processing by scripts or usage in generated filenames.
namestringfalsenoneA string identifying the operating system.
versionstringfalsenoneA string identifying the operating system version, excluding any OS name information, possibly including a release code name, and suitable for presentation to the user.
version_code_namestringfalsenoneA lower-case string (no spaces or other characters outside of 0–9, a–z, ".", "_", and "-") identifying the operating system release code name, excluding any OS name information or release version, and suitable for processing by scripts or usage in generated filenames.
version_idstringfalsenoneA lower-case string (mostly numeric, no spaces or other characters outside of 0–9, a–z, ".", "_", and "-") identifying the operating system version, excluding any OS name information or release code name.
archstringfalsenoneA string identifying the OS architecture.
cpecpe.schema.jsonfalsenoneCommon Platform Enumeration name.
pretty_namestringfalsenoneA pretty operating system name in a format suitable for presentation to the user.

environment

{
  "value": {
    "package_db": "var/lib/dpkg/status",
    "introduced_in": "sha256:35c102085707f703de2d9eaad8752d6fe1b8f02b5d2149f1d8357c9cc7fb7d0a",
    "distribution_id": "1"
  }
}

Environment

Properties

NameTypeRequiredRestrictionsDescription
package_dbstringfalsenoneThe database the associated Package was discovered in.
distribution_idstringfalsenoneThe ID of the Distribution of the associated Package.
introduced_indigest.schema.jsonfalsenoneThe Layer the associated Package was introduced in.
repository_ids[string]falsenoneThe IDs of the Repositories of the associated Package.

error

{
  "code": "string",
  "message": "string"
}

Error

Properties

NameTypeRequiredRestrictionsDescription
codestringfalsenonea code for this particular error
messagestringtruenonea message with further detail

index_report

{
  "manifest_hash": null,
  "state": "string",
  "err": "string",
  "success": true,
  "packages": {},
  "distributions": {},
  "repository": {},
  "environments": {
    "property1": [],
    "property2": []
  }
}

Index Report

Properties

NameTypeRequiredRestrictionsDescription
manifest_hashdigest.schema.jsontruenoneThe Manifest's digest.
statestringtruenoneThe current state of the index operation
errstringfalsenoneAn error message on event of unsuccessful index
successbooleantruenoneA bool indicating succcessful index
packagesobjectfalsenoneA map of Package objects indexed by a document-local identifier.
» additionalPropertiespackage.schema.jsonfalsenonenone
distributionsobjectfalsenoneA map of Distribution objects indexed by a document-local identifier.
» additionalPropertiesdistribution.schema.jsonfalsenonenone
repositoryobjectfalsenoneA map of Repository objects indexed by a document-local identifier.
» additionalPropertiesrepository.schema.jsonfalsenonenone
environmentsobjectfalsenoneA map of Environment arrays indexed by a Package's identifier.
» additionalProperties[environment.schema.json]falsenonenone

index_state

{
  "state": "string"
}

Index State

Properties

NameTypeRequiredRestrictionsDescription
statestringtruenonean opaque token

layer

{
  "hash": null,
  "uri": "string",
  "headers": {},
  "media_type": "string"
}

Layer

Properties

NameTypeRequiredRestrictionsDescription
hashdigest.schema.jsontruenoneDigest of the layer blob.
uristringtruenoneA URI indicating where the layer blob can be downloaded from.
headersobjectfalsenoneAny additional HTTP-style headers needed for requesting layers.
» ^[a-zA-Z0-9-_]+$[string]falsenonenone
media_typestringfalsenoneThe OCI Layer media type for this layer.

manifest

{
  "hash": "sha256:fc84b5febd328eccaa913807716887b3eb5ed08bc22cc6933a9ebf82766725e3",
  "layers": [
    {
      "hash": "sha256:2f077db56abccc19f16f140f629ae98e904b4b7d563957a7fc319bd11b82ba36",
      "uri": "https://storage.example.com/blob/2f077db56abccc19f16f140f629ae98e904b4b7d563957a7fc319bd11b82ba36",
      "headers": {
        "Authoriztion": [
          "Bearer hunter2"
        ]
      }
    }
  ]
}

Manifest

Properties

NameTypeRequiredRestrictionsDescription
hashdigest.schema.jsontruenoneThe OCI Image Manifest's digest.

This is used as an identifier throughout the system. This SHOULD be the same as the OCI Image Manifest's digest, but this is not enforced.
layers[layer.schema.json]falsenoneThe OCI Layers making up the Image, in order.

normalized_severity

"Unknown"

Normalized Severity

Properties

NameTypeRequiredRestrictionsDescription
Normalized SeverityanyfalsenoneStandardized severity values.

Enumerated Values

PropertyValue
Normalized SeverityUnknown
Normalized SeverityNegligible
Normalized SeverityLow
Normalized SeverityMedium
Normalized SeverityHigh
Normalized SeverityCritical

notification_page

{
  "page": {
    "size": 100,
    "next": "1b4d0db2-e757-4150-bbbb-543658144205"
  },
  "notifications": [
    {
      "id": "5e4b387e-88d3-4364-86fd-063447a6fad2",
      "manifest": "sha256:35c102085707f703de2d9eaad8752d6fe1b8f02b5d2149f1d8357c9cc7fb7d0a",
      "reason": "added",
      "vulnerability": {
        "name": "CVE-2009-5155",
        "fixed_in_version": "v0.0.1",
        "links": "http://example.com/CVE-2009-5155",
        "description": "In the GNU C Library (aka glibc or libc6) before 2.28, parse_reg_exp in posix/regcomp.c misparses alternatives, which allows attackers to cause a denial of service (assertion failure and application exit) or trigger an incorrect result by attempting a regular-expression match.\"",
        "normalized_severity": "Unknown",
        "package": {
          "id": "10",
          "name": "libapt-pkg5.0",
          "version": "1.6.11",
          "kind": "BINARY",
          "arch": "x86",
          "source": {
            "id": "9",
            "name": "apt",
            "version": "1.6.11",
            "kind": "SOURCE",
            "source": null
          }
        },
        "distribution": {
          "id": "1",
          "did": "ubuntu",
          "name": "Ubuntu",
          "version": "18.04.3 LTS (Bionic Beaver)",
          "version_code_name": "bionic",
          "version_id": "18.04",
          "pretty_name": "Ubuntu 18.04.3 LTS"
        }
      }
    }
  ]
}

Notification Page

Properties

NameTypeRequiredRestrictionsDescription
pageobjecttruenoneAn object informing the client the next page to retrieve.
» sizeintegertruenoneThe number of notifications contained in this page.
» nextstringfalsenoneThe identififer to pass into the "next" parameter of a future GetNotification request.

If not present, there are no additional pages.
notifications[notification.schema.json]truenoneNotifications within this page.

notification

{
  "id": "string",
  "manifest": null,
  "reason": "added",
  "vulnerability": null
}

Notification

Properties

NameTypeRequiredRestrictionsDescription
idstringtruenoneUnique identifier for this notification.
manifestdigest.schema.jsontruenoneThe digest of the manifest affected by the provided vulnerability.
reasonanytruenoneThe reason for the notifcation.
vulnerabilityvulnerability_summary.schema.jsontruenonenone

Enumerated Values

PropertyValue
reasonadded
reasonremoved

notification_webhook

{
  "notification_id": "string",
  "callback": "http://example.com"
}

Notification Webhook

Properties

NameTypeRequiredRestrictionsDescription
notification_idstringtruenoneUnique identifier for this notification.
callbackstring(uri)truenoneA URL to retrieve paginated Notification objects.

package

{
  "id": "10",
  "name": "libapt-pkg5.0",
  "version": "1.6.11",
  "kind": "binary",
  "normalized_version": "",
  "arch": "x86",
  "module": "",
  "cpe": "",
  "source": {
    "id": "9",
    "name": "apt",
    "version": "1.6.11",
    "kind": "source",
    "source": null
  }
}

Package

Properties

NameTypeRequiredRestrictionsDescription
idstringfalsenoneUnique ID for this Package. May be unique to the response document, not the whole system.
namestringtruenoneIdentifier of this Package.

The uniqueness and scoping of this name depends on the packaging system.
versionstringtruenoneVersion of this Package, as reported by the packaging system.
kindanyfalsenoneThe "kind" of this Package.
source#falsenoneSource Package that produced the current binary Package, if known.
normalized_versionstringfalsenoneNormalized representation of the discoverd version.

The format is not specific, but is guarenteed to be forward compatible.
modulestringfalsenoneAn identifier for intra-Repository grouping of packages.

Likely only relevant on rpm-based systems.
archstringfalsenoneNative architecture for the Package.
cpecpe.schema.jsonfalsenoneCPE Name for the Package.

Enumerated Values

PropertyValue
kindBINARY
kindSOURCE

range

{
  "[": "string",
  ")": "string"
}

Range

Properties

NameTypeRequiredRestrictionsDescription
[stringfalsenoneLower bound, inclusive.
)stringfalsenoneUpper bound, exclusive.

repository

{
  "id": "string",
  "name": "string",
  "key": "string",
  "uri": "http://example.com",
  "cpe": null
}

Repository

Properties

NameTypeRequiredRestrictionsDescription
idstringtruenoneUnique ID for this Repository. May be unique to the response document, not the whole system.
namestringfalsenoneHuman-relevant name for the Repository.
keystringfalsenoneMachine-relevant name for the Repository.
uristring(uri)falsenoneURI describing the Repository.
cpecpe.schema.jsonfalsenoneCPE name for the Repository.

update_diff

{
  "prev": null,
  "cur": null,
  "added": [],
  "removed": []
}

Update Difference

Properties

NameTypeRequiredRestrictionsDescription
prevupdate_operation.schema.jsonfalsenoneThe previous Update Operation.
curupdate_operation.schema.jsontruenoneThe current Update Operation.
added[vulnerability.schema.json]truenoneVulnerabilities present in "cur", but not "prev".
removed[vulnerability.schema.json]truenoneVulnerabilities present in "prev", but not "cur".

update_operation

{
  "ref": "d0fad5d6-e996-4437-8fb9-5f40bbcfd7cc",
  "updater": "string",
  "fingerprint": "string",
  "date": "2019-08-24T14:15:22Z",
  "kind": "vulnerability"
}

Update Operation

Properties

NameTypeRequiredRestrictionsDescription
refstring(uuid)truenoneA unique identifier for this update operation.
updaterstringtruenoneThe "updater" component that was run.
fingerprintstringtruenoneThe stored "fingerprint" of this run.
datestring(date-time)truenoneWhen this operation was run.
kindanytruenoneThe kind of data this operation updated.

Enumerated Values

PropertyValue
kindvulnerability
kindenrichment

update_operations

{
  "property1": [],
  "property2": []
}

Update Operations

Properties

NameTypeRequiredRestrictionsDescription
additionalProperties[update_operation.schema.json]falsenonenone

vulnerability_core

{
  "name": "string",
  "fixed_in_version": "string",
  "severity": "string",
  "normalized_severity": null,
  "range": null,
  "arch_op": "equals",
  "package": null,
  "distribution": null,
  "repository": null
}

Vulnerability Core

Properties

NameTypeRequiredRestrictionsDescription
namestringtruenoneHuman-readable name, as presented in the vendor data.
fixed_in_versionstringfalsenoneVersion string, as presented in the vendor data.
severitystringfalsenoneSeverity, as presented in the vendor data.
normalized_severitynormalized_severity.schema.jsontruenoneA well defined set of severity strings guaranteed to be present.
rangerange.schema.jsonfalsenoneRange of versions the vulnerability applies to.
arch_opanyfalsenoneFlag indicating how the referenced package's "arch" member should be interpreted.
packagepackage.schema.jsonfalsenoneA package description
distributiondistribution.schema.jsonfalsenoneA distribution description
repositoryrepository.schema.jsonfalsenoneA repository description

anyOf

NameTypeRequiredRestrictionsDescription
anonymousobjectfalsenonenone

or

NameTypeRequiredRestrictionsDescription
anonymousobjectfalsenonenone

or

NameTypeRequiredRestrictionsDescription
anonymousobjectfalsenonenone

Enumerated Values

PropertyValue
arch_opequals
arch_opnot equals
arch_oppattern match

vulnerability_report

{
  "manifest_hash": null,
  "packages": {},
  "distributions": {},
  "repository": {},
  "environments": {
    "property1": [],
    "property2": []
  },
  "vulnerabilities": {},
  "package_vulnerabilities": {
    "property1": [
      "string"
    ],
    "property2": [
      "string"
    ]
  },
  "enrichments": {
    "property1": [],
    "property2": []
  }
}

Vulnerability Report

Properties

NameTypeRequiredRestrictionsDescription
manifest_hashdigest.schema.jsontruenoneThe Manifest's digest.
packagesobjecttruenoneA map of Package objects indexed by a document-local identifier.
» additionalPropertiespackage.schema.jsonfalsenonenone
distributionsobjecttruenoneA map of Distribution objects indexed by a document-local identifier.
» additionalPropertiesdistribution.schema.jsonfalsenonenone
repositoryobjectfalsenoneA map of Repository objects indexed by a document-local identifier.
» additionalPropertiesrepository.schema.jsonfalsenonenone
environmentsobjecttruenoneA map of Environment arrays indexed by a Package's identifier.
» additionalProperties[environment.schema.json]falsenonenone
vulnerabilitiesobjecttruenoneA map of Vulnerabilities indexed by a document-local identifier.
» additionalPropertiesvulnerability.schema.jsonfalsenonenone
package_vulnerabilitiesobjecttruenoneA mapping of Vulnerability identifier lists indexed by Package identifier.
» additionalProperties[string]falsenonenone
enrichmentsobjectfalsenoneA mapping of extra "enrichment" data by type
» additionalPropertiesarrayfalsenonenone

vulnerability

false

Vulnerability

Properties

None

vulnerability_summaries

[]

Vulnerability Summaries

Properties

NameTypeRequiredRestrictionsDescription
Vulnerability Summaries[vulnerability_summary.schema.json]falsenoneThis is an internal type, documented for completeness.

This is an array of pseudo-Vulnerability objects used for reverse-lookup.

vulnerability_summary

false

Vulnerability Summary

Properties

None