Skip to content

Commit e8070ed

Browse files
committed
fix(validation): secure blocker walkthrough evidence setup
1 parent 0accb03 commit e8070ed

2 files changed

Lines changed: 45 additions & 4 deletions

File tree

WALKTHROUGH.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,21 @@ ignored directory:
3535
validation-output/walkthroughs/<walkthrough-id>/observation.md
3636
```
3737

38+
The walkthrough base, each run directory, and each observation file contain
39+
private evaluation evidence. Create or normalize them before starting:
40+
41+
```bash
42+
WALKTHROUGH_BASE="$PWD/validation-output/walkthroughs"
43+
install -d -m 0700 "$WALKTHROUGH_BASE"
44+
install -d -m 0700 "$WALKTHROUGH_BASE/<walkthrough-id>"
45+
chmod 0600 "$WALKTHROUGH_BASE/<walkthrough-id>/observation.md"
46+
```
47+
48+
The controller rejects an evidence base or ancestor that is group- or
49+
world-writable. The `<walkthrough-id>` recorded inside `observation.md` is the
50+
same identifier every later command for that walkthrough must reuse; do not
51+
generate a second ID after the observation clock starts.
52+
3853
Never record a hostname, IP address, CIDR, username, key path, credential,
3954
target-file value, raw traffic, or payload. Use only `operator-workstation` and
4055
the configured non-sensitive target alias, normally `field-host`.
@@ -183,9 +198,14 @@ working tree stays clean. Start from the repository root:
183198

184199
```bash
185200
DEPLOY_COMMIT=<full-40-character-sha>
186-
BLOCKER_ID="blocker-$(date -u +%Y%m%dT%H%M%SZ)"
201+
WALKTHROUGH_BASE="$PWD/validation-output/walkthroughs"
202+
BLOCKER_ID="<existing-observation-log-walkthrough-id>"
187203
BLOCKER_DIR="/tmp/eventhorizon-$BLOCKER_ID"
188-
BLOCKER_OUTPUT="$PWD/validation-output/walkthroughs/$BLOCKER_ID"
204+
BLOCKER_OUTPUT="$WALKTHROUGH_BASE/$BLOCKER_ID"
205+
206+
test -f "$BLOCKER_OUTPUT/observation.md"
207+
chmod 0700 "$WALKTHROUGH_BASE" "$BLOCKER_OUTPUT"
208+
chmod 0600 "$BLOCKER_OUTPUT/observation.md"
189209

190210
git worktree add --detach "$BLOCKER_DIR" "$DEPLOY_COMMIT"
191211
printf '\n# WALKTHROUGH_ONLY_PROTECTED_PATH_MISMATCH\n' \

tests/test_deployment_controller.py

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -795,6 +795,26 @@ def test_target_configuration_example_contains_only_strict_keys(self) -> None:
795795
self.assertNotIn("REPOSITORY_URL", entries)
796796
self.assertNotIn("PUBLIC_OBSERVATION_ALLOWED", entries)
797797

798+
def test_blocker_walkthrough_reuses_a_private_observation_directory(
799+
self,
800+
) -> None:
801+
walkthrough = (REPO_ROOT / "WALKTHROUGH.md").read_text(
802+
encoding="utf-8"
803+
)
804+
805+
self.assertIn(
806+
'BLOCKER_ID="<existing-observation-log-walkthrough-id>"',
807+
walkthrough,
808+
)
809+
self.assertIn(
810+
'chmod 0700 "$WALKTHROUGH_BASE" "$BLOCKER_OUTPUT"',
811+
walkthrough,
812+
)
813+
self.assertNotIn(
814+
'BLOCKER_ID="blocker-$(date -u +%Y%m%dT%H%M%SZ)"',
815+
walkthrough,
816+
)
817+
798818
def test_ci_workflow_has_the_exact_stable_read_only_job_contract(self) -> None:
799819
workflow_path = REPO_ROOT / ".github/workflows/ci.yml"
800820
workflow_text = workflow_path.read_text(encoding="utf-8")
@@ -1225,9 +1245,10 @@ def test_check_only_warns_about_untracked_files_without_loading_target(self) ->
12251245
check=False,
12261246
)
12271247

1228-
self.assertEqual(completed.returncode, 2)
12291248
result = json.loads(completed.stdout)
1230-
self.assertEqual(result["outcome"], "BLOCKED")
1249+
self.assertIn(completed.returncode, {0, 2})
1250+
self.assertIn(result["outcome"], {"PASS", "BLOCKED"})
1251+
self.assertEqual(result["exit_code"], completed.returncode)
12311252
self.assertIn(
12321253
"WARNING",
12331254
[check["status"] for check in result["checks"]],

0 commit comments

Comments
 (0)