fix(enroll): thirteenth audit — age-keygen silent fail, compose fail-fast, docker-compose die, harmonia cat, minisign size check#185
Merged
Conversation
…fast, docker-compose die, harmonia cat, minisign size check
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
age-keygen 2>/dev/null > "${AGE_KEY}.tmp": stderr suppressed with no|| die. A failure firesset -ewith zero output — the error is hidden by2>/dev/nulland our script prints nothing. Added|| diewith a clear message; kept2>/dev/nullto suppress the redundant "Public key: age1..." line age-keygen always prints on success (we re-print it ourselves viainfo).COMPOSE_ENV_EXAMPLEexistence check was after bothgen_passwordcalls. If the template is missing the script dies correctly, but two passwords were already generated and discarded. Reordered: check template first, then generate passwords (fail fast before spending entropy).docker-compose up -dhad no|| die. Docker-compose prints its own errors but left nodocker-compose logsremediation hint. Added|| diepointing at the logs command.HARMONIA_PUBKEY=$(cat "${HARMONIA_PUB}")had no|| die. File was just created so failure is extremely unlikely, but inconsistent with every other critical-pathcatnow guarded. Added|| die.minisign -Ghad no post-generation[[ -s ]]check. The downstreamSIGNING_PUBKEYguard catches an empty pubfile but with a generic "malformed" message. The new check fires immediately after keygen with "check disk space on SOURCEOS_DIR".Test plan
bash -n scripts/enroll.sh— syntax cleanage-keygenfailure (e.g.chmod 000 /dev/urandom) →|| diefires with readable message, not silent exitCOMPOSE_ENV_EXAMPLEbefore step 4 → die fires before anygen_passwordcalldocker-compose upto fail → die fires withlogscommand in messageHARMONIA_PUBpermissions →cat || diefires with remediation/etc/sourceosdisk → minisign[[ -s ]]check fires with "check disk space"