Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.
AuthenticationKey Concepts

Authentication and identity tokens

Understand how Harness Artifacts authenticates humans and machines using PAT and service account tokens, and how RBAC applies to registry operations.

A registry without authentication is a public bucket. Anyone can read from it, and anyone can write to it. For most software teams, that is not acceptable. Internal packages contain proprietary logic. Dependency caches must stay free of tampered artifacts. Compliance frameworks require knowing exactly who pushed what and when.

Harness Artifacts uses token-based authentication for every private registry operation. Understanding how tokens work, when to use each type, and how identity affects pipeline permissions prevents the most common class of access errors.

Two token types

Harness issues two kinds of tokens, each tied to a different kind of identity.

Personal Access Tokens

A Personal Access Token (PAT) is tied to a human user account. When you authenticate with a PAT, Harness treats every operation as if that user performed it. The RBAC permissions of that user apply.

PATs are appropriate for interactive use: configuring your local Docker client, running CLI commands from your workstation, or testing a registry integration. They are not suitable for automated systems because they expire when the user's account is deactivated or when the token is explicitly revoked.

Service account tokens

A service account is a machine identity with its own RBAC permissions, independent of any human user. A service account token authenticates that machine identity.

Service account tokens are the correct choice for CI/CD pipelines, scheduled jobs, Kubernetes workloads, and any automated process that must run reliably regardless of which humans are available. When a human leaves the team, their PAT stops working; a service account is unaffected.

How tokens are used

Regardless of token type, the authentication mechanism is HTTP basic auth:

Token type
Username
Password

PAT

Your Harness account email address

The token value

Service account token

_token

The token value

Your package manager (Docker, npm, Maven, pip, etc.) stores these credentials and sends them on every request to pkg.harness.io. The registry validates the token and applies the RBAC permissions of the associated identity before allowing or denying the operation.

Token lifespan and scope

30-day scoped tokens from Setup Client

The Setup Client flow in the Harness UI generates a token scoped to the current registry. It expires after 30 days. This token is suitable for short-lived integrations, trying out a new registry, or temporary developer access. Because it is scoped, it cannot be used to access other registries.

Long-lived tokens from account settings

Tokens generated at the project or account level from Account Settings > API Keys carry a configurable expiry. A service account token for a production pipeline should have a defined rotation schedule rather than relying on the 30-day default.

Pipeline identity and why local pipelines can fail on schedule

One of the most confusing authentication failures happens when a pipeline runs successfully on a manual trigger but fails on a scheduled trigger with a 403 error. The cause is the pipeline identity model.

Trigger type
Pipeline runs as

Manual (you click Run)

The triggering user's RBAC permissions

Webhook, schedule, IDP, or bot trigger

The service account or bot principal's RBAC permissions

When you trigger a pipeline manually, it inherits your permissions. You have read access to the registry, so the pull succeeds. The scheduled run uses a service account that has not been granted that permission, so it fails.

The fix is to grant the service account the Artifact Management permissions it needs, not to expand your own permissions. This is also a security principle: production automation should use a dedicated service account with minimal permissions, not a human developer's credentials.

RBAC and registry scope

Artifact Management permissions in Harness control what an identity can do:

Permission
What it allows

View

Pull artifacts, browse the registry

Create / Edit

Push artifacts

Delete

Delete artifact versions

Permissions apply at the scope where the registry lives. A service account with View permission at the project scope can pull from registries in that project but not from registries in other projects.

Public registries and anonymous access

A registry set to Public visibility allows anonymous pulls. No token is required. Any client can pull from a public registry without authentication.

Pushing to a public registry always requires authentication, regardless of visibility setting. Harness does not allow anonymous writes.

Go to Set registry visibility to understand when to use public vs private visibility.

Use cases

Developer local CLI authentication

A developer configures their local Docker client once:

From that point, all pulls and pushes from their workstation authenticate as that developer. The 30-day token from Setup Client is appropriate here.

CI/CD pipeline using a service account

A CI pipeline that builds and pushes Docker images uses a dedicated service account. The service account token is stored as a secret in the CI system and passed to the build step as an environment variable. The pipeline never touches a human developer's credentials.

Kubernetes imagePullSecret

Kubernetes needs credentials to pull images from a private registry. Create a long-lived service account token, then create an imagePullSecret:

Attach the secret to your pod spec. Kubernetes uses the service account identity for all image pulls.

Last updated

Was this helpful?