LogoLogo
KeeperPAM and Secrets Manager
KeeperPAM and Secrets Manager
  • KeeperPAM
  • Privileged Access Manager
    • Setup Steps
    • Quick Start: Sandbox
    • Getting Started
      • Architecture
        • Architecture Diagram
        • Vault Security
        • Router Security
        • Gateway Security
        • Connection and Tunnel Security
      • KeeperPAM Licensing
      • Enforcement Policies
      • Vault Structure
      • Record Linking
      • Applications
      • Devices
      • Gateways
        • Creating a Gateway
        • Docker Installation
        • Linux Installation
        • Windows Installation
        • Auto Updater
        • Alerts and SIEM Integration
        • Advanced Configuration
          • Gateway Configuration with AWS KMS
          • Gateway Configuration with Custom Fields
      • PAM Configuration
        • AWS Environment Setup
        • Azure Environment Setup
        • Local Environment Setup
      • PAM Resources
        • PAM Machine
          • Example: Linux Machine
          • Example: Azure Windows VM
        • PAM Database
          • Example: MySQL Database
          • Example: PostgreSQL Database
          • Example: Microsoft SQL Server Database
        • PAM Directory
        • PAM Remote Browser
        • PAM User
      • Sharing and Access Control
      • Just-In-Time Access (JIT)
    • Password Rotation
      • Rotation Overview
      • Rotation Use Cases
        • Azure
          • Azure AD Users
          • Azure VM User Accounts
          • Azure Managed Database
            • Azure SQL
            • Azure MySQL - Single or Flexible Database
            • Azure MariaDB Database
            • Azure PostgreSQL - Single or Flexible Database
          • Azure App Secret Rotation
        • AWS
          • IAM User Password
          • Managed Microsoft AD User
          • EC2 Virtual Machine User
          • IAM User Access Key
          • Managed Database
            • AWS RDS for MySQL
            • AWS RDS for SQL Server
            • AWS RDS for PostgreSQL
            • AWS RDS for MariaDB
            • AWS RDS for Oracle
        • Local Network
          • Active Directory or OpenLDAP User
          • Windows User
          • Linux User
          • macOS User
          • Database
            • Native MySQL
            • Native MariaDB
            • Native PostgreSQL
            • Native MongoDB
            • Native MS SQL Server
            • Native Oracle
        • SaaS Accounts
          • Okta User
          • Snowflake User
          • Rotate Credential via REST API
        • Network Devices
          • Cisco IOS XE
          • Cisco Meraki
      • Service Management
      • Post-Rotation Scripts
        • Inputs and Outputs
        • Attaching Scripts
        • Code Examples
    • Connections
      • Getting Started
      • Session Protocols
        • SSH Connections
        • RDP Connections
        • RBI Connections
        • MySQL Connections
        • SQL Server Connections
        • PostgreSQL Connections
        • VNC Connections
        • Telnet Connections
      • Examples
        • SSH Protocol - Linux Machine
        • RDP Protocol - Azure Virtual Machine
        • MySQL Protocol - MySQL Database
        • PostgreSQL Protocol - PostgreSQL Database
    • Tunnels
      • Setting up Tunnels
    • Remote Browser Isolation
      • Setting up RBI
        • URL Patterns & Resource URL Patterns
        • Browser Autofill
    • Session Recording & Playback
    • SSH Agent
      • Integration with Git
    • Discovery
      • Discovery Basics
      • Discovery using Commander
      • Discovery using the Vault
    • On-Prem Connection Manager
    • References
      • Port Mapping
      • Setting up SSH
      • Setting up WinRM
      • Setting up SQL Server
      • Database Import and Export
      • Installing sqlcmd on Linux
      • Installing Docker on Linux
      • Creating KSM App for Rotation
      • Active Directory Least Privilege
      • Event Reporting
      • Importing PAM Records
      • Managing Rotation via CLI
      • Commander SDK
      • Cron Spec
      • Preview Access
  • Endpoint Privilege Manager
    • Overview
    • Setup
    • Deployment
    • Policies
    • Managing Requests
  • FAQs
  • Secrets Manager
    • Secrets Manager Overview
    • Quick Start Guide
    • About KSM
      • Architecture
      • Terminology
      • Security & Encryption Model
      • One Time Access Token
      • Secrets Manager Configuration
      • Keeper Notation
      • Event Reporting
      • Field/Record Types
    • Secrets Manager CLI
      • Profile Command
      • Init Command
      • Secret Command
      • Folder Command
      • Sync Command
      • Exec Command
      • Config Command
      • Version Command
      • Misc Commands
      • Docker Container
      • Custom Record Types
    • Password Rotation
    • Developer SDKs
      • Python SDK
      • Java/Kotlin SDK
        • Record Field Classes
      • JavaScript SDK
      • .NET SDK
      • Go SDK
        • Record Field Classes
      • PowerShell
      • Vault SDKs
    • Integrations
      • Ansible
        • Ansible Plugin
        • Ansible Tower
      • AWS CLI Credential Process
      • AWS Secrets Manager Sync
      • AWS KMS Encryption
      • Azure DevOps Extension
      • Azure Key Vault Sync
      • Azure Key Vault Encryption
      • Bitbucket Plugin
      • Docker Image
      • Docker Runtime
      • Docker Writer Image
      • Entrust HSM Encryption
      • Git - Sign Commits with SSH
      • GitHub Actions
      • GitLab
      • Google Cloud Secret Manager Sync
      • Google Cloud Key Management Encryption
      • Hashicorp Vault
      • Heroku
      • Jenkins Plugin
      • Keeper Connection Manager
      • Kubernetes External Secrets Operator
      • Kubernetes (alternative)
      • Linux Keyring
      • Octopus Deploy
      • Oracle Key Vault Encryption
      • PowerShell Plugin
      • ServiceNow
      • TeamCity
      • Teller
      • Terraform Plugin
        • Terraform Registry
      • Windows Credential Manager
      • XSOAR
    • Troubleshooting
  • Commander CLI
    • Commander Overview
    • Installation and Setup
      • CLI Installation on Windows
      • CLI Installation on macOS
      • CLI Installation on Linux
      • Python Developer Setup
      • .NET Developer Setup
      • PowerShell Module
      • Logging in
      • Configuration and Usage
        • AWS Secrets Manager
        • AWS Key Management Service
      • Automating with Windows Task
      • Automating with AWS Lambda
      • Uninstallation
    • Command Reference
      • Import and Export Data
        • Import/Export Commands
        • CyberArk Import
        • LastPass Data Import
        • Delinea / Thycotic Secret Server Import
        • Keepass Import
        • ManageEngine Import
        • Myki Import
        • Proton Pass Import
        • CSV Import
        • JSON Import
      • Reporting Commands
        • Report Types
      • Enterprise Management Commands
        • Creating and Inviting Users
        • Compliance Commands
        • Breachwatch Commands
        • SCIM Push Configuration
      • Record Commands
        • Record Type Commands
        • Creating Record Types
      • Sharing Commands
      • KeeperPAM Commands
      • Connection Commands
        • SSH
        • SSH Agent
        • RDP
        • Connect Command
        • SFTP Sync
      • Secrets Manager Commands
      • MSP Management Commands
      • Miscellaneous Commands
      • Password Rotation
        • Password Rotation Commands
        • AWS Plugin
        • Azure Plugin
        • Microsoft SQL Server Plugin
        • MySQL Plugin
        • Oracle Plugin
        • PostgreSQL Plugin
        • PSPasswd Plugin
        • SSH Plugin
        • Unix Passwd Plugin
        • Windows Plugin
        • Active Directory Plugin
        • Automatic Execution
    • Service Mode REST API
    • Troubleshooting
