Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device.
Atlassian cookies and tracking notice, (opens new window)
Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device. Atlassian cookies and tracking notice, (opens new window)
/
Encryption of Secrets
Updated Nov 25

    Encryption of Secrets

      Introduction

      Secrets are encrypted so that passwords are not stored in plaintext in either the database or regular configuration files. A master password, is stored in a special configuration file called master.key

      Encryption of Secrets has been implemented for secrets in NMIS but has not been implemented for secrets in OMK opModules. At least one of your OMK opModules must be upgraded to a version that can read the encrypted secrets in NMIS.

      Encryption of Secrets

      Encryption of secrets stores credentials as ciphertext rather than in the clear, in both the database and the configuration files, using a master key held outside the configuration tree.

      The feature has existed for several releases and was off by default. From NMIS 9.7.0 it is on by default in NMIS for new installations. Upgrades are deliberately left as they are.

      What is protected

      Device credentials, held per node in the database: the SNMP community, the SNMP v3 authentication password and key, the SNMP v3 privacy password and key, and the WMI password. These convert to ciphertext the first time NMIS loads each node.

      Configuration secrets, held in conf/Config.nmis and listed in conf-default/PasswordFields.nmis:

      Setting

      What it is

      Setting

      What it is

      database:db_password

      MongoDB password

      database:redis_password

      Redis password

      email:mail_password

      SMTP password

      authentication:auth_ldap_psw

      LDAP bind password

      authentication:auth_ms_ldap_dn_psw

      Active Directory bind password

      system:default_communityRO

      default SNMP community

      system:default_authpassword, system:default_authkey

      default SNMP v3 authentication

      system:default_privpassword, system:default_privkey

      default SNMP v3 privacy

      These convert as each one is used, starting with the database password on the first
      connection. An encrypted value is recognisable in the file by its !! prefix.

      From NMIS 9.7.1 this also covers the session cookie signing key auth_web_key and the TACACS, RADIUS and ConnectWise secrets. On 9.7.0 they're stored in plain text.

      The master key

      Everything depends on one file.

       

       

       

       

      Default location

      /usr/local/etc/firstwave/master.key

      Contents

      one line of 256 alphanumeric characters

      Ownership and mode

      the web server user, group nmis, mode 0440

      Directory

      /usr/local/etc/firstwave, mode 0711

      Created by

      the NMIS installer, whether or not encryption is on

      Configured by

      master_key_file in Config.nmis, or the NMIS_MASTER_KEY_FILE environment variable

      Four rules that matter more than anything else on this page.

      1. Back the key up with your configuration and your database. A backup of conf/ and MongoDB without the key cannot be restored. This is the single most important operational consequence of enabling encryption.

      2. Never rotate or relocate an existing key. Values encrypted under the old key stop being readable. There is no re-key path in the product.

      3. NMIS only ever creates a key at the default path. If you point master_key_file somewhere else, you provision that file yourself, and NMIS will not create it, change its owner or change its mode.

      4. Changing master_key_file after secrets are encrypted does not re-encrypt anything. The old values simply stop decrypting until the original path is restored.

      Prerequisites

      Three Perl modules must be installed:

      Module

      Debian and Ubuntu

      RedHat family

      Module

      Debian and Ubuntu

      RedHat family

      Crypt::CBC

      libcrypt-cbc-perl

      perl-Crypt-CBC

      Crypt::Cipher::AES

      libcryptx-perl

      perl-CryptX

      Math::Random::Secure

      libmath-random-secure-perl

      perl-Math-Random-Secure

      The NMIS installer has installed all three for several releases, so on an installer-built host they are already present. From 9.7.0 the installer also checks and tells you if they are missing.

      Co-installed FirstWave products must be recent enough. NMIS and the OMK applications share the code that reads encrypted secrets. If encryption is enabled on a host, **at least one FirstWave OMK application on that host must be at the version below or newer, or nmisd will refuse to start.

      From NMIS 9.7.1, if encryption of secrets is on, every OMK application on the host must be at the version below or newer, not just one.

      Product

      Minimum version

      Product

      Minimum version

      NMIS

      9.7.0

      opCharts

      4.10.0

      opEvents

      4.7.0

      opConfig

      4.9.0

      opHA

      5.2.1 !

      opReports

      4.7.0

      opAddress

      2.5.0

      ! DO NOT enable Encryption of Secrets on opHA 5.2.0, opHA will not function.

      The check passes when at least one installed application meets its minimum, because the applications share a common library on the host. A host with no other FirstWave applications passes automatically.

      New installations

      Encryption is on. Nothing to do. Record where the master key is and add it to your backups.

      To install with encryption off instead, which is the pre-9.7.0 behaviour:

      sudo ./installer eos=false

      eos=true is also accepted, and on an upgrade it overrides whatever the existing setting is. An unrecognised value stops the install rather than guessing.

      Upgrades

      An upgrade does not turn encryption on. Your existing setting is preserved. This is deliberate: switching it on unattended would strand a host whose other FirstWave applications are older, and would make the master key backup-critical without warning you.

      To turn it on afterwards, as root:

      /usr/local/nmis9/bin/nmis-cli act=enable-eos

      That stops the FirstWave daemons, encrypts the configuration secrets in one pass, and starts the daemons again. Device credentials convert as each node is next loaded. Before it writes anything it saves a plaintext copy of the configuration secrets into /usr/local/etc/firstwave, named NMIS- followed by a timestamp. That file is not cleaned up automatically. Delete it once you are satisfied the migration worked.

      Turning it off

      As root:

      /usr/local/nmis9/bin/nmis-cli act=disable-eos

      That converts the stored secrets back to plaintext and then records the setting. If it cannot decrypt something it tells you which field and leaves encryption on, rather than leaving you with a configuration that claims to be plaintext but is not.

      Editing global_enable_password_encryption in Config.nmis by hand is not the same thing and will not work. The flag only controls whether new values are encrypted. Values already stored stay encrypted, and NMIS will still need the key to read them.

      Checking the state

      Command

      Answers

      Exit code

      Command

      Answers

      Exit code

      nmis-cli act=check-eos

      is encryption enabled on this install

      0 yes, 1 no

      nmis-cli act=is-eos-available

      could encryption work here, meaning modules present and product versions acceptable

      0 yes, 1 no

      Both follow the shell convention where 0 means yes, so they can be used in scripts. Both work even when the database password cannot be decrypted, which is exactly when you need them.

      nmis-cli act=show-config reports configuration values and shows secrets as <empty>, <set> or <encrypted> rather than printing them. Add showsecrets=true if you genuinely need a value back.

      When something is wrong

      nmisd will not start and the log shows a refusal naming encryption of secrets. That happens when encryption is on and one of three things is true: the crypto modules are missing, the master key is missing or unreadable, or every co-installed FirstWave application is below its minimum version. The message names which. There is no prompt and no way to continue past it, by design: the alternative would be running with secrets you cannot read.

      The three ways out are to install the modules, upgrade the other applications, or turn encryption off deliberately with act=disable-eos.

      The web interface keeps working while polling is dead. The GUI has no equivalent startup check, so a broken installation looks healthier than it is. Check nmisd rather than the dashboard.

      A secret that will not decrypt is reported in the log at the point it is used, naming the field and the node, rather than silently being sent to the device as ciphertext.

      Key derivation

      global_password_kdf in Config.nmis controls how new secrets are written. It ships as opensslv1 and should be left alone.

      Reading is unaffected by this setting: NMIS tries every derivation the installed library supports and accepts whichever validates, so changing it cannot make an existing secret unreadable. The alternative value pbkdf2 is refused in this release, because a secret written that way cannot be read by the library version bundled with the OMK applications.

      Operational consequences worth planning for

      • There is no command that prints a stored device credential back. Runbooks and scripts that read secrets out of the configuration or the database stop working.

      • Support archives contain ciphertext. We cannot read secrets from a bundle you send us, which is the intended behaviour.

      • Configuration and node data stop being portable between hosts without the matching master key.

      • Restore the key first. When rebuilding a host, put the master key in place before restoring the configuration and database.

       

        Community Home

        opCommon
        • Downloads
          Downloads
        • Downloads
          Downloads
        • Downloads
          Downloads
        • How-to articles
          How-to articles
        Results will update as you type.
        • Why opCharts Nodes and Administration Nodes have a different Node count
        • Common Node Properties
        • Admin Outages API V2
        • AB1-ABI4 Upgrade Pre-Flight Checklist
        • Accessibility for Applications
        • Activating a 20 node free forever license process
        • Administration
        • Admin Outages API
        • Admin Outages API V3 draft
        • Apache 2.4 on CentOS 6.9
        • Application Support for Dark Mode
        • Automating Admin Tasks Including Node Management
        • Change Management Best Practices
        • Configuration
        • Configuration Options for Server Performance Tuning
        • Configuring Virtual Host SSL or TLS on the Opmantek Virtual Machine
        • Delegated Authentication
        • Deploying Your NMS
        • Enabling DNS Server on Opmantek NMIS8 VM
        • Encryption of Secrets
        • Finding logged entries of processes killed by OOM Killer
        • Find License Information
        • Firstwave API Solutions
        • Firstwave Functional Capabilities - FCAPS
        • Firstwave NMIS8 Virtual Appliance: Release Notes
        • FirstWave Virtual Machine: Installation and Getting Started
        • General Troubleshooting Checklist
        • Getting Started, Configuring the Applications
        • Getting Started, Configuring the Virtual Machine
        • Getting Started with Open-AudIT
        • Getting Started with Opmantek Applications
        • Google Maps API Key
        • High Volume SNMP Trap Processing
        • How to make configuration changes to opCommon.nmis and other files
        • NMIS 2026 Security Release
        • How To Select a Network Monitoring Solution
        • Installing and Refreshing Your License
        • Installing NMIS9 Compatible OMK Applications in a Disconnected (Air-Gapped) Environment
        • Introduction to the Linux Operating System
        • JSON Configuration Files
        • Access Rights in the 2026 OMK Security releases
        • Keeping Track of your Licenses
        • Migrating NMIS and Modules from CentOS 6 to CentOS 7
        • MongoDB Data Migration, Backup and Restore
        • MongoDB Installation
        • Moving to systemd
        • Multiple Open Ports for Opmantek applications
        • NMIS/OMK Timezone Configuration
        • Node Administration with opnode_admin
        • OMK Authentication Methods
        • OMK::Common public methods
        • OMK Common Settings to Consider Changing
        • OpenAudIT-NMIS Integration
        • opIntegration Home
        • Opmantek Products and Apache Log4J Vulnerability - Log4Shell CVE-2021-44228
        • Opmantek Products and Apache Log4J Vulnerability - Log4Shell CVE-2021-45105
        • Opmantek Support Case Opening Checklist
        • Opmantek System Configuration
        • Firstwave VM Installation and Getting Started
        • Packages and Modules Summary
          Questions
          Calendars

        You‘re viewing this with anonymous access, so some content might be blocked.
        {"serverDuration": 10, "requestCorrelationId": "a2a7f4c4dade49a894c737728ea09a91"}