Repository navigation
init: the database's password arrives only as a SCRAM-SHA-256 verifier - #18
Merged
Merged
Conversation
The Beyond node derives the verifier from the sealed password; init keeps only a value that is one (a plaintext is ignored, so none is ever held or written). initdb takes the verifier as given and ALTER ROLE sets it every start; clients log in with the original over SCRAM. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WpMBitUrzhuG9iHe6RetTc
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.
The Beyond node now hands this VM a SCRAM-SHA-256 verifier of the superuser password, never the value (beyondoss/beyond, primitive-runtime delivery). init keeps only a value starting with SCRAM-SHA-256$ (env_relay::offer); a plaintext is ignored and init exits after WAIT (fail closed), so no plaintext is held or written to the metadata file.
initdb decision: the pwfile carries the verifier as is, no change to boot.rs. Checked on real postgres:18: initdb --pwfile= stores it verbatim and a login with the original password over SCRAM succeeds; ALTER ROLE postgres WITH PASSWORD $beyond$$beyond$ (every start) also works.
Tests: env_relay unit tests (plaintext never kept) pass. tests/supervisor.rs adds a Docker test (login with the original over SCRAM, wrong fails, stored rolpassword == verifier, no original in /run/mmds or env). It could not run on the homelab: the harness's gosu fails with 'operation not permitted' there, and supervisor_lifecycle_primary fails identically on main.
Merge after the Beyond node change is published: an old driver sending plaintext would hold init until it exits.
🤖 Generated with Claude Code
https://claude.ai/code/session_01WpMBitUrzhuG9iHe6RetTc