API-Referenz.

Eine HTTPS-API, aufgerufen mit curl aus jeder Pipeline. Nichts zu installieren, nichts zu betreiben: Die CI-Anbindung ist diese API und ein Beispiel zum Kopieren (ADR-0017).

BitHive Reporting Desk API · 0.4.1

Authentifizierung

Jede Anfrage trägt ein API-Token als Bearer-Token: „Authorization: Bearer <token>“. Token werden in der Anwendung erstellt, tragen Scopes, können auf ein Produkt begrenzt werden und laufen ab. Ein unbekanntes, abgelaufenes oder widerrufenes Token wird mit 401 und einem Problemdokument beantwortet.

Server

  • https://app.bithive-it.com Production
  • http://localhost:8080 Local development

Endpunkte

GET/healthz

Liveness probe

Reports that the process is running. Checks no dependencies.

Antworten

Beispiel

curl --fail-with-body -sS \
  -H "Authorization: Bearer $BITHIVE_TOKEN" \
  "https://app.bithive-it.com/healthz"

GET/readyz

Readiness probe

Reports whether all dependencies can serve traffic, as a status and nothing else: no dependency is named, and no version or error text is returned. The external uptime monitor polls it. Failure details are logged.

Antworten

  • 200 Ready to serve traffic. Readiness
  • 503 At least one dependency is unavailable. Readiness

Beispiel

curl --fail-with-body -sS \
  -H "Authorization: Bearer $BITHIVE_TOKEN" \
  "https://app.bithive-it.com/readyz"

GET/v1/products

List the products of the account

Returns the products the token may see: all products of the account, or only the one the token is limited to. Archived products are included and marked.

Antworten

  • 200 The products the token may see. ProductList
  • 401 The API token is missing, unknown, expired or revoked.
  • 403 The API token does not carry the required scope.
  • 405 The resource does not support this method.

Beispiel

curl --fail-with-body -sS \
  -H "Authorization: Bearer $BITHIVE_TOKEN" \
  "https://app.bithive-it.com/v1/products"

GET/v1/products/{productId}

Read one product

Returns the product. A product of another account, and a product the token is not limited to, are reported as not found.

Parameter

  • productId path, string (uuid), erforderlich Identifier of the product.

Antworten

  • 200 The product. Product
  • 401 The API token is missing, unknown, expired or revoked.
  • 403 The API token does not carry the required scope.
  • 404 The resource does not exist, or the token may not see it.
  • 405 The resource does not support this method.

Beispiel

curl --fail-with-body -sS \
  -H "Authorization: Bearer $BITHIVE_TOKEN" \
  "https://app.bithive-it.com/v1/products/$PRODUCTID"

GET/v1/products/{productId}/sboms

List the uploads of one product

Returns the product's uploads, newest first. Requires the scope sboms:read.

Parameter

  • productId path, string (uuid), erforderlich Identifier of the product.

Antworten

  • 200 The uploads of the product. SBOMList
  • 401 The API token is missing, unknown, expired or revoked.
  • 403 The API token does not carry the required scope.
  • 404 The resource does not exist, or the token may not see it.
  • 405 The resource does not support this method.

Beispiel

curl --fail-with-body -sS \
  -H "Authorization: Bearer $BITHIVE_TOKEN" \
  "https://app.bithive-it.com/v1/products/$PRODUCTID/sboms"

POST/v1/products/{productId}/sboms

Upload a bill of materials for a product

Stores a CycloneDX or SPDX document in JSON, at most 10 MiB, and indexes its components. The format is read from the document, not from the content type. Uploading the same bytes for the same product again answers 200 with the existing upload instead of storing a second one, so a build pipeline that runs twice on an unchanged tree is harmless.

Requires the scope sboms:write.

Parameter

  • productId path, string (uuid), erforderlich Identifier of the product.

Anfragekörper

The document itself, as sent by the build tool.

  • application/json
  • application/vnd.cyclonedx+json
  • application/spdx+json

