← All rules
SOCLE-CLD-FSP-023// File ownershipmediumfilesystem state

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 pass proves✓ running now✓ on disk✓ survives rebootthe qualified verdict →
Debian 12CIS 1.1.0Debian 13CIS 1.0.0FedoraRHEL 10 / Rocky 10 / AlmaLinux 10RHEL 8 / Rocky 8 / AlmaLinux 8CIS 4.0.0RHEL 9 / Rocky 9 / AlmaLinux 9CIS 2.0.0Ubuntu 22.04CIS 3.0.0Ubuntu 24.04CIS 1.0.0Ubuntu 26.04
One check, maps to 1 standard

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' }
end

How 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.secrets or ls -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:

grouproot
path/etc/ipsec.secrets
resourcefile
pavois harden plan local

where 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

StandardReferenceTypeVersionConfidence
ANSSI BP-028R50direct2.0high

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.

Sources & references