General description
To ensure secure interaction between the administrator and the NAICE system, protection is implemented for the following user interfaces: lemmus, gavia, larus, castor, and sterna. All HTTP traffic is fully encrypted using the TLS protocol, which prevents data interception and unauthorized access.
During the installation of NAICE services, two self-signed certificates are automatically generated for the user interfaces. This ensures secure HTTPS communication based on the parameters specified in the configuration. For more information about installing NAICE services, see the corresponding section.
Different certificates are generated for two groups of services:
- Administrative services:
- Gavia REST API Gateway — external API for managing NAICE;
- Lemmus, Authorization Server — authorization server for administrators;
- Larus — administrator web GUI;
- Portal services:
- Castor — API for portal configuration and portal-based authorization;
- Sterna — portal web GUI.
If a third-party Certificate Authority (CA) is available, the self-signed certificates can be replaced with certificates issued by the same CA.
Installing a certificate issued by a third-party CA
Certificate requirements
The certificate must meet all of the following requirements to ensure correct operation with the NAICE service:
- The certificate must be in PEM or CRT format. Certificates in DER format or PKCS containers are not supported.
- The certificate key must either use AES encryption or have no encryption protection applied.
- The certificate and the private key must be stored in separate files.
- The password must not contain the following characters: $, ', ", `, brackets, or spaces.
- The certificate must contain the following attributes:
- Subject: CN;
- X509v3 Key Usage: Digital Signature, Key Encipherment (must be marked as critical);
- X509v3 Extended Key Usage: TLS Web Server Authentication, TLS Web Client Authentication;
- X509v3 Subject Alternative Name: must include either a DNS name matching the server DNS name, or an IP Address matching the server IP address;
- If NAICE is deployed in a high-availability configuration without VRRP, the X509v3 Subject Alternative Name attribute must include the DNS name or IP Address of each NAICE server.
Preliminary steps before replacing the certificate
Replacing the self-signed certificate with a custom CA-signed certificate becomes possible only after the NAICE NAC system has been installed on the target host.
To replace the certificate with your own, you must set the appropriate variable values in the group_vars/all.yml file.
The certificate files must be located on the host from which the playbook is executed.
Description of parameters that must be configured before replacing the certificate:
| Variable | Description |
|---|---|
cert_path | Directory where the certificate will be placed on the target host is specified relative to the NAICE installation directory defined by the naice_address variable. Changing this variable is not recommended. |
| server_domain | DNS name or IP address of the NAICE server. |
| cert_name | Parameter indicating which certificate should be replaced: the NAICE web GUI certificate ("server") or the web portal authorization certificate ("portal"). Only one certificate can be replaced during a single playbook execution. |
| key_password | Password for the server’s private key file, which will be written to .env. May be empty if no password is used. |
| cert_path_src | Path to the custom CA-signed server certificate file. Default: /etc/ssl/certs/server.crt |
| key_path_src | Path to the private key file for the server certificate. Default: /etc/ssl/private/server.key |
If the server_domain variable contains the server DNS name, ensure that this name can be resolved by the DNS server used in the NAICE settings and on the administrator workstations that have access to the NAICE web GUI. Otherwise, access to the web GUI will become unavailable.
Replacing the certificate with a custom one
Before replacing the certificate, make sure that the values of the variables server_domain, cert_name, cert_path_src, key_path_src, and key_password are valid, and update them in ansible/group_vars/all.yml if necessary.
If the private key is not password-protected, the key_password variable must be left empty.
After configuring all the variables for replacing the certificate, run the following playbook:
ansible-playbook https-replacement-cert.yml
If the DNS name specified in the server_domain variable cannot be resolved from the host used to run the Ansible playbook, the playbook execution will fail and an error will occur.
During the execution of the playbook, you will be prompted twice to confirm the restart of the NAICE system. This confirmation is required in order to proceed with the certificate replacement.
- If the restart is declined, the playbook will terminate, and the certificate replacement will not be performed.
- If the restart is confirmed, the NAICE system will be restarted, which may lead to a short period of unavailability.
To replace the certificate without interactive restart confirmation:
ansible-playbook https-replacement-cert.yml -e "confirm_restart=yes"
Certificates and private keys are always stored using the names specified by the cert_name variable (server.crt / server.key and portal.crt / portal.key). When copying or generating certificates, the files will be written using these names and the existing files will be overwritten.
It is important to consider that the restart may affect ongoing system operations, so it is recommended to perform it during a low-load period or at a time when the impact on users is minimal.
Instructions for replacing the certificate for a high-availability NAICE installation
Replacing certificates in a high-availability configuration using VRRP
In this deployment scheme, the domain name used to access the NAICE web GUI must resolve only to the NAICE VIP address. Ensure that there are no entries in the DNS settings or hosts files that point to the individual IP addresses of the nodes.
- The same NAICE certificate must be used on both nodes.
- Certificate replacement must be performed sequentially on the first and second NAICE nodes.
- The address of the node on which the certificate replacement will be performed must be specified in the
inventory/hosts.ymlfile.
To replace the certificate, perform the following steps:
Before running the playbook, carefully review the sections Preliminary steps before replacing the certificate and Replacing the certificate with a custom one.
- Determine which NAICE node is the VRRP
masterand which is the VRRPbackup. - Specify the address of the VRRP
masterin theinventory/hosts.ymlfile. Run the
https-replacement-cert.ymlplaybook on the VRRPmaster.Verify that NAICE is accessible using the domain specified in the certificate.
- Specify the address of the VRRP
backupin theinventory/hosts.ymlfile. Run the
https-replacement-cert.ymlplaybook on the VRRPbackup.- Transfer the VRRP master role to the second node (VRRP backup). To do this, run the following command on the host that currently holds the VIP address:
sudo systemctl restart keepalived
- Verify again that NAICE is accessible using the domain specified in the certificate.
- Transfer the VRRP master role back.
Replacing certificates in a high-availability configuration without using VRRP
In this deployment scheme, each host will have its own domain name. This requires each of these names to be specified in the certificate within the X509v3 Subject Alternative Name attribute. Each of these domain names must be resolvable by the DNS server configured on the virtual machines intended for NAICE installation and on the administrator workstations.
- The same NAICE certificate must be used on both nodes.
- Certificate replacement must be performed sequentially on the first and second NAICE nodes.
- The address of the node on which the certificate replacement will be performed must be specified in the
inventory/hosts.ymlfile. - The
server_domainvariable in thegroup_vars/all.ymlfile must contain the domain name of the virtual machine with NAICE on which the certificate replacement will be performed.
To replace the certificate, perform the following steps:
Before running the playbook, carefully review the sections Preliminary steps before replacing the certificate and Replacing the certificate with a custom one.
- Specify the address of the first node in the
inventory/hosts.ymlfile. - Specify the domain name of the first node in the
server_domainvariable of thegroup_vars/all.ymlfile. Run the
https-replacement-cert.ymlplaybook for the first node.Verify the availability of NAICE using the domain name of the first node.
- Specify the address of the second node in the
inventory/hosts.ymlfile. - Specify the domain name of the second node in the
server_domainvariable of thegroup_vars/all.ymlfile. Run the
https-replacement-cert.ymlplaybook for the second node.Verify the availability of NAICE using the domain name of the second node.
Removing third-party certificates and restoring the default configuration
After replacing a certificate, the previous certificate will be overwritten. If it is necessary to revert to a self-signed certificate, it must be reissued.
Reissuing a certificate is performed by deleting the previously installed certificates and rerunning the installation playbook.
Delete the installed certificates using the following command (if a high-availability installation is used, the certificates must be deleted on each NAICE node):
# Default NAICE installation directory: /etc/docker-naice sudo rm -v <NAICE installation directory>/https/*
After deleting the certificates, rerun the installation playbook.
For a stand-alone installation:
ansible-playbook install-naice.yml
For a high-availability installation using VRRP:
ansible-playbook reservation-naice-services.yml -i inventory/hosts-cluster.yml
For a high-availability installation without using VRRP:
ansible-playbook geo-naice-services.yml -i inventory/hosts-geo.yml
Viewing certificate parameters
Retrieving NAICE web GUI and web portal metrics based on SSL certificate parameters
View metrics or retrieve nginx parameters using the following command:
For NAICE web interface:
echo | openssl s_client -showcerts -connect <IP address or domain name>:443 2>&1 | openssl x509 -noout -dates
For NAICE portal web interface:
echo | openssl s_client -showcerts -connect <IP address or domain name>:8443 2>&1 | openssl x509 -noout -dates
Nginx provides a method that returns SSL certificate information in JSON format.
The method returns the following certificate details: issuer, start date, and expiration date.
Example output:
notBefore=Feb 25 04:32:04 2026 GMT notAfter=Feb 1 04:32:04 2126 GMT
Retrieving GAVIA and LEMMUS metrics based on SSL certificate parameters
Link for retrieving full certificate information
For naice-gavia:
curl -k https://<IP address or domain name of the host for NAICE>:8080/actuator/info
For naice-lemmus:
curl -k https://<IP address or domain name of the host for NAICE>:8083/actuator/info
Link for retrieving full certificate information
For naice-gavia:
https://<IP address or domain name of the host for NAICE>:8080/actuator/prometheus
For naice-lemmus:
https://<IP address or domain name of the host for NAICE>:8083/actuator/prometheus
Viewing certificates from the operating system console
To display detailed certificate information, run the following command:
# For the NAICE web GUI certificate sudo openssl x509 -in <NAICE installation directory>/https/server.crt -text -noout # For the web portal authorization certificate sudo openssl x509 -in <NAICE installation directory>/https/portal.crt -text -noout