Repository navigation
fix(orchestrator): accept job events only from the job's own workers - #76
Merged
Merged
Conversation
A job event was accepted from any approved worker, so a signature proved who sent it but not that the job was theirs. A collector of another group, a storage worker of another target or a receiver could mark a device's active job stored or failed, set its storage reference and append to any job's log. The storing step is now accepted only from a storage worker of the job's target, and everything else only from a collector of the device's collection group. Events about a pushed backup's collection are refused, since no worker collects it. A refused event changes nothing and is logged as job_event_refused. Membership is read when the event arrives, so a worker taken off a group or target mid-job loses its say in that job. Host key pinning no longer checks the collector itself: the collected event is scoped before it gets there.
6 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #75 (targets its branch): both change the job event handler. Retarget to
masteronce #75 merges.What and why
A job event was accepted from any approved worker. The signature proved who sent it, not that the job was theirs, so a collector of another group, a storage worker of another target or a receiver could:
storage_ref;Events are now accepted only from the job's own workers (
backups.jobs._not_its_worker):stored, or any event with stagestore): a storage worker of the job's target.A refused event changes nothing on the job and is logged as
job_event_refusedwith the worker and reason. Deletion events already had their own check and are unchanged.Behaviour to be aware of:
Host key pinning (#75) no longer checks the collector itself, since the
collectedevent is scoped before it gets there.How it was tested
make checkpasses.Checklist
make checkpasses locallyDV_*variables are documented indocs/DEPLOYMENT.mdand the relevant*.env.example(none added)makemigrations) (no model changes)api/serializers.py,api/views.pyandfrontend/src/api/types.ts/endpoints.tsin step (no API changes)README.md,docs/) updated where behaviour changed