Powered by GitBook

Company

  • Keeper Home
  • About Us
  • Careers
  • Security

Support

  • Help Center
  • Contact Sales
  • System Status
  • Terms of Use

Solutions

  • Enterprise Password Management
  • Business Password Management
  • Privileged Access Management
  • Public Sector

Pricing

  • Business and Enterprise
  • Personal and Family
  • Student
  • Military and Medical

© 2025 Keeper Security, Inc.

On this page
  • profile command
  • init
  • setup
  • list
  • export
  • import
  • active
  • Profiles within Containers
  • Default INI Filename

Was this helpful?

Export as PDF
  1. Secrets Manager
  2. Secrets Manager CLI

Profile Command

Setup and initialization of the Keeper Secrets Manager device profile

profile command

Description: Initialize and switch between device profiles. In order to support multiple environments on the same device, you can also switch between Secrets Manager device profiles.

Parameters:

Sub-command and options to run

format: ksm profile <sub-command>

Sub-Commands:

Sub-Command

Description

init

Initialize a new client device profile

setup

Setup a new profile from 3rd party external secrets manager like AWS.

list

List profiles that have been created, and note active profile

export

Export a configuration profile

import

Create a new configuration from an exported encrypted profile

active

Sets the active configuration profile

init

Initialize a client device profile.

