Repository navigation
feat: snapshots de política assinados e last-known-good - #9
Merged
Merged
Conversation
O TOML/env que arrancava era a única fonte; se o ficheiro sumisse ou viesse partido no reload, o processo ficava sem política ou caía. 1. O boot compila o TOML/env para um JSON imutável com policy_version (sha256). Esse snapshot fica em memória; reload nunca o substitui por config vazia. 2. ferroada reload (SIGHUP / sentinela) tenta o ficheiro novo. Parse ou assinatura inválidos logam, emitem policy_reload_rejected e seguem com a last-known-good. Ficheiro sumiu → a mesma recusa. 3. FERROADA_POLICY_PUBKEY é opt-in Ed25519. Sem a chave o TOML solto arranca. Com ela, assinatura errada ou ausente recusa o load. ferroada policy compile/sign produzem o blob e a assinatura. 4. Dashboard e Prometheus passam a expor policy_version. O spool acompanha o snapshot no reload; se o SPOOL_DIR faltar, o reload é recusado e a política antiga fica. Prova: cargo test --lib policy (12 ok); cargo test --test policy (4 ok); cargo test --lib (320 ok); cargo clippy -p ferroada --all-targets -- -D warnings (limpo).
No Linux o clippy -D warnings falhava: DEFAULT_SENTINEL e sentinel_path só servem o caminho SIGHUP-não-existe. Unix continua no hangup; o teste do ficheiro sentinela fica cfg(windows).
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.
Snapshots de política assinados (Ed25519 opt-in) e last-known-good: reload com TOML quebrado ou assinatura inválida não derruba a política em memória.
Sem
FERROADA_POLICY_PUBKEYo TOML solto continua válido. Sem control plane, GitOps ou OIDC.