Skip to content

Usage Guide

Siddharth Srinivasan edited this page May 14, 2021 · 3 revisions

To view all the available options and commands which can be passed to sec-vault, you can simply query the help option:

$ sec-vault --help
usage: sec-vault [-h] [--create-vault] --vault-file VAULT_FILE --cipher-suite
                 CIPHER_SUITE --record-type RECORD_TYPE
                 [--add-record-schema-file RECORD_PATH] [--show-cipher-params]
                 [--add-entry] [--del-entry] [--modify-entry] [--modify-field]
                 [--display-vault] [--display-format DISPLAY_FORMAT]
                 [--search-vault] [--overwrite-cfg] [--overwrite-vault]
                 [--cipher-config-path CFG_PATH]

Password management CLI tool

optional arguments:
  -h, --help            show this help message and exit
  --create-vault        Create Vault file
  --vault-file VAULT_FILE
                        Path to secure vault file
  --cipher-suite CIPHER_SUITE
                        Specify the cipher backend, one of crypto_backend,
                        crypto_fernet, crypto_openssl, gpg
  --record-type RECORD_TYPE
                        Specify the record type, one of identity, login,
                        raw_text, bank_card, business_card
  --add-record-schema-file RECORD_PATH
                        Provide a new schema file path in json format
  --show-cipher-params  Display supported config parameters for given cipher
                        suite
  --add-entry           Add a new record for secure storage into the vault
  --del-entry           Delete a record in the vault
  --modify-entry        Modify a record in the vault
  --modify-field        Modify a field of a record in the vault
  --display-vault       View entire vault contents
  --display-format DISPLAY_FORMAT
                        Options: yaml, json or table format
  --search-vault        Query vault records for a search term
  --overwrite-cfg       Overwrite cfg file
  --overwrite-vault     Overwrite vault file
  --cipher-config-path CFG_PATH
                        Path to YAML-based parameter file

Following sample commands can be invoked to interact with a vault file:

  • Vault Creation:
    • sec-vault --create-vault --cipher-suite <CIPHER_SUITE> --vault-file /path/to/secret.vault
  • Entry addition
    • sec-vault --add-entry --record-type <RECORD_TYPE> --cipher-suite <CIPHER_SUITE> --vault-file /path/to/secret.vault
  • Entry removal
    • sec-vault --del-entry --record-type <RECORD_TYPE> --cipher-suite <CIPHER_SUITE> --vault-file /path/to/secret.vault
  • Search a pattern against stored records
    • sec-vault --search-vault <SEARCH_TERM> --record-type <RECORD_TYPE> --cipher-suite <CIPHER_SUITE> --vault-file /path/to/secret.vault
  • Display vault contents in json
    • sec-vault --display-vault --display-format json --record-type <RECORD_TYPE> --cipher-suite <CIPHER_SUITE> --vault-file /path/to/secret.vault
Clone this wiki locally