Connect container and package registries
Your code can be clean while the image you actually ship carries a base layer full of holes. Scanning a repository tells you what you wrote. Scanning the registry tells you what you shipped. You want both.
Connecting a registry adds its images and packages as Artifact resources, so Dwaar can discover and scan them.
Prerequisites
- A role that holds
integrations:create. - A read-only credential for the registry, as described below.
Connect a registry
- Open Integrations, choose your registry, then Add connection.
- Name the connection after the account, project or registry it covers.
- Follow the guide beside the form to create the credential, and fill in the fields for your provider below.
- Press Test connection and check what discovery would find.
- On the discovery step, set the scope and frequency and save.
A registry on a private network, such as a Harbor, Nexus or Artifactory server behind your firewall, needs an outpost. Choose it under Where it runs before you press Test connection, so the test and every pull happen inside your network.
The newest tag is always scanned. Add Extra tags when you need more, using globs such as v*.*. Each glob matches at most 3 tags.
What you should see
Your images appear under Resources as artifacts, and scans queue for each new digest.
Amazon ECR
Method: IAM role. No secret leaves your account, because Dwaar assumes a role you control.
The guide beside the form gives you two ways to create the role:
- Open CloudFormation quick-create, when Dwaar offers it. The stack
dwaar-ecr-readarrives with Dwaar's values filled in and creates the roledwaar-ecr-read. Copy its RoleArn output back into Dwaar. You never type the external id. - By hand, with the trust policy and the permissions policy to copy. Your external id and Dwaar's principal are there with copy buttons, for Terraform or the IAM console, and the permissions policy holds exactly the actions of the CloudFormation template: listing repositories and images and pulling images, nothing that can push, delete or change.
The external id is unique to your Dwaar tenant. Your role trusts Dwaar only when Dwaar presents it, so no other Dwaar customer can point a connection at your role.
| Field | Required | Value |
|---|---|---|
| Role ARN | Yes | The role Dwaar assumes, for example arn:aws:iam::<account-id>:role/dwaar-ecr-read. Its trust policy must name Dwaar's principal and your external id. |
| Regions | Yes | Comma-separated regions to discover, for example eu-west-1, us-east-1. |
Google Artifact Registry
Method: Service account key.
| Field | Required | Value |
|---|---|---|
| Project id | Yes | The Google Cloud project that holds the repositories. |
| Location | No | For example europe-west1. Leave empty for every location. |
| Service account key (JSON) | Yes | The key of a service account with roles/artifactregistry.reader on the project. Paste it, or choose the key file and Dwaar reads it in. |
Organizations created since May 2024 block service account key creation by default. If Google refuses to create the key, an organization policy administrator has to allow it for this project first.
Azure Container Registry
Method: Service principal.
| Field | Required | Value |
|---|---|---|
| Login server | Yes | The registry's login server, for example acme.azurecr.io. |
| Directory (tenant) id | No | The service principal's tenant. Without it Dwaar signs in with a registry username and password instead, which only works for the registry's admin user, and that user can also push. |
| Application (client) id or token name | Yes | The service principal's application id. Give it AcrPull on the registry. On a registry that uses attribute based access, also give it Container Registry Repository Reader and Container Registry Repository Catalog Lister, because AcrPull is ignored there. |
| Client secret or token password | Yes | The service principal's client secret. |
Use a service principal, not a repository-scoped token. A token cannot list the registry's repositories, so Test connection fails with it.
Docker Hub
Docker Hub offers two methods: Personal access token for a namespace, and Public image for one public image.
Personal access token
| Field | Required | Value |
|---|---|---|
| Namespace | Yes | The organization or user whose repositories Dwaar discovers. |
| Username | No | The organization name for an organization access token, your Docker ID for a personal one. Leave this and the token empty to discover public repositories only. |
| Token | No | An organization access token with Image Pull and Tag Read on the repositories and the organization scope Repository List, or a personal access token with Repo Read-only. |
On Docker Team or Business, prefer the organization access token: it belongs to the organization, not to a person who may leave. Do not skip Repository List. Without it Docker Hub quietly lists only the public repositories, and the test still passes.
Public image
For one public image, with no token of yours. Enter its name in Image, such as nginx, bitnami/redis or nginx:1.27, or paste its hub.docker.com address. Press Look up, then Add and scan.
With a tag, Dwaar follows that tag. Without one, it follows the newest pushed tag. A digest is refused, because Dwaar records the digest each tag points at on every discovery.
A public image connection follows that one image for good, and has no Replace credential. To scan another image, add another connection.
JFrog Artifactory
Method: Access token.
| Field | Required | Value |
|---|---|---|
| Server URL | Yes | Your Artifactory URL, without /artifactory. |
| Repository | No | A repository key. Leave empty to discover every Docker repository. |
| Access token | Yes | An identity or scoped access token with read on the repositories. API keys are deprecated, so do not use one. |
Harbor
Method: Robot account.
| Field | Required | Value |
|---|---|---|
| Server URL | Yes | Your Harbor URL. |
| Project | No | Leave empty to discover every project the account can see. |
| Robot account name | Yes | The full name with its prefix, for example robot$platform+dwaar for a project robot or robot$dwaar for a system robot. |
| Secret | Yes | The robot account secret. Give the robot Project: Read, Repository: List and Pull, and Artifact: List. A system robot that covers every project also needs Project: List. |
Sonatype Nexus
Method: User token.
| Field | Required | Value |
|---|---|---|
| Server URL | Yes | Your Nexus Repository URL. |
| Repository | No | Leave empty to discover every Docker repository. |
| Username or user token name | Yes | The user or token name. |
| Password or user token pass code | Yes | The matching secret. |
GitHub Packages
Method: Personal access token.
| Field | Required | Value |
|---|---|---|
| Organization or user | Yes | Whose container and npm packages Dwaar discovers. |
| Token | Yes | A classic token with read:packages. Fine-grained tokens cannot list packages yet, so a fine-grained token will not work here. |
Any other OCI registry
Method: Username and password. This works with any registry that implements the OCI Distribution API with the catalog endpoint.
| Field | Required | Value |
|---|---|---|
| Server URL | Yes | For example https://registry.acme.com. |
| Repository prefix | No | Keep only repositories under this prefix, for example platform/. Leave empty for all. |
| Username | No | Leave empty for anonymous access. |
| Password or token | No | The matching secret. |
Try this next
Connect the registry that holds your production images, then open one image under Resources and check its lineage. If it does not link back to a repository, you have found a gap in what you can trace, and that is worth knowing before an auditor asks.