Configuration File Encryption
This topic includes an overview of configuration file encryption, setup information, and encryption configuration settings.
Overview
Collectors can encrypt config files using AGE encryption. NetObserv Flow uses environment variables to configure this encryption.
By default, encryption is off. Enabling it creates or reads existing keys, keeps the
private key unencrypted, and encrypts the config file in place. To enable encryption
with the default settings, add EF_CONFIG_ENCRYPT_ENABLE=true to
your NetObserv Flow command line as follows:
EF_CONFIG_ENCRYPT_ENABLE=true \ flowcoll --config=/etc/juniper/flowcoll/flowcoll.yml
If you enable encryption:
-
Azure VNet will also be encrypted in place, using the same key.
-
Public and private keys files can be shared between collections. For example: ?
-
You can use the same configuration for generating a support bundle. Files under the
--support-bundle-config-dirwill be decrypted in the support bundle.
NetObserv Flow Collector Configuration
You can configure your flow collectors with NetObserv Flow to encrypt your
config files securely using AGE encryption. Use the following command to run the
Unified Flow Collector (flowcoll) and specify the YAML
configuration path.
flowcoll --config=/path/to/flowcoll.yml
By default, this YAML file is stored in plaintext. You can encrypt this file using one of two methods:
-
Encrypt the entire file using age encryption.
-
Encrypt only the
valueparts of eachkey: valueline (and all comments), using the sops editor.
Getting Started
Environmental Dependencies
Setting up encrypted flow collection depends on the following environmental dependencies:
-
Ensure sops is installed in your local environment:
# Change sops-v3.10.2.linux.amd64 if needed based on your environment curl -LO https://github.com/getsops/sops/releases/download/v3.10.2/sops-v3.10.2.linux.amd64 sudo mv sops-v3.10.2.linux.amd64 /usr/local/bin/sops sops --version # to verify install
-
Ensure age is installed in your local environment to edit through CLI:
sudo apt install age # Debian based linux brew install age # macos age --version # to verify install
Setup
Start flowcoll using the following configurations during
invocation:
EF_CONFIG_ENCRYPT_ENABLE=true \ EF_CONFIG_ENCRYPT_CREATE=true \ EF_CONFIG_ENCRYPT_TYPE=sops \ EF_CONFIG_ENCRYPT_PASSWORD=YourPassword \ EF_CONFIG_ENCRYPT_PRIVATE_KEY_FILE_PATH="/etc/juniper/flowcoll/.age/key.age" \ EF_CONFIG_ENCRYPT_PUBLIC_KEY_FILE_PATH="/etc/juniper/flowcoll/.age/public-age-keys.txt" \ flowcoll --config=/path/to/flowcoll.yml
Starting the flow collector this way:
-
Generates the password-protected age keys at the configured file paths.
-
Encrypts the YAML file specified with the
--configoption using those keys.
The PASSWORD is optional. It functions like the passphrase
on an ssh private key to encrypt or decrypt the age private key.
Once successfully encrypted with sops, the cleartext config file on the left will have its configuration values encrypted, as on the right [ image ] [ image ] Caption: Unencrypted config Caption: Encrypted config
Once encrypted with sops, the configuration file is updated in-place. The file will include encrypted values for logging settings, enrichment configurations (Maxmind ASN, Maxmind GeoIP, NetIntel, User-Defined Metadata), and other settings. For example:
# Logging EF_LOGGER_ENCODING: console EF_LOGGER_LEVEL: info ### ENRICHMENT # Maxmind ASN EF_PROCESSOR_ENRICH_IPADDR_MAXMIND_ASN_ENABLE: true EF_PROCESSOR_ENRICH_IPADDR_MAXMIND_ASN_PATH: /assets/GeoLite2-ASN.mmdb # Maxmind GeoIP EF_PROCESSOR_ENRICH_IPADDR_MAXMIND_GEOIP_ENABLE: true EF_PROCESSOR_ENRICH_IPADDR_MAXMIND_GEOIP_PATH: /assets/GeoLite2-City.mmdb # NetIntel EF_PROCESSOR_ENRICH_IPADDR_NETINTEL_ENABLE: true EF_PROCESSOR_ENRICH_IPADDR_NETINTEL_AS_PREFIX_PRECISION: exact # User-Defined Metadata (IP Address) EF_PROCESSOR_ENRICH_IPADDR_METADATA_ENABLE: true EF_PROCESSOR_ENRICH_IPADDR_METADATA_USERDEF_PATH: /metadata/ipaddr.yml # [ ... and so on ... ]
The sops section contains encryption details, last modification date, MAC, unencrypted suffix, and version. For example:
EF_LOGGER_ENCODING: ENC[AES256_GCM,data:34IOTJKKrw==,iv:EAu3zcTiPZ6wb8i3etv9fGSgQktje/TXr21Wgb0M/A8=,tag:jz24RwRGcyT8ZhI8b3loCw==,type:str]
EF_LOGGER_LEVEL: ENC[AES256_GCM,data:60adkw==,iv:QRJCxy8Fe/pXbOTuX+5sQCPYaaDnBFMg4KWRl6uuSd8=,tag:QckS6jHo1zs6yR5E+t+9cw==,type:str]
#ENC[AES256_GCM,data:es+453NJnXJh6+qSDQ==,iv:+8mQP4dJxDNaJAEEE3KSptUXdRcKNr8uwLmVacOrmGY=,tag:Y56rIqwIXqLurjyAsRL0VQ==,type:comment]
#ENC[AES256_GCM,data:oVXhKxY1h7Jya/PU,iv:HJ9o/pz8dhWZdyBwegUpZDrA9ZGlgRwwuMsYxcBQ2Os=,tag:iABG65UEJ34s7iZ3j7XcEA==,type:comment]
EF_PROCESSOR_ENRICH_IPADDR_MAXMIND_ASN_ENABLE: ENC[AES256_GCM,data:AvB8bg==,iv:/fczqlnlc1NY75/RPVcz2oNIe1+xtyX9lzTXPOHqIt0=,tag:8pI71CrLp7SfXHSelGjFVg==,type:bool]
EF_PROCESSOR_ENRICH_IPADDR_MAXMIND_ASN_PATH: ENC[AES256_GCM,data:+2VvNtQm8YW7rpvQlzfA9ckgj8/v3HT5cQ==,iv:pxSrRVqyJEspkbMLA2qM52Z1b1JttvHkhD+ZCp8v1/Y=,tag:iNiSPqyoebprRqSrfysU5Q==,type:str]
#ENC[AES256_GCM,data:CR3crA1dTs760OGesoI=,iv:JssCPAmAQcFPgrj4T0i5bA+76RPh5aB5hvLI9d/fH8A=,tag:/n5bzCGbaAS8l/WQSIuhKg==,type:comment]
EF_PROCESSOR_ENRICH_IPADDR_MAXMIND_GEOIP_ENABLE: ENC[AES256_GCM,data:96GXtQ==,iv:vEZ4j0zzkBbrviYLs/wjxTojjda4m3cVtlqAkXXuKm4=,tag:Oj92p6Mqm+Ro1H7Eak8YPg==,type:bool]
EF_PROCESSOR_ENRICH_IPADDR_MAXMIND_GEOIP_PATH: ENC[AES256_GCM,data:VjvwGmxHnNjPlP0YX+9h4NxheUWNZGXWKZY=,iv:XpjWRiTEEpf7tdh7zAzJUxWtcT4OoVABUqXWndkZkEg=,tag:nNYl0WEDJUqex1cipnTASQ==,type:str]
#ENC[AES256_GCM,data:SF+vt8+F3xls,iv:g/l2WNAJ7gfAWKT5Xy3lNKYQGj6cI32YaIdl8wpydmE=,tag:ykGdpsiNtHLSrtXzxO4QDA==,type:comment]
EF_PROCESSOR_ENRICH_IPADDR_NETINTEL_ENABLE: ENC[AES256_GCM,data:luYO4w==,iv:Yy7Sa98KxiSCWF/CnblpgjYkk3TPE+/0VThz1b/hf8I=,tag:R3eOMzpWKuh2w9SFWPcOHQ==,type:bool]
EF_PROCESSOR_ENRICH_IPADDR_NETINTEL_AS_PREFIX_PRECISION: ENC[AES256_GCM,data:GA7RAWc=,iv:lPRWv5KNXNamJQwn8mlq8iZJYSb2ALvhu22ogcYAd2Q=,tag:H1c2ATdZKNg/gUPPHmxUyQ==,type:str]
#ENC[AES256_GCM,data:DxjPK/iDhjQ0EGaFSKl+C6YDjWjK1g0Qc8S+rfJVZYfofHo=,iv:BST6BBvq4+fNIYmcTA2NeK31/ZPQBjX72KePEJwLads=,tag:wxW8hC14wBbyTTXPyK8Cdg==,type:comment]
EF_PROCESSOR_ENRICH_IPADDR_METADATA_ENABLE: ENC[AES256_GCM,data:gri8fw==,iv:CwbZuZ1Z5mKOCJu8EsEpjb0HWIlrjymVImnNkZN7KME=,tag:ST5zkMo7xInNdz55PkJ8Dw==,type:bool]
EF_PROCESSOR_ENRICH_IPADDR_METADATA_USERDEF_PATH: ENC[AES256_GCM,data:8RQh5v6pF/M3b2r1ZVyZkKM71r4=,iv:Gu+3yjE40rpBfzfDZrGFIuXHjHgTUIIPBgzWjIHp87k=,tag:meCvvw73uy3/s1aZWPtZJw==,type:str]
#ENC[AES256_GCM,data:NFtE/nvaZpncKye3td1IZ8+SdV821g==,iv:A98XYG6boMhawdIhd9nFYSfCRDYezF/81q0HeFk0dRA=,tag:7gDmAF68bcRG3i9+fXFaow==,type:comment]
sops:
age:
- recipient: age1aa4ggchz7fqsn559gyhrrysqwqdqrcu3vz04uclgqtg20zfwpfrs8llw7j
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBCTFdNK3pOeTh1cXArZHR5
REF3NVB5eXd2ZUxFMTBDYVNtK3FScVovWG1ZCnJFeDVmcjk5UDJRc1B3Qy9yQ0h1
c21RRmVlbnVWY29rL0l1N0xaLzJLSzgKLS0tIFpIREZiemNkWmpUMnNiVExKTGQz
QnRHeFNWODgxYTZWNWJmNWsrVytCS1UK03B5mYaV1zcOcvdGu0DtXccM+5TtmRcV
SCk9iN+HWgpur//94a3agQnpfq2+ERJU1lSudlKu7ba5rtgj2MdtxQ==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2025-07-15T19:48:41Z"
mac: ENC[AES256_GCM,data:qrGr/rMZh6TVQ9AKnpLvT3XuA/tbXr7fVdBRjI+P+iPq5d9SgWDlLR0sEY6+9vsbPoa9Cwh2tzT57BIvlcAq2BEwaS1lCeqbKhzag89R8+k1VaPUHVN1daR161kom7p+qwAn5vyGkZUtC4/upKhouIejBq7NPl6vNMSfb3A/ja0=,iv:nvLCrtcQ11mYPIqLNgGTKHBUZCSNXNroL3X6qDZ4D9g=,tag:idqaqdfp4r0Q7iGMCdgP7Q==,type:str]
unencrypted_suffix: _unencrypted
version: 3.10.2Encryption Settings
- EF_CONFIG_ENCRYPT_ENABLE
- EF_CONFIG_ENCRYPT_CREATE
- EF_CONFIG_ENCRYPT_TYPE
- EF_CONFIG_ENCRYPT_PRIVATE_KEY_FILE_PATH
- EF_CONFIG_ENCRYPT_PUBLIC_KEY_FILE_PATH
- EF_CONFIG_ENCRYPT_PASSWORD
- EF_CONFIG_ENCRYPT_PUBLIC_KEY
EF_CONFIG_ENCRYPT_ENABLE
Indicates if the config file is encrypted.
- Valid values:
true,false - Default:
false
EF_CONFIG_ENCRYPT_CREATE
If config file encryption is enabled, EF_CONFIG_ENCRYPT_ENABLEis
true, this setting creates a public/private keypair if none exists. The keys are
stored in the configured file paths. If key files already exist from previous
NetObserv Flow runs, this setting does nothing, and the files won't be
regenerated or overwritten.
- Valid values:
true,false - Default:
true
EF_CONFIG_ENCRYPT_TYPE
If config file encryption is enabled
(EF_CONFIG_ENCRYPT_ENABLEset to true), specify
the file encryption type.
-
sops: Encrypts configuration values and comments while keeping the file structure intact. -
standard: Encrypts the entire file using AGE encryption.
- Valid values:
sops,standard - Default:
standard
/etc/juniper/flowcoll/.age) must exist. NetObserv Flow
does not create the directory.EF_CONFIG_ENCRYPT_PRIVATE_KEY_FILE_PATH
Sets the file path location of the private key file. If used with
EF_CONFIG_ENCRYPT_CREATE, then the private key used in the
keystore is generated at the following location.
- The default is:
/etc/juniper/flowcoll/.age/key.age
EF_CONFIG_ENCRYPT_PUBLIC_KEY_FILE_PATH
Sets the file path location of the public key file. If used with
EF_CONFIG_ENCRYPT_CREATE, then the public key used in the
keystore is generated at the following location.
- The default is:
/etc/elastiflow/trapcoll/.age/public-age-keys.txt
EF_CONFIG_ENCRYPT_PASSWORD
The specified file can be encrypted for added security, similar to using a
passphrase on an SSH private key. When combined with
EF_CONFIG_ENCRYPT_CREATE, the keystore uses a
password-protected private key. The same password decrypts the file and runs
NetObserv Flow.
- Default: none
EF_CONFIG_ENCRYPT_PUBLIC_KEY
Use this setting instead of
EF_CONFIG_ENCRYPT_PUBLIC_KEY_FILE_PATH to specify the
public key directly. Do not use this parameter with
EF_CONFIG_ENCRYPT_CREATE.
- Default: none
- Example:
age164x50zgnmcesqglr25vr9ypje7lx3tkad4vwavcjpuh083lug9tqku8s74
Editing Encrypted Files
Do not manually edit encrypted files outside the sops CLI editor. Use sops through the CLI to securely edit device configuration files.
To securely edit device configuration files:
For a non-password-protected key, set the following variables:
-
SOPS_AGE_RECIPIENTS=$(</etc/juniper/flowcoll/.age/public-age-keys.txt)SOPS_AGE_KEY_FILE=/etc/juniper/flowcoll/.age/key.age
In age, "recipient" is equivalent to "public key."
For a password-protected key, use:
-
SOPS_AGE_RECIPIENTS=$(</etc/juniper/flowcoll/.age/public-age-keys.txt) -
SOPS_AGE_KEY=$(age -d /etc/elastiflow/flowcoll/.age/key.age)
The age -dcommand prompts for the password at the terminal.
These commands decrypt the file in memory and open it with a text editor. By default,
the editor is vim. To use nano, instead, set the EDITOR
environmental variable as follows:
-
EDITOR=nano -
SOPS_AGE_RECIPIENTS=$(</etc/juniper/flowcoll/.age/public-age-keys.txt) -
SOPS_AGE_KEY=$(age -d /etc/juniper/flowcoll/.age/key.age)
After editing, save and exit to update the encrypted file on the disk.