Skip to content

fix(deploy): the sops test asserts the portable fact — mode bits on unix, the DACL on windows - #580

Merged
David-Noble-at-work merged 1 commit into
developfrom
sops-asserts-the-portable-fact
Aug 20, 2026
Merged

David-Noble-at-work merged 1 commit into
developfrom
sops-asserts-the-portable-fact

Conversation

@David-Noble-at-work

Copy link
Copy Markdown
Contributor

#433 expected a production fix and found none owed: DecryptSopsFile already writes the plaintext through
the session root, the deploy environment is confined, and enforceSecretFloor refuses any mode granting
group or other. The write has been enforced all along — what remained was the test asserting
Mode().Perm() == 0600, which reports 0666 on Windows however private the file actually is.

The change

TestExecute_SopsChains asserts privacy in each platform's own terms via a build-tagged assertPrivateFile
pair:

Platform Assertion
unix mode bits are 0600, as before
windows the DACL reads back with SE_DACL_PROTECTED — inheritance broken, phase 2's shape

The runner now verifies the production DACL on decrypted plaintext rather than assuming it: if the deploy
path ever stops protecting, the Windows leg goes red with this test's name on it.

Zero production change — which is the finding. Plan §3.4 records it.

Expected Windows movement — the review check

Name-for-name diff vs baseline 4: exactly TestExecute_SopsChains removed, none added. Baseline 4 → 3 —
the write-path cluster closes; the three #547 path-as-text tests are all that remain.

Verified

  • make check — 103 packages ok, 0 failures
  • make vet GOOS=windows (load-bearing: the new windows assertion file)
  • gofmt -l — clean

Closes #433. Refs #405, #430.

…unix, the DACL on windows

#433 expected a production fix and found none owed: DecryptSopsFile already writes the plaintext through the
session root (encryption/provider.go), the deploy environment is confined, and enforceSecretFloor refuses
any mode granting group or other. The write has been enforced all along. What remained was the test asserting
Mode().Perm() == 0600, which reports 0666 on Windows however private the file actually is -- an assertion
with nothing true to say there.

TestExecute_SopsChains now asserts privacy in each platform's own terms through a build-tagged
assertPrivateFile pair: the unix half checks the 0600 mode bits as before; the windows half reads the
access-control list back and requires SE_DACL_PROTECTED, in the shape phase 2's applymode tests established.
The runner now VERIFIES the production DACL on decrypted plaintext rather than assuming it -- if the deploy
path ever stops protecting, the windows leg goes red with this test's name on it.

Expected Windows movement: TestExecute_SopsChains leaves the known-failure set -- the baseline goes 4 to 3,
and the write-path cluster is closed.

Verified with make check (103 packages ok, 0 failures) and make vet under GOOS windows.

Closes #433. Refs #405, #430.
@David-Noble-at-work David-Noble-at-work self-assigned this Aug 20, 2026
@David-Noble-at-work
David-Noble-at-work merged commit 84b416f into develop Aug 20, 2026
7 of 8 checks passed
@David-Noble-at-work
David-Noble-at-work deleted the sops-asserts-the-portable-fact branch August 20, 2026 19:34
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.

writ deploy/sops: route the decrypted-plaintext write through a root

1 participant