Set up signing keys
Set up GPG or RSA signing keys for your Debian, Alpine, or Wolfi registry.
Follow this guide to set up repository signing end to end. Create a signing key, attach it to your registry, and configure clients to trust only signed packages.
Step 1: Create a signing key
To create a signing key, navigate to Registries Settings > Signing Keys, and then select Create Signing Key.
Choose how to create your key: generate a new key pair in Harness, or import a key you already use.
Generate a key
To generate a signing key, perform the following steps:
Select Generated as the key source.
Specify the Key Name. The name must be unique per scope (account, organization, or project).
Choose Type based on your registry:
GPG for Debian registries
RSA for Alpine and Wolfi registries
Select Algorithm:
RSA: Maximum compatibility. Required when Type is RSA.
Ed25519: Better performance on newer systems. Available only when Type is GPG.
Set Expiration (optional):
Never: Key remains valid indefinitely
Custom period: Specify validity (1 year, 2 years, 5 years)
Click Generate.
Harness creates the key pair and stores the private key securely. You can attach it to registries immediately or later.
Import a key
To import a signing key, store the private key content in a Harness Secret Manager secret. You can create a new secret or use an existing one.
To import a signing key, perform the following steps:
Select Imported as the key source.
Specify the Key Name. The name must be unique per scope (account, organization, or project).
Choose Type (GPG or RSA).
Provide the Private Key:
Option 1: Select an existing secret from your Harness account.
Option 2: Create a new secret. Enter a Name, paste the complete Secret Text (entire key including headers), and optionally add Metadata (description, tags).
If the key is protected by a passphrase, provide the Passphrase:
Option 1: Select an existing passphrase secret from your Harness account.
Option 2: Create a new secret. Enter a Name, enter the passphrase as Secret Text, optionally add Metadata, and then click Save.
Click Import.
Harness validates the key format and algorithm before storing it securely.
Step 2: Attach key to registry
Attach the signing key from the registry configuration so Harness can sign repository metadata on upload.
To attach a signing key to a registry, perform the following steps:
In the Artifact Registry module, select Registries.
Select your registry.
Select the Configuration tab.
In the Signing keys section, select Edit.
Toggle Signing enabled on.
Select your signing key from the dropdown.
Click Update.
After you attach a key, Harness signs repository metadata on every package upload. Signing is optional; without an attached key, metadata remains unsigned.
Step 3: Configure clients
Clients must trust your public key before installing packages. Open your registry and select Setup Client to get commands pre-filled with the following:
Account ID
Registry name
Signing key URL
Credentials
Debian registries (apt)
To install Debian packages from the registry, perform the following steps:
Generate identity token
An identity token serves as the password for accessing packages. Click Setup Client to generate an identity token.
Configure repository signing key
Download and configure the GPG signing key for package verification.
Download the public signing key:
Convert the key to GPG keyring format:
Configure APT repository
Add the Debian repository to your APT sources.
Add the repository to APT sources:
Replace <DISTRIBUTION> (for example, stable, bookworm, jammy) and <COMPONENT> (for example, main, contrib).
Create or edit the auth config file:
Add the following content:
Use the identity token from Generate identity token as <TOKEN>.
Update the APT cache:
Install or download a Debian package
Alpine and Wolfi registries (apk)
Self-published indexes are signed with RSA256. To install packages from the registry on each client machine, perform the following steps:
Generate identity token
An identity token serves as the password for authenticating with the registry. Click Setup Client to generate an identity token.
Configure repository signing key
Download and install the RSA signing key for package verification.
Download the public signing key:
Install the key to the apk trusted keys directory:
Configure apk repository
Point apk at the registry. Indexes are signed with RSA256. Use the Alpine URL with branch and repository segments, or the Wolfi URL without those segments.
Add the registry to
/etc/apk/repositories:
Replace the following placeholders:
<USERNAME>,<TOKEN>: Your Harness credentials (use the identity token as<TOKEN>)<BRANCH>,<REPOSITORY>: The Alpine branch and repository path from Setup Client
Replace <USERNAME> and <TOKEN> with your Harness credentials (use the identity token as <TOKEN>).
Refresh the index:
Install a package
Verify setup
Confirm that the client trusts the signing key by installing a package from the registry.
Test Debian (apt)
After sudo apt-get update and sudo apt-get install, success means there are no signature verification errors and the package installs normally.
Test Alpine and Wolfi (apk)
Success means there are no UNTRUSTED signature errors and the package installs normally.
Troubleshooting
Next steps
Manage signing keys: View, detach, and delete keys.
Configure expiration notifications: Set up expiration alerts.
Last updated
Was this helpful?