Skip to content

feat: add pre-write immutability filter for private datasets on enclave#9418

Open
rasswanth-s wants to merge 2 commits into
devfrom
stephen/enclave-dataset-immutability
Open

feat: add pre-write immutability filter for private datasets on enclave#9418
rasswanth-s wants to merge 2 commits into
devfrom
stephen/enclave-dataset-immutability

Conversation

@rasswanth-s

Copy link
Copy Markdown
Collaborator

Summary

  • Adds an optional pre_write_filter hook to DataSiteWatcherCache that gates every file write/delete in apply_event_message()
  • Implements make_private_dataset_immutability_filter() in the enclave package — blocks overwrites/deletes of private dataset files that already exist on disk
  • Wires the filter in SyftEnclaveClient.from_config() so all enclave instances enforce immutability automatically

Threat addressed: Once a DO shares private dataset files with the enclave, subsequent re-sends or sync cycles cannot overwrite them — ensuring the data the enclave computes on remains the same as what was originally delivered.

Test plan

  • Unit tests for is_private_dataset_path() (positive, public path, wrong subdir, too short)
  • Unit tests for the filter (allows first write, blocks overwrite, blocks delete, allows non-dataset paths, allows remaining files in batch)
  • Integration test: full quad setup, DO shares dataset, DO re-shares tampered data, enclave retains original
  • All 67 existing enclave tests pass
  • All 113 syft_bg tests pass

Prevents overwrites/deletes of private dataset files once they exist on
the enclave filesystem, ensuring data integrity between share and job
execution.

(cherry picked from commit 1d7c295e7522b1631a9792f0e10daafd8d3081e5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants