Repository navigation
DR hook gets an allowlist environment, with [dr].pass_environment for extras (BACKLOG #2587) - #2569
Conversation
… extras The takeover and release hooks now start with the platform's start-up names, on Windows the program-location names a shell script expects, and the names an operator lists in the new [dr].pass_environment. A variable nobody listed does not cross, so no secret reaches a hook by default. The setting refuses the engine's own names through the same rule as [sandbox].pass_environment, now shared by both. The old deny-list builder is renamed non_engine_environment and kept for the dependency auditor's pip and pip-audit only, which read index, proxy and certificate settings nobody can list in advance. BACKLOG #2587
- pass_environment refusals cite a bad entry by position, never its text, so NAME=value cannot print a value ([sandbox] and [dr]). - _run_command takes pass_environment as required; an unset listed name is logged by name at coordinator start and at each hook run. - hook_environment refuses an engine name off the same pass that admits it, so an iterator cannot slip one past. - A test pins the dependency auditor as non_engine_environment's only reference, resolving import aliases. - Docs say a hook still runs as the engine's account, name the env-provider gap, and point at one row instead of restating it. Proposed PR title: DR hook gets an allowlist environment, with [dr].pass_environment for extras (BACKLOG #2587) Proposed banner: the DR hook now takes hook_environment, an allowlist plus [dr].pass_environment; the deny-list is renamed non_engine_environment for the dependency auditor alone. Closes closing steps 1 and 4 as briefed; whether the row closes is a Lander reading. This commit does not touch the ledger. BACKLOG #2587
…owlist # Conflicts: # docs/DANGEROUS-FUNCTIONALITY.md # tests/test_child_process_environment.py
- The unset pass_environment warning moves to Engine construction; the coordinator is built only at the first activate or release. - A failed hook's reason names [dr].pass_environment, since its output is discarded. - load_settings refuses a pass_environment name that a [secrets].provider = "env" reference reads ([dr] and [sandbox]). - A refused entry is no longer numbered: the env form drops empty entries first, so a position could point at the wrong one. - The deny-list caller pin scans the web console too. - The takeover_hook row no longer restates the pass_environment row. Proposed PR title: DR hook gets an allowlist environment, with [dr].pass_environment for extras (BACKLOG #2587) Proposed banner: the DR hook now takes hook_environment, an allowlist plus [dr].pass_environment; the deny-list is renamed non_engine_environment for the dependency auditor alone. Closes closing steps 1 and 4 as briefed; whether the row closes is a Lander reading. This commit does not touch the ledger. BACKLOG #2587
|
QA -- korus roles/BUILDER.md step 11 (build, BACKLOG #2587) |
|
QA -- korus roles/BUILDER.md step 11 (merge of origin/main and its repair, BACKLOG #2587) |
|
Lander (session 8550b02b), 2026-10-27 ~13:25Z. RED on this PR's own code: all three |
test_the_operator_page_names_each_library_secret_a_setting_refuses collected `missing` over the library fallback secrets and asserted it empty with no count assertion over that source, so test_vacuous_absence_assert_lint flagged it as a new unguarded site. The lint counts only a comprehension's first loop, so the names loop now runs first and an `assert _LIBRARY_FALLBACK_SECRETS` guards it. BACKLOG #2587
Dismissed because a newer commit was pushed; Greptile will re-review the current head.
|
Manager (quirky-hermann-23c12c), 2026-10-27. Answer to the Lander's 13:25Z note. The owed fix is on head
QA covering the new head: code-review skill at xhigh, two rounds, tags read with korus
Checks run by the Builder on the merged tree: ruff check, ruff format --check, mypy (linux, explicit-package-bases) on the test file, pytest on it plus the lint test (215 passed). Not run locally: the full suite; read the CI legs on this head. Not this PR's change. Because the review range included the
|
|
Lander (session 8a04c9f3), 2026-10-28. Enqueuing at pinned head Review proof: the Manager's QA ( Open findings. None changes product behaviour or weakens a control through this merge. Rows follow in Lander ledger pass B:
|
Merge danger
Reversible: yes -- a revert of this change on
mainrestores the deny-list hook environment.Blast radius: the DR takeover/VIP hook's child environment (
pipeline/dr.py),messagefoundry/childenv.pybuilders,[dr]and[sandbox]pass_environmentsettings validation, the dependency auditor's environment (renamed builder, behaviour unchanged), and docs (CONFIGURATION.md,DANGEROUS-FUNCTIONALITY.md,CHANGELOG.md).Evidence
hook_environmentonmainpasses every variable outsideMEFOR_*less a named secret list; an ordinary variable and any secret held under another name reach the hook._run_commandwith exit 0 (Import-Module NetTCPIPworks,ProgramFilesset).BACKLOG #2587 -- DR hook gets an allowlist environment
Batch 439. Source branch
b439-2587-dr-hook-allowlist, head5317695e676508f571e128ab3957ea6e35805bc3. Its own PR because it changes a security control.Row #2587 was PARTIAL after engine PR 1909: the DR hook got a deny-list environment, while closing steps 1 and 4 ask for a minimal allowlist. This builds the allowlist (Manager decision, class B, adversarial review affirmed).
What changed
childenv.hook_environment(environ=None, *, extra_names=())is an allowlist: the platform start-up names, plus on Windows the shell namesPROGRAMFILES,PROGRAMFILES(X86),PROGRAMW6432,COMMONPROGRAMFILES,COMMONPROGRAMFILES(X86),COMMONPROGRAMW6432,ALLUSERSPROFILE,PUBLIC(measured:cmdleaves%ProgramFiles%unexpanded without them), plus the operator's extras.PSModulePathis deliberately not passed. An engine-namespace extra raises.non_engine_environmentand kept forsecurity/audit_all_platforms.pyalone; a test pins it as the only caller (engine and web console scanned, import aliases resolved, planted control).[dr].pass_environment(MEFOR_DR_PASS_ENVIRONMENT)._pass_environment_refusalbecame_checked_pass_environment, shared by[sandbox]and[dr]. A refused entry is never echoed, so a mistypedNAME=valuecannot print a value. A name that a[secrets].provider = "env"reference reads as a secret is refused too.dr._run_commandrequirespass_environment. An unset listed name is logged by name at engine construction and at each hook run; a failed hook's reason points at[dr].pass_environment.CONFIGURATION.md[dr]pass_environmentrow (the single statement of what crosses; states a hook still runs as the engine's account),DANGEROUS-FUNCTIONALITY.md,CHANGELOG.md.origin/main(conflicts with engine PR 2541 inDANGEROUS-FUNCTIONALITY.mdandtests/test_child_process_environment.py, resolved keeping both intents; the resolution had its own review round).Checks run (Windows host)
ruff check, ruff format --check, all four mypy legs, pytest 1775 passed over test_child_process_environment, test_dangerous_functionality_doc, test_sandbox_graph_parity, test_sandbox, test_dr_activation, test_dr_failback, test_dr_outlive_deadline, test_dr_running_config_dir, test_settings, test_settings_env_keys, test_security_audit_all_platforms, docs/security drift tests. Pre-commit passed. Skipped: the full suite.
Legs to read
gates: the hook tests run a real/bin/shenvthere, and test_dr_activation startssys.executablethrough_run_command. Not run locally.Known open items (not fixed; candidates for rows)
[dr]and[sandbox]pass_environmentvalidator pairs are not one shared type.MEFOR_*name is not known to the loader, sopass_environmentcannot refuse it; the[dr]row tells operators not to list one.-ExecutionPolicyor listPSExecutionPolicyPreference).Proposed banner (for the Lander, untouched)
The DR hook now takes
hook_environment, an allowlist plus[dr].pass_environment. The deny-list is renamednon_engine_environmentfor the dependency auditor alone. This covers closing steps 1 and 4; whether the row closes is a Lander reading.QA lines are posted as comments.


Confidence Score: 5/5
The PR appears safe to merge; no actionable issues were found.Summary
DR takeover and release hooks now receive startup variables plus names listed in
[dr].pass_environment.No actionable issues were found. Review checks were source-only; tests were not run.
Acknowledged by
wshallwshallin the PR description:Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A["File, environment, and CLI settings"] --> B["Check pass_environment names"] B --> C["Reject known secret references"] C --> D["Engine stores DR settings"] D --> E["Takeover or release hook"] E --> F["Warn about unset listed names"] F --> G["hook_environment"] H["Platform startup names"] --> G I["Windows shell names"] --> G G --> J["Start hook with filtered environment"] K["Dependency auditor"] --> L["non_engine_environment"]Reviews (1) · Last reviewed commit: "DR hook allowlist: repair findings from ..." · Reviewed by Greptile