Registries
Registries are the source of every image HarborGuard scans. Each registry is bound to one organization, is encrypted at rest using envelope encryption, and may run in either cloud mode (HarborGuard pulls images directly) or sensor mode (a HarborGuard sensor inside your network performs the pull and reports back).
Base path: /api/registries
| Method | Path | Min role |
|---|---|---|
| GET | /api/registries | viewer (any) |
| POST | /api/registries | admin |
| GET | /api/registries/{registryId} | viewer (any) |
| PUT | /api/registries/{registryId} | admin |
| DELETE | /api/registries/{registryId} | admin |
| POST | /api/registries/test-connection | developer |
| POST | /api/registries/{registryId}/sync | admin |
| GET | /api/registries/{registryId}/sensor-status | viewer (any) |
| POST | /api/registries/schedule-scans | admin |
Supported providers
The provider enum is fixed:
When scanMethod = sensor on POST /registries, the response includes sensorApiKey (a one-time hg_ak_* value) used by the sensor to authenticate uploads. Credentials are never returned by GET — they are encrypted with a per-registry data encryption key (DEK), which is itself wrapped by the org's key encryption key (KEK).
registriesAuthorization
X-API-Key<token>
Organization API key (hg_ak_*). Created from Settings → API Keys.
In: header
AuthorizationRequiredBearer <token>
Authorization: Bearer hg_ak_... for organization API keys, or
Authorization: Bearer hg_pat_... for Personal Access Tokens that
impersonate a specific user.
In: header
next-auth.session-token<token>
NextAuth session cookie. Web only — set automatically at sign-in. Not usable for server-to-server.
In: cookie
OK
registriesAuthorization
X-API-Key<token>
Organization API key (hg_ak_*). Created from Settings → API Keys.
In: header
AuthorizationRequiredBearer <token>
Authorization: Bearer hg_ak_... for organization API keys, or
Authorization: Bearer hg_pat_... for Personal Access Tokens that
impersonate a specific user.
In: header
next-auth.session-token<token>
NextAuth session cookie. Web only — set automatically at sign-in. Not usable for server-to-server.
In: cookie
Request Body
application/jsonRequirednameRequiredstring
providerRequiredstring
"DOCKER_HUB" | "GHCR" | "AWS_ECR" | "AZURE_ACR" | "GOOGLE_GAR" | "GITLAB" | "HARBOR" | "JFROG" | "QUAY" | "NEXUS" | "DOCKER_REGISTRY" | "CUSTOM"urlstring
Required for DOCKER_REGISTRY, HARBOR, JFROG, NEXUS, GITLAB, CUSTOM.
credentialsUsernamePassword | UsernamePat | AwsEcr | GoogleGar | AzureAcr | HarborRobot | JfrogIdentityToken
Provider-specific credential payload. Exact required fields vary by provider.
scanMethodstring
"cloud"Value in: "cloud" | "sensor"scannersarray<string>
["trivy","grype","syft"]schedulestring
"daily"Value in: "manual" | "on_push" | "daily" | "weekly"includeTagsstring
excludeTagsstring
insecureboolean
falseCreated
registries/{registryId}Authorization
X-API-Key<token>
Organization API key (hg_ak_*). Created from Settings → API Keys.
In: header
AuthorizationRequiredBearer <token>
Authorization: Bearer hg_ak_... for organization API keys, or
Authorization: Bearer hg_pat_... for Personal Access Tokens that
impersonate a specific user.
In: header
next-auth.session-token<token>
NextAuth session cookie. Web only — set automatically at sign-in. Not usable for server-to-server.
In: cookie
Path Parameters
registryIdRequiredstring
OK
registries/{registryId}Authorization
X-API-Key<token>
Organization API key (hg_ak_*). Created from Settings → API Keys.
In: header
AuthorizationRequiredBearer <token>
Authorization: Bearer hg_ak_... for organization API keys, or
Authorization: Bearer hg_pat_... for Personal Access Tokens that
impersonate a specific user.
In: header
next-auth.session-token<token>
NextAuth session cookie. Web only — set automatically at sign-in. Not usable for server-to-server.
In: cookie
Request Body
application/jsonRequirednamestring
scanningobject
Path Parameters
registryIdRequiredstring
OK
registries/{registryId}Authorization
X-API-Key<token>
Organization API key (hg_ak_*). Created from Settings → API Keys.
In: header
AuthorizationRequiredBearer <token>
Authorization: Bearer hg_ak_... for organization API keys, or
Authorization: Bearer hg_pat_... for Personal Access Tokens that
impersonate a specific user.
In: header
next-auth.session-token<token>
NextAuth session cookie. Web only — set automatically at sign-in. Not usable for server-to-server.
In: cookie
Path Parameters
registryIdRequiredstring
OK
registries/test-connectionAuthorization
X-API-Key<token>
Organization API key (hg_ak_*). Created from Settings → API Keys.
In: header
AuthorizationRequiredBearer <token>
Authorization: Bearer hg_ak_... for organization API keys, or
Authorization: Bearer hg_pat_... for Personal Access Tokens that
impersonate a specific user.
In: header
next-auth.session-token<token>
NextAuth session cookie. Web only — set automatically at sign-in. Not usable for server-to-server.
In: cookie
Request Body
application/jsonRequiredproviderRequiredstring
"DOCKER_HUB" | "GHCR" | "AWS_ECR" | "AZURE_ACR" | "GOOGLE_GAR" | "GITLAB" | "HARBOR" | "JFROG" | "QUAY" | "NEXUS" | "DOCKER_REGISTRY" | "CUSTOM"urlstring
credentialsUsernamePassword | UsernamePat | AwsEcr | GoogleGar | AzureAcr | HarborRobot | JfrogIdentityToken
Provider-specific credential payload. Exact required fields vary by provider.
insecureboolean
falseOK
registries/{registryId}/syncAuthorization
X-API-Key<token>
Organization API key (hg_ak_*). Created from Settings → API Keys.
In: header
AuthorizationRequiredBearer <token>
Authorization: Bearer hg_ak_... for organization API keys, or
Authorization: Bearer hg_pat_... for Personal Access Tokens that
impersonate a specific user.
In: header
next-auth.session-token<token>
NextAuth session cookie. Web only — set automatically at sign-in. Not usable for server-to-server.
In: cookie
Path Parameters
registryIdRequiredstring
Accepted
registries/{registryId}/sensor-statusAuthorization
X-API-Key<token>
Organization API key (hg_ak_*). Created from Settings → API Keys.
In: header
AuthorizationRequiredBearer <token>
Authorization: Bearer hg_ak_... for organization API keys, or
Authorization: Bearer hg_pat_... for Personal Access Tokens that
impersonate a specific user.
In: header
next-auth.session-token<token>
NextAuth session cookie. Web only — set automatically at sign-in. Not usable for server-to-server.
In: cookie
Path Parameters
registryIdRequiredstring
OK
registries/schedule-scansAuthorization
X-API-Key<token>
Organization API key (hg_ak_*). Created from Settings → API Keys.
In: header
AuthorizationRequiredBearer <token>
Authorization: Bearer hg_ak_... for organization API keys, or
Authorization: Bearer hg_pat_... for Personal Access Tokens that
impersonate a specific user.
In: header
next-auth.session-token<token>
NextAuth session cookie. Web only — set automatically at sign-in. Not usable for server-to-server.
In: cookie
Accepted