Skip to content

Report file permissions observed by startup isolation probes - #700

Closed
jamesKhor wants to merge 3 commits into
BaaRai:mainfrom
jamesKhor:fix/isolation-probe-read-664
Closed

jamesKhor wants to merge 3 commits into
BaaRai:mainfrom
jamesKhor:fix/isolation-probe-read-664

Conversation

@jamesKhor

@jamesKhor jamesKhor commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Related to #664. We could not reproduce the reported refusal to start with Docker inside Proxmox LXC on ZFS. The reporter saw a regular CA key owned by root with mode 0600. In the reported build, the self-test runs before traffic initialization, which can set an existing CA key to 0600. The timing of the permission check therefore matters. Follow-up with the reporter.

Both the Bash and file-tool probes now report the path, file mode, and numeric owner and group from the descriptor they opened under their respective identities. Every successful read-only open still fails the self-test. The probes never read or log key contents. A missing path or permission denial is expected. Other open errors are reported as inconclusive and fail the self-test. A FIFO at a secret path can be checked without waiting for a writer.

The tests cover a readable regular file, a missing path, a symlink loop, and a FIFO without a writer. The existing root-only Linux integration test now checks the metadata returned by both identities. The focused Windows startup tests passed and the Linux server test binary compiled locally. The PR checks run the Linux suite. The reported upgrade remains open for confirmation.

Linux CI for the revised commit passed the full Go suite on the pinned and latest stable toolchains, the race checks, and govulncheck. These jobs run as an unprivileged user and skip the root-only integration tests.

@jamesKhor
jamesKhor marked this pull request as draft November 30, 2026 05:16
@jamesKhor jamesKhor changed the title fix: read secret contents in startup isolation probes Report file permissions observed by startup isolation probes Nov 30, 2026
@jamesKhor
jamesKhor marked this pull request as ready for review November 30, 2026 05:46
@BaaRai

BaaRai commented Nov 30, 2026

Copy link
Copy Markdown
Owner

Landed in main through #722 (merge 86a5eb9). Thank you @jamesKhor.

Your probe change is in server/isolation_unix.go, rebased onto the fail-closed isolation work from #715. secretOpenFailure now opens each protected path directly under the probe identity with O_RDONLY|O_NONBLOCK|O_NOCTTY, reports descriptor mode, uid and gid, and treats unexpected open errors such as symlink loops as failures instead of only reading permission bits. LockDownKeyDir, the keys/ directory check and the fail-closed EnforceIsolation are preserved.

The tests from your branch (isolation_unix_test.go, isolation_root_linux_test.go) pass on the merged tree. Closing as merged; credit in the 0.7.1 notes.

@BaaRai BaaRai closed this Nov 30, 2026
1119738829 pushed a commit to 1119738829/ARTEX that referenced this pull request Nov 30, 2026
…scriptor metadata

Rebase BaaRai#700 onto P0's isolation changes in server/isolation_unix.go (preserving
LockDownKeyDir, keys/ dir checking, and fail-closed EnforceIsolation): probe
each protected path directly with O_RDONLY|O_NONBLOCK|O_NOCTTY under the file-
tool and Bash identities, report descriptor mode/uid/gid or unexpected open
errors, and add the 0.7.1 CHANGELOG entry.

Co-authored-by: BaaRai <130491490+BaaRai@users.noreply.github.com>
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.

2 participants