Endpoints, toggles, configuration, and metrics#
Facts and specifications for the SKA CI/CD Artefact Validations service: HTTP endpoints, feature toggles, configuration schema, environment variables, metrics, labels, checks, retry policies, the audit record, and the cleanup script. For concepts and design rationale, see How the Artefact Validations service works; for operational guides, see Run and operate the Artefact Validations.
HTTP endpoints#
The FastAPI receiver (main_api.py) exposes four routes. Webhook routes
authenticate the request, validate the payload against a Pydantic model, and
on success enqueue a Celery task and return 200 OK. An invalid payload
returns 400; a failed authentication returns 401; a malformed request
returns 422.
Path |
Method |
Trigger |
Task / behaviour |
|---|---|---|---|
|
POST |
Nexus component webhook. Only the |
|
|
POST |
Harbor |
|
|
POST |
Harbor |
|
|
GET |
Prometheus scrape. |
Serves metrics when the |
Endpoint authentication#
Authentication is configured per source in api/auth_config.yaml:
Endpoint(s) |
Method |
Details |
|---|---|---|
|
|
The |
|
|
HMAC-SHA1 of the raw body keyed with |
Feature toggles#
Toggles are evaluated through the Unleash Proxy and managed in the GitLab project under Deploy > Feature flags. Unless noted, the fallback when Unleash is unreachable is shown in the “Fallback” column.
Toggle |
Effect |
Fallback |
|---|---|---|
|
Enables metric recording and the |
off |
|
When on, a vulnerability report at or above |
off |
|
When on, |
off |
|
When on, Harbor promotion additionally requires a signed image and a signed SBOM (see How the Artefact Validations service works). When off, the signature gate is skipped. |
off |
|
Enables the artefact-name check ( |
off |
|
Enables the artefact-tag check ( |
off |
|
Enables the metadata check ( |
off |
|
Enables the raw-asset check ( |
off |
|
Per-artefact exclusion. When enabled for a given artefact name (passed
as the Unleash |
excluded (the check is skipped) |
Note
A check runs only when its own toggle is enabled. The toggle is evaluated
twice: first to build the run list (run_checks, fallback off), then
again inside perform_check (fallback on). Because the run-list
evaluation happens first and decides membership, the effective fallback
is off — checks do not run while Unleash is unreachable. The
<check-toggle>-excluded lookup falls back to excluded (fallback on),
so an artefact is skipped when its exclusion state cannot be resolved. The
metrics toggle also gates metric writes through the
check_metrics_toggle decorator.
Configuration file#
The behavioural configuration is a YAML file (mounted at
/etc/config/config.yml; override with CONFIG_PATH). Each top-level key
maps to a Pydantic config class.
Harbor configuration (HarborConfig, key harbor)#
Field |
Purpose |
Default |
|---|---|---|
|
Target Harbor project for promotion. The chart’s |
|
|
Attempts to fetch the vulnerability report before treating the artefact as vulnerable. |
|
|
Delay in seconds between vulnerability-report attempts. |
|
|
How many times the signature gate re-checks the artefact’s accessories while waiting for signatures to appear (in-handler poll). |
|
|
Delay in seconds between signature checks. |
|
|
Whether the gate requires the SBOM to be signed. When |
|
|
Minimum severity ( |
|
|
Declared intent to promote artefacts. Not consulted by the current handler; promotion happens whenever the gates pass. |
|
|
Delete the staging source after a successful promotion. |
|
Nexus configuration (NexusConfig, key nexus)#
Field |
Purpose |
Default |
|---|---|---|
|
Declared intent to quarantine artefacts. Not consulted by the current handler; non-compliant artefacts are always quarantined. |
|
|
Delete the source artefact after quarantining it. |
|
Metrics configuration (MetricsConfig, key metrics)#
Field |
Purpose |
Default |
|---|---|---|
|
Directory for the Prometheus multiprocess registry (shared across
Celery worker processes). The Helm chart overrides this to
|
|
Environment variables#
Rendered into Kubernetes Secrets from global.env values and injected into
the API and/or Celery pods.
Variable |
Purpose |
Used by |
|---|---|---|
|
Harbor API base URL, including |
Celery |
|
Harbor API credentials (also reused as |
Celery |
|
Expected value of the Harbor webhook |
API |
|
Nexus base URL. |
Celery |
|
Nexus API credentials. |
Celery |
|
HMAC secret for verifying Nexus webhook signatures. |
API |
|
Marvin’s GitLab identity ( |
Celery |
|
GitLab token for opening merge requests. |
Celery |
|
MongoDB connection URI, database, and collection for audit records. |
Celery |
|
Redis broker/result-backend URL. The Helm chart constructs this from the
bundled |
API + Celery |
|
Unleash Proxy base URL ( |
API + Celery |
|
Unleash Proxy SDK token ( |
API + Celery |
|
Unleash application name / environment. |
API + Celery |
|
When set, skips Unleash client initialisation (tests and local runs). |
API + Celery |
|
Secret key for the FastAPI session middleware. |
API |
|
HashiCorp Vault base URL. |
Celery |
|
Vault AppRole credentials. |
Celery |
|
Common name requested from the PKI role when issuing a signing certificate. |
Celery |
|
Vault PKI role path that issues the signing certificate. Defaults to
|
Celery |
|
RFC 3161 timestamping authority used to countersign SBOM signatures.
Defaults to DigiCert ( |
Celery |
|
Path to the TSA’s root certificate (PEM). Defaults to
|
Celery |
|
Directory holding Notation’s signing configuration (keys, certificates).
Defaults to |
Celery |
|
Path to |
Celery |
|
Name of the Celery application (default |
API + Celery |
|
Logging level. |
API + Celery |
Deployment values#
Operational knobs in charts/ska-cicd-artefact-validations/values.yaml (in
addition to the global.env credentials and the config block above).
Key |
Purpose |
Default |
|---|---|---|
|
Container image. |
|
|
CPU/memory requests and limits, applied to both the API and Celery pods. |
limits |
|
Shared |
|
|
Docker daemon endpoint for the Celery worker. When |
|
|
Pod scheduling constraints, wired into both deployments. |
|
|
Horizontal Pod Autoscaler for the Celery worker ( |
|
|
Ingress exposing |
|
|
Password for the bundled |
(unset) |
|
Service account (default: use the namespace default) and the
|
|
Note
The bundled subcharts pin mongodb to bitnamilegacy/mongodb:4.4.5 and
redis to bitnamilegacy/redis:6.2.7-debian-11-r60 (chart dependencies
redis 14.1.0 / mongodb 10.15.0 in Chart.yaml). Unleash is
configured entirely through the global.env.unleash_* values; the chart
has no unleash_config key and no custom updateStrategy.
Compliance checks#
Checks live in src/ska_cicd_artefact_validations/checks. Every check
returns FAILURE severity, so a failure blocks promotion (Harbor) or forces
quarantine (Nexus) and blocks the merge request.
Check |
Toggle |
Validates |
Mitigation |
|---|---|---|---|
|
|
The artefact name matches the SKAO naming regex ( |
Rename per the SKAO naming convention. |
|
|
The tag is valid SemVer (or PEP 440 for PyPI artefacts). |
Re-tag per the SKAO versioning convention. |
|
|
All required |
Add the missing fields (listed in the MR) to the artefact metadata. |
|
|
For |
Publish a valid |
Required metadata fields#
CheckArtefactMetadata requires all of: CI_COMMIT_AUTHOR,
CI_COMMIT_REF_NAME, CI_COMMIT_REF_SLUG, CI_COMMIT_SHA,
CI_COMMIT_SHORT_SHA, CI_COMMIT_TIMESTAMP, CI_JOB_ID, CI_JOB_URL,
CI_PIPELINE_ID, CI_PIPELINE_IID, CI_PIPELINE_URL, CI_PROJECT_ID,
CI_PROJECT_PATH_SLUG, CI_PROJECT_URL, CI_RUNNER_ID,
CI_RUNNER_REVISION, CI_RUNNER_TAGS, GITLAB_USER_NAME,
GITLAB_USER_EMAIL, GITLAB_USER_LOGIN, GITLAB_USER_ID.
Harbor labels#
The Harbor handler applies global-scope labels to staging artefacts.
Label |
Applied when |
|---|---|
|
|
|
|
|
|
|
|
Note
Invalid* labels are derived at run time by replacing CheckArtefact
with Invalid in each failing check’s class name.
Retry policies#
Task / policy |
Trigger |
Max retries |
Delay |
|---|---|---|---|
|
Any exception, including a failed Harbor promotion or
|
|
|
Signature poll (in |
The artefact is not yet fully signed (re-checked in-handler, blocking). |
|
|
|
Any exception. |
|
|
|
Any exception. |
|
|
|
Any exception. |
|
|
Celery worker settings (celeryconfig.py): worker_concurrency = 6,
worker_prefetch_multiplier = 1, task_soft_time_limit = 3600 s,
task_time_limit = 7200 s, task_default_retry_delay = 300 s.
Metrics#
Exposed at /metrics in Prometheus text format, gated by the metrics
toggle.
Metric |
Type |
Labels |
Description |
|---|---|---|---|
|
Summary |
|
Time spent running each check. |
|
Counter |
Total checks executed. |
|
|
Counter |
|
Checks that failed. |
|
Counter |
Artefacts processed. |
|
|
Counter |
|
Exceptions raised in instrumented functions (e.g. |
MongoDB audit record#
insertdb_task stores one document per processed artefact as a JSON dump of
the Artefact object.
Field |
Meaning |
|---|---|
|
Source repository/project. |
|
Artefact name (without version). |
|
Tag/version (or digest for digest-only Harbor pushes). |
|
|
|
Nexus component ID (Nexus only). |
|
Artefact labels/metadata. |
|
List of asset filenames (Nexus). |
|
List of check results (see below). |
|
Vulnerability report (Harbor only). |
|
Conan group and channel (Conan only). |
Each entry in checks_results carries: name, result (bool),
block_mr (bool — a FAILURE that did not pass), runtime (seconds),
check_type (message symbol), description, and mitigation.
Cleanup script#
scripts/delete_dangling_sbom_signature_artifacts.py deletes signature
artefacts whose referenced SBOM digest no longer exists. It takes no CLI
arguments and is configured entirely through environment variables.
Variable |
Purpose |
|---|---|
|
Harbor API base URL, including |
|
Project to scan. |
|
Robot account username. |
|
Robot account secret. |
It paginates every repository in the project, identifies signature artefacts by
their sha256-... tags, resolves each tag to the SBOM digest it references,
and deletes the artefact when that SBOM no longer exists. It runs from the
scheduled clean-dangling-signature-artifacts CI job.