--helper-path override documented in config.py comment but CLI flag is not implemented #4
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The comment above
HELPER_DEFAULT_PATHinconfig.pystates the path is "Overridable per-deployment via--helper-pathon the main CLI (see cli.py)", butcli.pyhas no--helper-pathargument. Additionally,SUDO_HELPER_PREFIXis built once at module load time fromHELPER_DEFAULT_PATH, so even ifNginxOpsis constructed with a customhelper_path=, theis_sudo_allowed()check inNginxOps._invoke()will always fail for any path other than the hardcoded default.Location
src/certbot_manager/config.py, lines 83–85 (the misleading comment andSUDO_HELPER_PREFIXdefinition)src/certbot_manager/cli.py(the missing--helper-pathargument)src/certbot_manager/infra/nginx_ops.py, lines 128–130 (_invokebuilds argv fromself._helper_pathbut checks againstSUDO_ALLOWLISTwhich only contains the default path)Risk
An operator following the comment to deploy the helper at a non-default location would find:
--helper-pathflag to pass.NginxOps(helper_path=...)programmatically, all helper invocations raiseOperationError("argv not in sudo allowlist")at runtime.This leaves no supported way to relocate the helper binary without modifying source code, contrary to what the documentation implies.
Suggested fix direction
Either add the
--helper-pathargument tocli.pyand plumb it through toNginxOps, or remove the misleading comment and make the docs clear that the path is fixed. If the flag is added,SUDO_HELPER_PREFIXmust be built dynamically (or the allowlist check must compare only the non-path portions of the argv) to avoid the false-failure inis_sudo_allowed().Severity
minor
Found by
Automated audit by Claude Code