Sync Command
Synchronizes selected keys from Keeper Vault to an external secrets manager
sync command
Description: Sync secrets from Keeper Vault to an external secrets manager.
ksm sync --credentials <UID> --type [aws|azure|gcp|json] [--dry-run] [--preserve-missing] --map <KEY NOTATION>...
parameters:
-t, --typeType of the target key/value storage. Available types are:aws- AWS Secrets Managerazure- Azure Key Vaultgcp- GCP Secret Managerjson- lists all pending sync operations including both source and destination values
-m, --map <KEY NOTATION>Map a destination key name to a Keeper notation URI.-c, --credentials <uid>UID of the Keeper record that contains credentials for the destination storage. Share this record with the Keeper Secrets Manager Application.
optional parameters:
-n, --dry-runRun without making changes. The output shows whether each destination secret exists and whether its value would change (dstExists,dstDiffers). The output does not include live destination values.-p, --preserve-missingPreserve the destination value when the source secret is deleted.
AWS-Specific Options
-r,--record <RECORD>Sync individual records by UID or title. Specify this option more than once to sync multiple records. If the CLI resolves a name by title instead of UID, it prints a warning to stderr. Titles can change. Use UIDs for scheduled syncs.-f,--folder <FOLDER>Sync all records from a folder, non-recursive. If the CLI resolves a name by path or folder name instead of UID, it prints a warning to stderr. Folder names can change. Use UIDs for scheduled syncs.-fr,--folder-recursive <FOLDER>Sync all records from a folder and all subfolders recursively. If the CLI resolves a name by path or folder name instead of UID, it prints a warning to stderr. Folder names can change. Use UIDs for scheduled syncs.-px,--prefix <PREFIX>Prefix added to every AWS secret name that the CLI derives from a record title. This option is required when you use--record,--folder, or--folder-recursive. The prefix must end in a separator character that is not a letter or digit (for examplekeeper/ormyapp-). The CLI rejects a prefix that does not end this way.-rj,--raw-jsonStore the full JSON payload in the AWS secret. The format matches the output ofsecret get <UID> --json.
See the AWS Secrets Manager Sync documentation for detailed examples.
Automation with Crontab
Use cron to run ksm sync on a schedule.
Example 1: Simple Daily Sync
Sync once per day at 2 AM:
Example 2: Multi-Sync Shell Script
To run multiple sync operations with different mappings, create a shell script:
Create /home/user/scripts/ksm-sync-all.sh:
Make the script executable:
Add to crontab to run every 6 hours:
Sync Types
Select a provider to see the integration documentation.
Last updated

