Verify Group Who Owns /etc/ipsec.secrets File
Ensures /etc/ipsec.secrets (VPN credentials) is group-owned by root.
Checked against a path’s metadata, mode, owner, group, SUID/SGID.
A mapping is a cross-reference to where each standard places this requirement, anchored and cross-validated, not a claim of equivalence. A passing check is evidence toward these references, how to read it.
Why this rule matters
/etc/ipsec.secrets stores the Libreswan pre-shared keys and private-key references, the actual VPN credentials. If a non-root group owns it, members of that group could read the secrets and impersonate the VPN endpoint or decrypt traffic. Assigning group ownership to root ensures these credentials stay under exclusive root control.
What Pavois checks
Pavois asks the file resource for the resolved group of /etc/ipsec.secrets and requires it to be root. The check is skipped if the file does not exist. Reading the effective group ownership directly from the system is exact and avoids assumptions about the file's defaults.
only_if { file('/etc/ipsec.secrets').exist? }
describe file('/etc/ipsec.secrets') do
its('group') { should eq 'root' }
endHow to verify it is applied
Run stat -c '%G' /etc/ipsec.secrets. Expected: root. ls -l /etc/ipsec.secrets shows the group in the owner column.
Inspect & investigate
- Inspect ownership and permissions:
stat -c '%U %G %a' /etc/ipsec.secretsorls -l /etc/ipsec.secrets. - Validate the VPN still starts:
systemctl status ipsec. - If auditd watches the file, changes appear in
/var/log/audit/audit.log.
Remediation
pavois harden apply uses the file resource to set the group owner of /etc/ipsec.secrets to root (equivalent to chgrp root /etc/ipsec.secrets). It is idempotent and applied automatically when you run pavois harden apply.
Pavois applies this with its own harden engine, the plan below, not a shell script:
| group | root |
|---|---|
| path | /etc/ipsec.secrets |
| resource | file |
pavois harden plan localwhere the target is local, a user@host SSH alias, or a container , Docs
Impact & precautions
Wrong group ownership exposes the VPN's secret keys, risking impersonation of the tunnel endpoint and decryption of protected traffic, a credential-confidentiality breach. The chgrp fix is low-risk; it touches only ownership, so no restart is normally required, but verify the IPsec service still loads its secrets afterwards.
Standards mapping
| Standard | Reference | Type | Version | Confidence |
|---|---|---|---|---|
| ANSSI BP-028 | R50 | direct | 2.0 | high |
Each reference is a cross-reference anchored in the upstream benchmark and cross-validated against the SCAP Security Guide and ansible-lockdown, not a claim of equivalence. Direct = a prescriptive, line-level requirement; supporting = an abstract control family (NIST) the check provides evidence toward. How to read a mapping.