ksm profile init

The file keeper.ini file will be created in your current working directory. For the Windows or macOS binary applications, the keeper.ini will be created in the users home directory (${HOME} or $env:USERPROFILE environment variables). The keeper.ini can be moved to the following locations:

  • The path defined by the environmental variable KSM_INI_DIR

  • The current directory

  • The user's home directory

    • ${HOME}

    • ${HOME}/.config/ksm

    • $env:USERPROFILE

  • Various system directories

    • /etc

    • /etc/ksm

    • /etc/keeper

    • $env:APPDATA/Keeper

    • $env:ProgamData/Keeper

    • $env:ProgramFiles/Keeper

Parameters:

  • -t, --token <token> one-time access token

  • -h, --hostname <XX> destination region

    Defaults to US region. Customers hosted in other regions must set this value:

    • US (United States)

    • EU (Europe)

    • AU (Australia)

    • JP (Japan)

    • CA (Canada)

    • US_GOV (GovCloud)

  • --ini-file <FILENAME> save the new profile to this file

  • -p, --profile-name <NAME> set profile name If not provided, the profile will be set as "default"

Typically, you will be initializing the KSM CLI with a token created in the vault or in Keeper Commander. For example:

ksm profile init --token XX:XXXXXXXX

To avoid exposing the token on the command line use KSM_CLI_TOKEN environment variable. For example:

ksm profile init --ini-file=/tmp/custom.ini --profile=non_default

Usage of KSM_CLI_TOKEN environment variable to provide one-time token allows for selecting a custom INI file and custom profile (to create/overwrite) and can be overridden by --token option from command line.

My Vault> secrets-manager client add --app MyApplicationName

setup

Setup a new profile to be loaded from external storage like the AWS Secrets Manager. This is ideal when using Keeper Secrets Manager CLI from a cloud instance. Using this method of authentication adds additional layers of security.

There are 3 ways of integrating with external storage providers like AWS:

  • EC2 instance role (recommended)

  • AWS profile credentials

  • AWS custom keys

Method 1: EC2 instance role

To initialize the KSM CLI profile on an EC2 instance using the AWS EC2 instance role:

ksm profile setup --type=aws

This creates a keeper.ini file which defines the secret key in AWS. For example:

....

[_default]
storage = aws
provider = ec2instance
secret = ksm-config

By default, the secret key is assumed to be called ksm-config. You can specify a different key value by editing the keeper.ini file or using the --secret option. Example:

ksm profile setup --type=aws --secret my-ksm-config

Method 2: AWS profile credentials

For example:

ksm profile setup --type=aws --secret=ksm-config --credentials=profile --credentials-profile=default

Method 3: AWS custom keys

The KSM CLI can be configured to use a specific AWS Access Key / Secret Key pair. In this scenario, the Access Key and Secret Key will be stored locally in the keeper.ini file.

For example:

