Custom Record Types

Utilizing custom record types in the Keeper Secrets Manager CLI

Overview

The Keeper Secrets Manager CLI has a list of default record types that are available for use. The CLI also allows for the creation of records using custom record types.

More information about Custom Record Types is found in the Enterprise Guide.

In order to create records that use custom record types, the schema needs to be defined within the CLI. This is done by exporting the custom record type using Keeper Commander.

The below will export the "My Custom" record type, as JSON, to the file my_record_type.json.

My Vault> rti --format json -lr "My Custom" --output my_record_type.json

The JSON file should be copied into a directory called record_type. The location of the record_type directory is the same as the location of the keeper.ini file. The record_type doesn't need to be in the same directory as the keeper.ini, it just need to be in locations where the CLI will check for the keeper.ini.

  • The path defined by the environment 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

An alternative directory can be set via the config command.

$ ksm config record-type-dir -d /path/to/my/record/type/schemas

Once the file is copied into the record_type directory, it will be visible in the list of available record types.

 $ ksm secret template record -l
 Record Type
 ------------------------
 login
 bankAccount
 address
 ...
 My Custom

At this point the custom record type can be used to create a new record.

$ ksm secret add field --sf XXXX --rt "My Custom" -t "My Record" \
    "login=jsmith" "password=XXXX" "url=https://localhost"

If the custom record type name contains spaces, the name will need to be surrounded by quotes.

All custom record type name need to be unique. An error will occur if a record type with the same name has already been imported. You also cannot override the default record types.

Last updated