---
title: "Agent security"
description: ""
url: "https://docs.itrsgroup.com/docs/opsview/6.12.6/install/agent-security/index.html"
---

**Opsview Agent End of Support**


The Opsview Agent is no longer supported or available for download. All new and existing monitoring must now be deployed using the [ITRS Infrastructure Agent](https://docs.itrsgroup.com/docs/infrastructure-agent/current/).



## ITRS Infrastructure Agent Security

Opsview Monitor can communicate securely with the [ITRS Infrastructure Agent](https://docs.itrsgroup.com/docs/infrastructure-agent/current/).

Transport Layer Security (TLS), sometimes referred to by its older name SSL, encrypts the traffic between Opsview Monitor and the agent. TLS also uses certificates to authenticate each side, so that Opsview Monitor and the agent can confirm they are talking to each other and not to a third party intercepting the connection (a man-in-the-middle attack). For more information, see [PKI](https://docs.itrsgroup.com/docs/opsview/6.12.6/administration/distributing-functionality/pki/index.html).

For a TLS connection to succeed, both sides must have the correct certificates, and both must support at least one common TLS version and cipher suite:

- **On Opsview Monitor** — `check_nrpe` presents a client certificate and holds a corresponding private key, which you specify in host variables. It uses a certificate authority (CA) file to verify the server certificate of the Infrastructure Agent.
- **On the monitored host** — the Infrastructure Agent presents its server certificate and holds a corresponding private key. It uses a CA file to verify the Opsview Monitor client certificate.

Each side only accepts certificates signed by a CA that it trusts. To configure the agent, see [Infrastructure Agent Operation](https://docs.itrsgroup.com/docs/infrastructure-agent/current/install/installation-and-operation/index.html#transport-layer-security). To configure Opsview Monitor on the orchestrator and collectors, follow the sections below.

The certificates can be generated using any valid method; however, the simplest way to get started is by using the Opsview Public Key Infrastructure. You can follow these steps in [PKI](https://docs.itrsgroup.com/docs/opsview/6.12.6/administration/distributing-functionality/pki/index.html) to generate both client and server certificates.

## Host Variables

We have added default parameters to every `check_nrpe`-based Service Check that comes with Opsview Monitor. If you check their definitions, you will see two Host variables, `NRPE_CIPHERS` and `NRPE_CERTIFICATES`. You must add these variables yourself if you are upgrading from an older version of Opsview Monitor. To do this add these two variables:

### NRPE_CIPHERS

- Label Arg1: "Cipher list"
- Default Arg1: Optional default [cipher list](https://docs.openssl.org/master/man1/openssl-ciphers/#options) to pass into `check_nrpe`. For example, `HIGH:!3DES:!CAMELLIA:!AES128:!eNULL:!aNULL:!ADH:!EXP:!LOW:!DES:!MD5:!PSK:!SRP:!DSS`.

### NRPE_CERTIFICATES

- Label Arg1: "Path to certificate"
- Label Arg2: "Path to private key"
- Label Arg3: "Path to CA certificate"

For each `check_nrpe` based service check that is to be used with the new feature, add these parameters:

```
-C '%NRPE_CERTIFICATES:1%' -k '%NRPE_CERTIFICATES:2%' -r '%NRPE_CERTIFICATES:3%' -y '%NRPE_CIPHERS:1%'
```

## Encrypted client private keys

When Opsview Monitor connects to the Infrastructure Agent over TLS, the orchestrator and collectors use a client certificate and a private key to prove their identity. If the private key file is stored on disk without protection, anyone who obtains a copy of the file can use it to impersonate Opsview Monitor.

To reduce this risk, you can protect the private key with a password by converting it to an encrypted PKCS#8 key file. PKCS#8 is a standard format for storing private keys. An encrypted PKCS#8 key file cannot be used without its password, even if someone copies it.

Opsview Monitor reads the password from a configuration file that you create on each orchestrator and collector that runs the checks. Because the password is stored separately on each server, you can use a different private key and password on each collector.

### Configure an encrypted private key

Complete the following steps on the orchestrator and on each collector that you want to use an encrypted private key.

1. Create an encrypted copy of your client private key. For example, if your client certificate and private key are in `/opt/opsview/etc/ssl/local-client.pem`, run the following command:

   ```bash
   openssl pkcs8 -topk8 -v2 aes-256-cbc -in /opt/opsview/etc/ssl/local-client.pem \
     -out /opt/opsview/etc/ssl/local-client.pkcs8.key
   ```

   Adjust the file names to match your environment. When prompted, enter a password for the key. Keep a record of this password, because you need it to configure Opsview Monitor.

   If you use different private keys on each collector, the encrypted key file must have the same path on every collector that runs the same checks. However, the key contents and passwords can differ.

2. In Opsview Monitor via the UI or API, set the `NRPE_CERTIFICATES` host variable on your monitored hosts to the paths of the client certificate, the encrypted private key, and the CA certificate. For more information, see [Host Variables](#host-variables). For example:

   - Arg1 (Path to certificate): `/opt/opsview/etc/ssl/local-client.pem`
   - Arg2 (Path to private key): `/opt/opsview/etc/ssl/local-client.pkcs8.key`
   - Arg3 (Path to CA certificate): `/opt/opsview/etc/ssl/ca.pem`

   Make sure that your `check_nrpe` service checks include the following parameters:

   ```
   -C '%NRPE_CERTIFICATES:1%' -k '%NRPE_CERTIFICATES:2%' -r '%NRPE_CERTIFICATES:3%' -y '%NRPE_CIPHERS:1%'
   ```

3. Create the file `/opt/opsview/etc/agentclient-pkcs.yaml` with the following content. Replace `your-passphrase-here` with the password that you set when you encrypted the private key on that same collector, and keep the quotation marks around it:

   ```yaml
   agentclient:
     pkcs8:
       key_passphrase: "your-passphrase-here"
   ```

   
**Note**


Opsview Deploy does not create this file. You must create it manually on each server.



4. Restrict access to the file so that only authorized users can read it. The `opsview` user must be able to read the file. For example, set the owner to `root`, the group to `opsview`, and the permissions to `640`:

   ```bash
   sudo chown root:opsview /opt/opsview/etc/agentclient-pkcs.yaml
   sudo chmod 640 /opt/opsview/etc/agentclient-pkcs.yaml
   ```

5. Restart the executor so that it loads the password:

   ```
   /opt/opsview/watchdog/bin/opsview-monit restart opsview-executor
   ```

6. Run a service check that uses the `NRPE_CERTIFICATES` host variable to confirm that the connection works. If the password in `agentclient-pkcs.yaml` is missing or incorrect, the check fails until you correct the file and restart the executor.


**Warning**


Store the private key password only in `/opt/opsview/etc/agentclient-pkcs.yaml`. Do not add it to service check arguments, host variables, or any other part of your monitoring configuration. Opsview Monitor does not read the password from any other location.