ksm profile setup --type=aws --secret=ksm-config --credentials=keys --aws-access-key-id XXX --aws-secret-access-key XXX --region XXX

An additional flag --fallback allows you to specify falling back to the default profile (from the AWS local configuration) if the initial credentials fail.

Finishing the KSM CLI setup

My Vault> secrets-manager client add --app "My KSM App" --config-init b64

Successfully generated Client Device
====================================

Initialized Config: [Base64 Config....]

Copy the provided configuration for use in the next step.

In order for this KSM device to authenticate against Keeper Secrets Manager, the KSM configuration value in base64 format must be populated into the AWS Secrets Manager. For example, using the AWS CLI:

aws secretsmanager create-secret --name ksm-config --secret-string '[Base64 Config]'

Now, you can verify that KSM CLI works and can access secrets from your vault using:

ksm secret list

 UID                     Record Type          Title
 ----------------------- -------------------- --------------------------
 n9SdOX1cEyMj9Ttj3lsjYQ  pamUser              IAM Account: demouser
 WfxgS6E_bY_tzdIChYIsAA  login                Amazon AWS - john
 toAfybW5SsbhRT9LtZ7oyg  serverCredentials    QA Server

Additional setup options

--ini-file <FILENAME> save the new profile to this file instead of keeper.ini. -p, --profile-name <NAME> set profile name. If not provided, the profile will be set as "default"

list

List all available profiles for the current Client Device.

ksm profile list

Example:

$ ksm profile list

  Active   Profile
 ======== ===============
           Production
  *        Test Server 1
           Test Server 2
           Local Dev

export

Export the current profile into a base64-encoded string.

ksm profile export [--plain] [--file-format] [PROFILE NAME]

optional parameters:

  • --plain Export profile without base64-encoding the string.

  • --file-format Export a profile to a specific file format. Available formats are:

    • ini - To be used by another instance of the CLI.

    • json - Can be used by the CLI and other Developer SDKs.

Example

$ ksm profile export my_profile

Note: When using an external storage provider for KSM configuration, the profile will not be exportable.

import

Import a client device profile from an encrypted base64-encoded string.

ksm profile import [--output-file "INI filename"] <BASE64 CONFIG>

optional parameters:

  • --output-file <INI filename> Where to create the INI configuration file. If not set, will be create in current directory.

$ ksm profile import --output-file=my_profile BASE64_ENC_CONFIG

active

Set the currently active profile for this client device.

ksm profile active <PROFILE NAME>

Example:

$ ksm profile active production

production is now the active profile.

Profiles within Containers

If you are running the CLI inside of a containerized environment, you might not have the ability to initialize a profile. If no INI config file is found and the environment variable KSM_TOKEN is found, a default profile will be auto-generated. A INI config file will be created and stored in the current working directory. That can be overridden with the environment variable KSM_INI_DIR.

Default INI Filename

The default name of the ini file is keeper.ini, however this can overridden by using the KSM_INI_FILE environment variable. By using KSM_INI_DIR and KSM_INI_FILE environment variables you can completely change the location and name of the INI configuration file.

PreviousSecrets Manager CLINextInit Command

Last updated 6 months ago

Was this helpful?

As described in the , you can create a token from the Commander CLI or from the Keeper Vault interface. For example:

For this method, you need to install Keeper Secrets Manager CLI on a EC2 instance which has been configured with a role that has permission to read specific AWS Secrets Manager secrets. We recommend setting up an EC2 role policy that has the least permission available, to only read specific keys. about AWS Secrets Manager access controls.

The KSM CLI can be configured to use a specific AWS profile that has been previously initialized on this device with the aws configure .

For this method, the AWS profile credentials should be assigned to a role which is limited to only read specific keys from the AWS Secrets Manager. about AWS Secrets Manager access controls.

To complete the setup, a base64 KSM configuration value must be generated from the Keeper Vault interface or the Keeper Commander CLI. This is described in the .

For example, using the , this can be generated using a command such as the one below:

Quick Start Guide
Learn more
command
Learn more
Quick Start Guide
Commander CLI