feat(aws): draw the database password with a generator - #9
Open
JeroenSoeters wants to merge 3 commits into
Open
Conversation
The database master password was minted at evaluation time with random.password and pinned with setOnce. That shape cannot rotate, and eval-time randomness carries a footgun: the random.password read URI is cached per PKL evaluation, so two secrets with identical parameters silently share one value. A generator draws per generator and per binding, so the hazard disappears instead of being designed around. The secret now binds a PasswordGenerator with no rotation block: a one-time draw, like-for-like with the setOnce behavior it replaces, and the same 24-character alphanumeric shape. The generator only exists when --database=new, exactly like the secret it feeds. Generators need the formae 0.89.0 schema and a 0.89.0 agent, so the formae schema pin and the bundled agent image move up together; the aws schema pin moves to 0.1.17, which accepts a generator output where the 0.1.13 secretString type did not.
JeroenSoeters
force-pushed
the
feat/generator-db-password
branch
from
September 6, 2026 06:11
e2abb50 to
ca8b490
Compare
…ssword A setOnce field keeps the value it was created with, so formae refuses to route a generator through it: re-applying this version over an installation bootstrapped on the eval-time password is rejected at plan time. Document the two-apply migration (drop setOnce, then adopt the generator) and the agent restart it ends with, since the deployed agent receives FORMAE_DB_PASSWORD at task start and keeps the old value until its task is replaced.
The shipped version removes the random module import, so the documented transitional shape must restore it or the step-1 apply fails at evaluation. The transitional file was verified to evaluate.
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.
Summary
Converts the AWS bootstrap example's database master password from eval-time
random.password(...).opaque.setOnceto a formaePasswordGeneratorwith no rotation block: a one-time agent-side draw, like-for-like with the setOnce behavior it replaces. Besides being the 0.89.0 feature showcase, this removes the eval-time-randomness footgun (therandom.passwordread URI is cached per evaluation, so identically-parameterized secrets silently share one value; a generator draws per generator).The generator is gated on
--database=newexactly like the secret it feeds;alb,tailnet, and--database byomodes all evaluate cleanly (byo emits no generator). Version pins move together: formae schema 0.88.0 to 0.89.0, agent imageformae:0.87.0toformae:0.89.0, aws schema 0.1.13 to 0.1.17 (whosesecretStringaccepts a generator output; this also retires the stale schema-pin TODO).DO NOT MERGE until formae 0.89.0 stable ships
ghcr.io/platform-engineering-labs/formae:0.89.0does not exist yet; this is customer-facing example code and must not pin a dev tag. Merge with (or right after) the 0.89.0 release.