Credentials File Encryption

NetObserv SNMP Trap supports easy and secure trap listener credentials file encryption using SOPs and industry-standard AGE.

Getting Started

Environmental Dependencies

  1. Ensure sopsarrow-up-right is installed in your local environment:

    # Change sops-v3.8.1.linux.amd64 if needed based on your environment
    curl -LO https://github.com/getsops/sops/releases/download/v3.8.1/sops-v3.8.1.linux.amd64
    sudo mv sops-v3.8.1.linux.amd64 /usr/local/bin/sops
    sops --version # to verify install
  2. Also ensure agearrow-up-right is installed in your local environment to edit via CLI:

    sudo apt install age # Debian based linux
    brew install age # macos
    age --version # to verify install

Trap Listener Credentials Encryption Configuration

Please visit Trap Listener Credentials Encryptionarrow-up-right to learn more.

Tip: Always keep a secured backup of a non-encrypted version of the credentials file in case of any issues.

Setup

The easiest and most recommended way to get started is to simply set the following as below:

The following behavior will occur when the Trap collector is next restarted:

  1. Generate password protected age keys at the configured credentials file paths.

  2. Encrypt trap listener credential yaml files using those keys.

Once successfully encrypted with sops, the following listener credential file:

  • Will resemble the yaml below if using the default sops setting for EF_INPUT_TRAP_LISTENER_CREDENTIALS_SECURE_STORE_TYPE:

-Otherwise, if EF_INPUT_TRAP_LISTENER_CREDENTIALS_SECURE_STORE_TYPE is set as standard, the entire file will be encrypted:

Editing Encrypted Files

SOPs

Note: Encrypted files should not be manually edited without using the SOPs CLI editor.

To securely edit trap listener credential files, please use the SOPs CLI:

  • Non-password protected private key:

  • Password protected private key:

These commands will decrypt the file in memory and open with a text editor of your choice. By default, the editor used will be vim:

sops editor vim
  • Using nano instead of vim:

Once changes are made, save and exit to update the encrypted file stored on the disk drive.

Standard AGE

To securely edit trap listener credential files, please follow the below steps:

  1. Decrypt the file:

  2. Edit the decrypted file using your preferred text editor.

  3. Encrypt the file:

  4. Remove the decrypted file:

  5. Restart the Trap collector to apply the changes.

File Encryption Configuration Options

EF_INPUT_TRAP_LISTENER_CREDENTIALS_SECURE_STORE_ENABLE

Specifies whether the credential yaml files located in the directory specified by EF_INPUT_TRAP_LISTENER_CREDENTIALS_DIRECTORY_PATH will be encrypted.

  • Valid Values

    • true, false

  • Default

    • false

EF_INPUT_TRAP_LISTENER_CREDENTIALS_SECURE_STORE_CREATE

If credentials encryption is enabled (EF_INPUT_TRAP_LISTENER_CREDENTIALS_SECURE_STORE_ENABLE is true), the collector will create a new local keystore when set to true. This includes creating new AGE keys and encrypting all yml files located in the directory configured via EF_INPUT_TRAP_LISTENER_CREDENTIALS_DIRECTORY_PATH.

  • Valid Values

    • true, false

  • Default

    • false

EF_INPUT_TRAP_LISTENER_CREDENTIALS_SECURE_STORE_TYPE

If device file encryption is enabled (EF_INPUT_TRAP_LISTENER_CREDENTIALS_SECURE_STORE_ENABLE is true) this setting specifies the type of encryption manager the user wants to use. The two options are sops and standard. sops is the default option. It will only encrypt the configuration values of the configuration file, leaving the file structure intact. standard will simply encrypt the entire configuration file using AGE encryption.

  • Valid Values

    • sops, standard

  • Default

    • sops

EF_INPUT_TRAP_LISTENER_CREDENTIALS_SECURE_STORE_PASSWORD

The file specified in EF_INPUT_TRAP_LISTENER_CREDENTIALS_SECURE_STORE_PRIVATE_KEY_FILE_PATH can be encrypted for added security. If used in conjunction with EF_INPUT_TRAP_LISTENER_CREDENTIALS_SECURE_STORE_CREATE, then the keystore will be configured with a password protected private key.

  • Default

    • ''

EF_INPUT_TRAP_LISTENER_CREDENTIALS_SECURE_STORE_PRIVATE_KEY_FILE_PATH

Sets the filepath location of the private key file. If used in conjunction with EF_INPUT_TRAP_LISTENER_CREDENTIALS_SECURE_STORE_CREATE, then the private key used in the keystore will be generated at this location.

  • Default

    • /etc/elastiflow/snmp/traps/.age/key.age

Note: If using Trap collector generated keys, do not delete or modify the key files. Doing so will result in the loss of the ability to decrypt the credentials.

EF_INPUT_TRAP_LISTENER_CREDENTIALS_SECURE_STORE_PUBLIC_KEY_FILE_PATH

Sets the filepath location of the public key file. If used in conjunction with EF_INPUT_TRAP_LISTENER_CREDENTIALS_SECURE_STORE_CREATE, then the public key used in the keystore will be generated at this location.

  • Default

    • /etc/elastiflow/snmp/traps/.age/public-age-keys.txt

Note: If using Trap collector generated keys, do not delete or modify the key files. Doing so will result in the loss of the ability to decrypt the credentials.

EF_INPUT_TRAP_LISTENER_CREDENTIALS_SECURE_STORE_PUBLIC_KEY

This setting can be used in place of EF_INPUT_TRAP_LISTENER_CREDENTIALS_SECURE_STORE_PUBLIC_KEY_FILE_PATH to directly assign the public key. Cannot be used in conjunction with EF_INPUT_TRAP_LISTENER_CREDENTIALS_SECURE_STORE_CREATE.

  • Default

    • ''

Last updated

Was this helpful?