Publish CRL for the unprivileged OpenVPN user so crl_verify works

- ovpmon-helper: new publish-crl command (validated copy of pki/crl.pem to
  /etc/openvpn/crl.pem, root:root 644); crl-verify allowlisted only for
  that path; CRL is refreshed on service start/restart.
- Profiler: publish after gen-crl (init/revoke) and on server/configure;
  generator renders the published path when running unprivileged.
- doas rule for publish-crl; docs and helper copy updated.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
iclaoudezinandClaude Sonnet 5.5 committed 2026-09-30 12:38:30 +00:00
1 parent 6f9e800779
commit 9ffdbfa259
8 files changed
+103 -9

No files matched your search

+13
View File
@@ -48,6 +48,19 @@ def install_config():
return False, msg
def publish_crl():
"""Publish pki/crl.pem to a root-owned location readable by the OpenVPN user (nobody).
No-op when running as root/in a container (OpenVPN reads the PKI directly). Returns (ok, message)."""
if is_container() or os.geteuid() == 0:
return True, "not required"
rc, data, raw = _run_helper(["publish-crl"])
if rc == 0 and data and data.get("status") == "ok":
return True, "CRL published"
msg = (data or {}).get("error") or raw or "helper failed"
logger.error(f"[PROCESS] publish-crl failed: {msg}")
return False, msg
def control_service(action: str):
"""
Action: start, stop, restart