Harness CI Plugin
Keeper Secrets Manager integration into Harness CI for dynamic secrets retrieval.

Features
Retrieve secrets from the Keeper Vault within the Harness CI pipeline
Set secret credentials as build arguments in Harness CI pipeline
Copy secure files from the Keeper Vault
Plugin URL: https://plugins.drone.io/plugins/keeper-plugin
Prerequisites
Keeper Secrets Manager Requirements
KSM Access
Active Keeper Secrets Manager subscription (Quick Start Guide)
Add-on Enabled
Secrets Manager add-on enabled for your Keeper account
Role Membership
Member of a Role with Secrets Manager enforcement policy enabled
KSM Application
A configured Keeper Secrets Manager Application with secrets shared to it
KSM Configuration
An initialized configuration (Base64 token or One-Time Access Token or JSON config file)
Harness CI Requirements
Active Harness account
A pipeline setup of Harness CI
Understanding of Harness CI secrets management
Install the Keeper Plugin
Configuration Types
The plugin supports three authentication methods. Choose the one that fits your security requirements:
One-Time Access Token (OTAT)
Text Secret
Single-use, highest security
Base64 Token
Text Secret
Reusable, standard security
JSON Config File
File Secret
Full configuration, reusable
Setup Guide
Step 1: Configure Keeper Vault
Create a Shared Folder in Keeper Vault
Create records containing your secrets inside the shared folder
Create a Secrets Manager Application
Generate your preferred credential type:
One-Time Access Token (OTAT)
Base64 Token or JSON Config
Step 2: Create Harness CI Secret
Navigate to: Project → Project Setup → Secrets → + New Secret
Option A: One-Time Access Token (Text Secret)
Click + New Secret → Text
Configure:
Secret Name:
keeper_otat_secretSecret Value: Paste the token (e.g.,
US:xxxxx...)Scope: Project (recommended)
Click Save
Option B: Base64 Token (Text Secret)
Click + New Secret → Text
Configure:
Secret Name:
keeper_base64_secretSecret Value: Paste the base64-encoded token
Scope: Project (recommended)
Click Save
Option C: JSON Config File (File Secret)
Click + New Secret → File
Configure:
Secret Name:
keeper_ksm_config_fileUpload File: Select your KSM JSON config file
Scope: Project (recommended)
Click Save
Expected JSON structure:
Step 3: Reference in Pipeline
Use the following syntax to reference your secret:
Quick Start
Pipeline Example
Once the pipeline execution end then we will be able to see secrets printed in Print secrets step logs.

Secrets Configuration
Keeper Notation Syntax
The secrets input uses Keeper Notation to specify which secrets to retrieve:
Notation Format
record_uid
The unique identifier of the Keeper record
selector
Type of data: field, custom_field, or file
field_name
Name of the field or file to retrieve
destination_name
Output filename in /harness/secrets/
Selector Types
field
Standard record fields (login, password, etc.)
/harness/secrets/<destination>
custom_field
Custom fields defined in the record
/harness/secrets/<destination>
file
File attachments
/harness/secrets/<destination>
Examples
Local Docker Runner Configuration
When using runtime: type: docker (local runner) instead of Harness Cloud, you must configure Shared Paths to share data between pipeline on local:
Security Best Practices
Use One-Time Access Tokens
Generate fresh tokens for each pipeline run when possible
Clean Up Secret Files
Delete secret files after use in pipeline steps
Appropriate Scope
Use project-level scope unless broader access is required
Limit Access
Restrict who can edit pipelines (editors can read secrets)
Secret Masking - Hiding Secrets from Logs
Harness CI automatically masks secrets in logs when printed to console. However:
This only obscures output logs
Pipeline editors can potentially extract secrets
Always follow the principle of least privilege
Troubleshooting
Common Issues
KSM config is required
Secret not found or expression incorrect
Verify secret name matches exactly (case-sensitive)
Missing required fields
JSON config incomplete
Ensure JSON contains hostname, clientId, privateKey
Expression not resolved
Secret scope mismatch
Ensure secret scope matches pipeline scope
Token already used
One-time tokens are single-use
Generate a new OTAT for each run
Issue: Pipeline Works on Cloud but Fails Locally
Symptoms: Fetch_Keeper_Secrets succeeds but next step fails reading /harness/secrets/
Causes & Solutions:
Secret name mismatch
Plugin writes:
> USERNAMEand> PASSWORDRun step must check:
/harness/secrets/USERNAMEand/harness/secrets/PASSWORD
Workspace not shared
Add
sharedPaths: /harnessto your stage spec (see Local Docker Runner Configuration)
Debugging: Verify Plugin Output
Add a debug step after the plugin:
If no files appear, check:
Plugin configuration (secret names)
Workspace sharing (for local runner)
ksm_configsetting (map to PLUGIN_KSM_CONFIG)
Last updated

