Deploy Tenable Agent Using JSON

When you first launch the agent after installation, the agent first checks for the presence of environment variables, then checks for the config.json file. When the agent launches for the first time, the agent uses that information to link to a manager and set preferences.

To deploy Tenable Agent with the config.json file:

  1. Configure the config.json file.

    Note: config.json must be in ASCII format. Some tools, such as PowerShell, create test files in other formats by default.

  2. Download the Tenable Agent installation package for your operating system.

  3. (Windows only) Before you install the package, you must modify the package so that the agent does not start automatically after installation. This is because the agent must read the config.json file when you start the agent service for the first time.

    To modify the package, run the following command:

    msiexec /i <agent package>.msi NESSUS_SERVICE_AUTOSTART=false /qn

  4. Install Tenable Agent. For more information, see Install a Tenable Agent on Windows , Install a Tenable Agent on macOS, or Install a Tenable Agent on Linux.

  5. (macOS only) Unlike Windows, there is no way to turn off autostart before installing Tenable Agent. Therefore, you need to reset the Tenable Agent to a fresh state before adding config.json and starting the agent service.

    To return Tenable Agent to a fresh state on macOS, validate config.json, and place config.json in the correct directory, run the following command:

    /Library/NessusAgent/run/sbin/nessuscli prepare-image --json=<path to json file>

    Note: Tenable Agent autostart is disabled by default in Linux packages. Therefore, if you are using Linux, you can ignore steps 3 and 5.
  6. Place config.json in the Tenable Agent directory if it is not already there:

    • Windows — C:\ProgramData\Tenable\Nessus Agent\nessus\config.json
    • macOS — /Library/NessusAgent/run/var/nessus/config.json
    • Linux — /opt/nessus_agent/var/nessus/config.json
  7. Start the agent service.

  8. Depending on your operating system, run the following command to verify the config.json preferences:

    • Windows — "C:\Program Files\Tenable\Nessus Agent\nessuscli.exe" fix --secure --list

    • macOS — /Library/NessusAgent/run/sbin/nessuscli fix --secure --list

    • Linux — /opt/nessus_agent/sbin/nessuscli fix --secure --list

    Once you verify that the preferences were successfully applied, the linking process is complete.