Skip to main content

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​

  1. Open Integrations, choose your registry, then Add connection.
  2. Name the connection after the account, project or registry it covers.
  3. Follow the guide beside the form to create the credential, and fill in the fields for your provider below.
  4. Press Test connection and check what discovery would find.
  5. 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-read arrives with Dwaar's values filled in and creates the role dwaar-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.
note

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.

FieldRequiredValue
Role ARNYesThe 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.
RegionsYesComma-separated regions to discover, for example eu-west-1, us-east-1.

Google Artifact Registry​

Method: Service account key.

FieldRequiredValue
Project idYesThe Google Cloud project that holds the repositories.
LocationNoFor example europe-west1. Leave empty for every location.
Service account key (JSON)YesThe 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.

FieldRequiredValue
Login serverYesThe registry's login server, for example acme.azurecr.io.
Directory (tenant) idNoThe 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 nameYesThe 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 passwordYesThe 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​

FieldRequiredValue
NamespaceYesThe organization or user whose repositories Dwaar discovers.
UsernameNoThe 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.
TokenNoAn 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.

FieldRequiredValue
Server URLYesYour Artifactory URL, without /artifactory.
RepositoryNoA repository key. Leave empty to discover every Docker repository.
Access tokenYesAn identity or scoped access token with read on the repositories. API keys are deprecated, so do not use one.

Harbor​

Method: Robot account.

FieldRequiredValue
Server URLYesYour Harbor URL.
ProjectNoLeave empty to discover every project the account can see.
Robot account nameYesThe full name with its prefix, for example robot$platform+dwaar for a project robot or robot$dwaar for a system robot.
SecretYesThe 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.

FieldRequiredValue
Server URLYesYour Nexus Repository URL.
RepositoryNoLeave empty to discover every Docker repository.
Username or user token nameYesThe user or token name.
Password or user token pass codeYesThe matching secret.

GitHub Packages​

Method: Personal access token.

FieldRequiredValue
Organization or userYesWhose container and npm packages Dwaar discovers.
TokenYesA 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.

FieldRequiredValue
Server URLYesFor example https://registry.acme.com.
Repository prefixNoKeep only repositories under this prefix, for example platform/. Leave empty for all.
UsernameNoLeave empty for anonymous access.
Password or tokenNoThe 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.