oliver-zehentleitner / maity

hub runners: a removed member's runners are detached; a re-pair voids unused pickups; stricter repository URLs

Sign in to report

tsk-pe96bj60bdtv Open

Four hardening points on the hub's runner side.

  1. Removing a member does not detach the runners that member owns (hub/src/maity_hub/routes/members.py, the removal cascade). Their runner keeps receiving the project's name and repository URL on every hello, and the ex-member cannot detach it themselves. The removal cascade detaches the removed member's runners; alternatively, the hub sends no project facts to a runner whose owner is no longer a member. Test: after a removal, the runner's next hello carries nothing of the project.
  1. A pickup that happens while the owner re-pairs the runner can leave a join that outlives the re-pair. pick_up re-checks the caller's runner credential under the project lock in its own transaction, or every re-pair revokes the runner's unused pickups. Test with a forced order of the two.
  1. repository_url_ok accepts an ssh URL whose user part starts with -. Refuse a user part that starts with - (and any that is not a plain name). Test.
  1. workspace.branch has no hub-side pattern, so a non-string or odd branch reaches the runner and ends in a crash loop instead of a clean refusal. Validate it when it is set.

Security leg on the PR. Docs: docs/api.md where the removal cascade and the repository URL rules are described.