Skip to content

🐛 fix(conformance): fix negative-probe secret perms and the edge handshake expectation - #202

Merged
scttbnsn merged 2 commits into
dev/v1.6from
fix/150-conformance-probe-fixes
Aug 6, 2026
Merged

🐛 fix(conformance): fix negative-probe secret perms and the edge handshake expectation#202
scttbnsn merged 2 commits into
dev/v1.6from
fix/150-conformance-probe-fixes

Conversation

@scttbnsn

@scttbnsn scttbnsn commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Round 2 from the live conformance matrix (31058731379): #201 got the main auth handshake green on all three rows; this fixes the three remaining harness bugs it exposed, each verified against the live published images (portwing 0.9.2, drydock latest):

  • Wrong-secret probe (standard rows): mktemp creates the file 0600 owned by the runner, so the throwaway drydock EACCESed as its node user (UID 1000) before ever sending the request that would 401 — the probe timed out instead of observing the documented failure mode. The deliberately-wrong value is now chmod 0644.
  • Unknown-key probe (edge row): same mktemp lockout for the throwaway portwing (UID 65532) — the key file is now chowned before use. And the probe watched the wrong side: drydock rejects a bad hello silently (an error frame to the client via sendErrorAndClose, no server-side log — verified in app/api/portwing-ws.ts), so the assertion now reads rejected hello|unknown-key from the throwaway portwing's own logs (controller rejected hello: Unknown or revoked key (unknown-key), captured from a live rig).
  • Edge handshake expectation: drydock's WS path never emits Standard mode's Handshake successful line — the second run's log dump showed the Ed25519 hello succeeding (Edge agent connected: portwing-edge-<id> (version=0.9.2, drydockCompat=1.4.0)) while the assertion still timed out grepping for the standard line. Edge rows now assert Edge agent connected.

The bundle README's Edge section documented the same wrong log line and pointed debugging at drydock's (silent) side — rewritten with the verified texts, including drydock's startup Failed to load DD_PORTWING_AUTHORIZED_KEYS warning when the keys file is world-readable.

Self-test, shellcheck, and the harness npm tests pass. After merge: dispatch run 3 of the matrix from dev/v1.6 against ghcr.io/codeswhat/sockguard:1.6.0-rc.1.

Changelog

  • 🐛 Fixed wrong-secret probes by making temporary secret files world-readable.
  • 🐛 Fixed unknown-key probes by assigning private-key ownership to Portwing’s runtime UID.
  • 🔧 Changed unknown-key validation to inspect Portwing logs for rejected hellos.
  • 🔧 Updated edge handshake checks to expect Edge agent connected.
  • ✨ Updated Edge Mode troubleshooting guidance with verified logs and key-file errors.
  • 🔒 Preserved authentication failure validation for wrong-secret and unknown-key probes.
  • ✨ Verified self-test, ShellCheck, and harness npm tests.

Concerns

  • Confirm temporary probe files are removed after each matrix run.
  • Confirm world-readable permissions apply only to temporary probe files.
  • Confirm generated private keys are not exposed in logs or retained after the probe.

…shake expectation

Second live matrix run (31058731379): main auth-handshake green on all rows after #201, three more harness bugs surfaced, all pinned against live published images:

- 🐛 fix(conformance): wrong-secret probe's mktemp file is 0600 runner-owned -- the throwaway drydock EACCESes as node (1000) before sending the request that would 401; the garbage value is now chmod 0644
- 🐛 fix(conformance): edge probe's throwaway key gets chowned 65532:65532 so the throwaway portwing can actually read it (same mktemp lockout)
- 🐛 fix(conformance): edge rows assert 'Edge agent connected' -- drydock's WS path never emits standard mode's 'Handshake successful' line; the unknown-key probe now reads 'rejected hello|unknown-key' from the throwaway portwing's logs because drydock rejects bad hellos silently (error frame to client, no server-side log; verified in portwing-ws source and against a live rig)
- 📝 docs(examples): README edge section rewritten with the verified log lines ('Edge agent connected: portwing-edge-<id>', portwing-side 'controller rejected hello ... (unknown-key)', drydock's world-readable-keys startup warning)
- 📝 docs(changelog): record round 2 under [Unreleased]
@vercel

vercel Bot commented Aug 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sockguard-website Ready Ready Preview Aug 6, 2026 1:48am

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@scttbnsn, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 48 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 107d4925-24b6-40d6-84b1-c8dc37fa442a

📥 Commits

Reviewing files that changed from the base of the PR and between 5fc9393 and 014008b.

📒 Files selected for processing (2)
  • examples/compose/tri-tool/README.md
  • scripts/tri-tool-conformance/run-matrix.sh
📝 Walkthrough

Walkthrough

The conformance harness now makes temporary authentication credentials readable by the required runtime users. Unknown-key checks use Portwing logs and specific rejection messages. Authentication success checks use Handshake successful in Standard Mode and Edge agent connected in Edge Mode. The Edge Mode README troubleshooting guidance now matches these logs and documents related key and permission failures.

Possibly related PRs

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/150-conformance-probe-fixes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@scttbnsn

scttbnsn commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@examples/compose/tri-tool/README.md`:
- Line 114: Update the permission guidance near the drydock startup warning to
target portwing_authorized_keys, which drydock reads as UID 1000, rather than
the Portwing private key portwing_ed25519.pem. Provide the ownership and
restrictive mode command for portwing_authorized_keys and keep the existing
private-key permissions guidance separate.

In `@scripts/tri-tool-conformance/run-matrix.sh`:
- Around line 495-503: Update all cleanup paths after the chown in the probe
setup around key_file to remove the UID 65532-owned file with sudo, including
the failure cleanup and later cleanup calls. Use the existing key_file variable
and preserve the current cleanup behavior while ensuring set -e cannot fail on
unlinking the chowned file.
- Around line 518-532: Update the unknown-key probe in
scripts/tri-tool-conformance/run-matrix.sh lines 518-532 to require an
unknown-key-specific rejection signal rather than matching bad-signature through
the current OR pattern. Update examples/compose/tri-tool/README.md line 114 to
distinguish remediation: check key registration or revocation for unknown-key,
and verify private/public key matching for bad-signature.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: eefabf13-f29c-4b98-8f45-f73139954e68

📥 Commits

Reviewing files that changed from the base of the PR and between 21b0842 and 5fc9393.

⛔ Files ignored due to path filters (1)
  • CHANGELOG.md is excluded by !CHANGELOG.md
📒 Files selected for processing (2)
  • examples/compose/tri-tool/README.md
  • scripts/tri-tool-conformance/run-matrix.sh

Comment thread examples/compose/tri-tool/README.md Outdated
Comment thread scripts/tri-tool-conformance/run-matrix.sh
Comment thread scripts/tri-tool-conformance/run-matrix.sh
- 🐛 fix: require 'rejected hello.*unknown-key' on one line so a
  bad-signature rejection can't falsely pass the unknown-key probe
- 🐛 fix: sudo rm the chowned throwaway key on both post-chown cleanup
  paths (sticky /tmp blocks the runner from unlinking a 65532-owned file)
- 📝 docs: edge README now distinguishes bad-signature (registered key
  doesn't match the private key) from unknown-key, and states the
  authorized_keys chown/chmod command explicitly in the startup warning
@scttbnsn
scttbnsn merged commit a8360b4 into dev/v1.6 Aug 6, 2026
39 checks passed
@scttbnsn
scttbnsn deleted the fix/150-conformance-probe-fixes branch August 6, 2026 01:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant