Release 0.4.0: deletion-safety hardening - #3
Merged
Merged
Conversation
Driven by an external security audit. No data-loss path may delete a directory ephemdir cannot prove it created. - .ephemdir ownership marker (uuid + inode) matched before any auto-delete; legacy <=0.3 entries shown as 'legacy' and never auto-removed. - Journaled two-phase deletion with per-directory OS locks; every sweep starts with a recovery pass; ambiguous states parked for `recover`. - POSIX cleanup is fd-relative (O_DIRECTORY|O_NOFOLLOW, dir_fd ops) with symlink, parent-trust and Linux mount-boundary checks; no rmtree fallback. - Deletion guard refuses root/home/data-dir even with --force. - Real flock/msvcrt registry lock; corrupt registries quarantined under lock; malformed entries rejected on load; world/group-writable registry refused. - 64-bit random token in names; service runs `python -I -m ephemdir` from / with scrubbed env; install-service validates interpreter, full package tree and startup hooks (documented trust boundary in README/SECURITY). - Python 3.10+ on Linux/macOS only; reproducible hash-pinned builds; pinned Actions. 245 tests, ruff + mypy --strict clean.
- requirements-build.txt: add tomli==2.4.1 (marker python_version<"3.11") with hashes. `build` needs tomli on 3.10 (no stdlib tomllib), which broke `pip install --require-hashes` on the 3.10 jobs. - core._staging_ownership: a recorded-but-missing marker no longer counts an inode match as ownership. ext4/tmpfs reuse a freed inode number immediately, so a foreign tree recreated at the private staging path could inherit the recorded (dev, ino). It is now classified "unverified" and parked for recovery instead of deleted. macOS/APFS hid this; Linux CI caught it.
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.
Hardening release driven by an external security audit.
Highlights
ephemdir recoverfor ambiguous states.--force.python -I -m ephemdirfrom/;install-servicevalidates interpreter, package tree and startup hooks (trust boundary documented).245 tests, ruff + mypy --strict clean.