Antworten

  • 200 The same document was already stored for this product; nothing changed. SBOM
  • 201 The document was stored. SBOM
  • 400 The document is empty, not JSON, in neither format, or lists something unusable.
  • 401 The API token is missing, unknown, expired or revoked.
  • 403 The API token does not carry the required scope.
  • 404 The resource does not exist, or the token may not see it.
  • 405 The resource does not support this method.
  • 413 The document is larger than 10 MiB.
  • 415 The content type is not one of the accepted JSON types.

Beispiel

curl --fail-with-body -sS -X POST \
  -H "Authorization: Bearer $BITHIVE_TOKEN" \
  -H "Content-Type: application/vnd.cyclonedx+json" \
  --data-binary @sbom.json \
  "https://app.bithive-it.com/v1/products/$PRODUCTID/sboms"

GET/v1/sboms/{sbomId}

Read one upload

Returns the upload. An upload of another account, and one belonging to a product the token is not limited to, are reported as not found. Requires the scope sboms:read.

Parameter

  • sbomId path, string (uuid), erforderlich Identifier of the upload.

Antworten

  • 200 The upload. SBOM
  • 401 The API token is missing, unknown, expired or revoked.
  • 403 The API token does not carry the required scope.
  • 404 The resource does not exist, or the token may not see it.
  • 405 The resource does not support this method.

Beispiel

curl --fail-with-body -sS \
  -H "Authorization: Bearer $BITHIVE_TOKEN" \
  "https://app.bithive-it.com/v1/sboms/$SBOMID"

GET/v1/sboms/{sbomId}/components

Read the component index of one upload

Returns every component the document listed, by name. The list is complete and needs no paging: a document may not carry more than 50,000 components. Requires the scope sboms:read.

Parameter

  • sbomId path, string (uuid), erforderlich Identifier of the upload.

Antworten

  • 200 The components of the upload. ComponentList
  • 401 The API token is missing, unknown, expired or revoked.
  • 403 The API token does not carry the required scope.
  • 404 The resource does not exist, or the token may not see it.
  • 405 The resource does not support this method.

Beispiel

curl --fail-with-body -sS \
  -H "Authorization: Bearer $BITHIVE_TOKEN" \
  "https://app.bithive-it.com/v1/sboms/$SBOMID/components"

GET/v1/sboms/{sbomId}/document

Download the document as it was uploaded

Returns the stored bytes unchanged, which is what an audit or a report attachment needs. Requires the scope sboms:read.

Parameter

  • sbomId path, string (uuid), erforderlich Identifier of the upload.

Antworten

  • 200 The document, byte for byte as uploaded.
  • 401 The API token is missing, unknown, expired or revoked.
  • 403 The API token does not carry the required scope.
  • 404 The resource does not exist, or the token may not see it.
  • 405 The resource does not support this method.

Beispiel

curl --fail-with-body -sS \
  -H "Authorization: Bearer $BITHIVE_TOKEN" \
  "https://app.bithive-it.com/v1/sboms/$SBOMID/document"

GET/v1/products/{productId}/findings

List what was found in a product

Returns the product's findings, the ones for vulnerabilities known to be exploited first, then by severity, then newest. That order is the order to work in: an actively exploited vulnerability is what starts the Cyber Resilience Act's 24-hour report.

Whether a vulnerability is exploited is resolved when the request is answered, not stored on the finding, because a vulnerability becomes exploited later and that moment is what matters.

Requires the scope findings:read.

Parameter

  • productId path, string (uuid), erforderlich Identifier of the product.

Antworten

  • 200 The product's findings. FindingList
  • 401 The API token is missing, unknown, expired or revoked.
  • 403 The API token does not carry the required scope.
  • 404 The resource does not exist, or the token may not see it.
  • 405 The resource does not support this method.

Beispiel

curl --fail-with-body -sS \
  -H "Authorization: Bearer $BITHIVE_TOKEN" \
  "https://app.bithive-it.com/v1/products/$PRODUCTID/findings"

GET/v1/products/{productId}/coverage

Read how much of a product can be checked

Returns how many components of the product's latest upload we can check, and names what it cannot. Results depend on the completeness of the bill of materials, so the uncovered part is named rather than merely subtracted: a client can see which ecosystems are not covered and why.

A component is not monitored when it carries no package identifier (common in firmware built with Yocto or Buildroot), when it names no version, or when it belongs to an ecosystem whose matching is not yet proven.

Requires the scope findings:read.

Parameter

  • productId path, string (uuid), erforderlich Identifier of the product.

Antworten

  • 200 What the product's latest upload could be checked against. Coverage
  • 401 The API token is missing, unknown, expired or revoked.
  • 403 The API token does not carry the required scope.
  • 404 The resource does not exist, or the token may not see it.
  • 405 The resource does not support this method.

Beispiel

curl --fail-with-body -sS \
  -H "Authorization: Bearer $BITHIVE_TOKEN" \
  "https://app.bithive-it.com/v1/products/$PRODUCTID/coverage"

Was zurückkommt

Liveness

FieldTypeDescription
status erforderlichstring

Readiness

FieldTypeDescription
status erforderlichstring

Product

FieldTypeDescription
id erforderlichstring (uuid)
name erforderlichstring
created_at erforderlichstring (date-time)
archived erforderlichbooleanAn archived product is no longer monitored.

ProductList

FieldTypeDescription
products erforderlicharray of object

SBOM

FieldTypeDescription
id erforderlichstring (uuid)
product_id erforderlichstring (uuid)
format erforderlichstring
spec_version erforderlichstringVersion of the specification the document follows, for example 1.6 or SPDX-2.3.
sha256 erforderlichstringSHA-256 of the stored document, in lower-case hexadecimal. It addresses the document.
component_count erforderlichintegerComponents the document listed, after repetitions were dropped.
source erforderlichstringWhether the upload came through the interface or this API.
created_at erforderlichstring (date-time)

SBOMList

FieldTypeDescription
sboms erforderlicharray of object

Component

FieldTypeDescription
name erforderlichstring
version erforderlichstringEmpty when the document stated no version; such a component cannot be matched.
purl erforderlichstringPackage URL as the document carried it, empty when it carried none.

ComponentList

FieldTypeDescription
components erforderlicharray of object
total erforderlichinteger

Finding

FieldTypeDescription
id erforderlichstring (uuid)
component erforderlichobject
vulnerability erforderlichobject
evidence erforderlichstringWhether the feed stated the affected version outright, or the version was compared against a published range.
matched_rangestringThe range that decided a compared match.
state erforderlichstring
exploited erforderlichbooleanThe vulnerability is known to be exploited, which starts the 24-hour report.
exploited_cvestringThe identifier the exploitation catalogue lists it under.
exploited_sincestring (date)The day the catalogue added it.
ransomware erforderlichbooleanThe catalogue has linked it to a ransomware campaign.
first_seen_at erforderlichstring (date-time)When the Reporting Desk first saw this finding. Reporting deadlines are measured from our own knowledge.
last_seen_at erforderlichstring (date-time)

FindingList

FieldTypeDescription
findings erforderlicharray of object
total erforderlichinteger
exploited erforderlichintegerHow many of them start a reporting deadline.

NotMonitoredGroup

FieldTypeDescription
reason erforderlichstring
ecosystemstringThe ecosystem, when the reason is about one, so a client can see that it is Alpine rather than only that something is unsupported.
explanationstringWhat specifically is unsolved. For "version could not be read": these versions cannot be ordered, so they are not checked against advisories that give a range of affected versions; they are still matched against advisories that list their exact version, which means such a component can have findings and still be counted here as not monitored.
components erforderlichinteger

Coverage

FieldTypeDescription
sbom_idstring (uuid)The upload this describes; absent when the product has none.
components erforderlichinteger
monitored erforderlichinteger
monitored_percent erforderlichnumberThe monitored share, rounded to one decimal place.
not_monitored erforderlicharray of object

Problem

RFC 9457 problem details.

FieldTypeDescription
type erforderlichstring
title erforderlichstring
status erforderlichinteger
detailstring

Der Vertrag selbst. Diese Seite entsteht aus dem OpenAPI-Dokument des Dienstes. Es ist als Datei veröffentlicht, damit ein Client-Generator denselben Vertrag lesen kann, den diese Seite beschreibt. openapi.yaml herunterladen

Doku

Kostenlos testen

Gespräch buchen