An unsafe credentials.env is reported at start as a missing remoted.pem
Description
When /etc/wazuh/credentials.env breaks one of the rules the file must follow (owner or group other than root, a mode looser than 0600, a symbolic link, or /etc/wazuh or a directory above it writable by its group), wazuh-manager correctly refuses to start, but its journal names a missing certificate instead of the credentials file:
(1244): Invalid configuration at '/remote/https/certificate': file not found: /var/wazuh-manager/etc/certs/remoted.pem (issued by the credential resolver at installation, or provisioned externally, e.g. with wazuh-certs-tool).
wazuh-manager.conf: Configuration error. ExitingThe credentials file is named only in the package installation output. An operator who reads the journal when the service does not start is told to provision a certificate, which is not the cause. Given the same file, wazuh-indexer and wazuh-dashboard refuse to start and name it in their journals (wazuh-credentials: ...).
How it happens, from the 5.0.0 sources:
- At install,
postinstrunswazuh-manager-resolve-credentials --install. The certificate helper readsWAZUH_MANAGER_CERT_SANSandWAZUH_MANAGER_REMOTED_CERT_SANSfrom the credentials file (wazuh-manager-certificates.sh#L490,#L512). The shared library refuses the unsafe file,wazuh_manager_certificates_ensurefails and no pair is issued. The resolver reports it and exits 0, as designed for--install. - At start,
wazuh-manager-control startrunstestconfigbeforeresolvecredentials(wazuh-server.sh#L679-L681; the restart path does the same at#L652and#L661). The configuration validator stops on the missingremoted.pemand the script exits, so--prestart, the step that would refuse the file and name it, never runs.
The resolver describes this outcome as the one it tries to avoid (resolve-credentials.sh#L665-L667): "say so plainly rather than exiting 0 in silence and letting the operator meet it later as "(1244) file not found" from the configuration validator". The install-time message covers the installation output, but at every later start the journal shows only the (1244) verdict.
Environment
- OS: Ubuntu 22.04 LTS (amd64), one all-in-one host
- Packages:
wazuh-indexer,wazuh-managerandwazuh-dashboard5.0.0, nightly packages built on 2026-10-01 (5.0.0-latest) - Sources referenced:
wazuh/wazuhbranch5.0.0at5bca79d9a4
Evidence
Installation output of wazuh-manager with a credentials file owned by daemon (abridged):
Setting up wazuh-manager (5.0.0-latest) ...
...
wazuh-credentials: file must be owned by root:root: /etc/wazuh/credentials.env
...
resolve-credentials: the manager has no TLS certificates and this install could not issue them
resolve-credentials: provision the pair into /var/wazuh-manager/etc/certs before starting the service
resolve-credentials: (e.g. with wazuh-certs-tool); the service will not start without itJournal of the refused start (journalctl -u wazuh-manager -o cat), identical for each of the six rules:
(1244): Invalid configuration at '/remote/https/certificate': file not found: /var/wazuh-manager/etc/certs/remoted.pem (issued by the credential resolver at installation, or provisioned externally, e.g. with wazuh-certs-tool).
wazuh-manager.conf: Configuration error. ExitingNo line in the journal mentions credentials.env or wazuh-credentials:.
Steps to reproduce
- On a fresh host, write
/etc/wazuh/credentials.envwith valid passwords for the five accounts, following every rule (root:root, mode0600, a regular file,/etc/wazuhand/etcnot writable by group or others). - Break one rule, for example:The other rules behave the same:
# chown daemon /etc/wazuh/credentials.envchgrp daemon /etc/wazuh/credentials.env,chmod 0640 /etc/wazuh/credentials.env, replacing the file with a symbolic link to a copy outside/etc/wazuh,chmod 0770 /etc/wazuh, orchmod g+w /etc. - Install
wazuh-indexer,wazuh-managerandwazuh-dashboard5.0.0. Thewazuh-managerinstallation output names the file and says it could not issue the certificates. - Check that the listener pair was not issued:
# ls -l /var/wazuh-manager/etc/certs/ - Start the manager and read its journal:
# systemctl start wazuh-manager # journalctl -u wazuh-manager -o cat --no-pager
Actual result
wazuh-manager refuses to start, which is correct, but the journal only reports the missing /var/wazuh-manager/etc/certs/remoted.pem and suggests provisioning it. The unsafe credentials file and the rule it breaks are not named at start, for any of the six rules.
Expected result
Either of these, as the manager team decides:
- When the manager refuses to start because of an unsafe credentials file, its journal names the file and the rule it breaks, as the indexer and the dashboard do. For example, the start path could check the credentials file before the configuration validation, or the
(1244)verdict could say when the pair is missing because the install refused the credentials file. - Or the current message is intended. In that case the documentation should say that an unsafe credentials file shows up at start as a missing
remoted.pem, and QA will adapt the test to expect it.
Notes
- Found by AIO-20 (
test_07_unsafe_credentials_file) in wazuh/wazuh-qa-automation#9123. The case stays failing until this is answered. - Not checked: whether, once a pair is provisioned as the message suggests, the next start then refuses the credentials file and names it.
Source: wazuh/wazuh