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:
1 parent
6f9e800779
commit
9ffdbfa259
8 files changed
+103
-9
No files matched your search
@@ -4,7 +4,7 @@ from fastapi import APIRouter, Depends, HTTPException
|
||||
from sqlalchemy.orm import Session
|
||||
from database import get_db
|
||||
from utils.auth import verify_token
|
||||
from services import generator, process
|
||||
from services import generator, process, config
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -25,6 +25,11 @@ def configure_server(db: Session = Depends(get_db)):
|
||||
ok, msg = process.install_config()
|
||||
if not ok:
|
||||
raise HTTPException(status_code=400, detail=f"Configuration rejected: {msg}")
|
||||
ok, msg = process.publish_crl()
|
||||
if not ok:
|
||||
if config.get_system_settings(db).crl_verify:
|
||||
raise HTTPException(status_code=500, detail=f"Configuration installed, but CRL publishing failed: {msg}")
|
||||
logger.warning(f"[SERVER] CRL not published (crl_verify is off): {msg}")
|
||||
return {"message": "Server configuration generated", "path": output_path}
|
||||
|
||||
# Ensure we can write to /etc/openvpn
|
||||
|
||||
Reference in new issue
Block a user