fix(sources): require secrets again when a source's address changes #26
No reviewers
Labels
No labels
bug
docs
duplicate
enhancement
help wanted
invalid
nice-to-have
pre-1.0
question
security
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jfro/lamplighter!26
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/11-secret-retarget"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #11 (gap audit F2).
Sources.persist_attrs/2andtest_connection/2kept a blank secret as "keep stored" even when the source's URL changed, so Test connection or Save sent the stored credential to the newly entered host. Any logged-in account could read out every stored API key that way.What changes
:urlfield, or one keyed:urlor:host(Docker'sunix:///https://address and QNAP's host are:string).Fielddocs describe the rule.Tests: 3 new in
sources_test.exs("changing a source's address"): Test connection and Save to a new address with a blank secret are refused, the DB keeps the old endpoint, and the new secret replaces the old one; an unchanged address still keeps it. The first two fail on main.mix precommit: 627 pass.Screenshot: Proxmox Backup source, URL changed and Test connection pressed, desktop and 390px:


Review (Nye) at
022a94b: ready.change_source.retarget_all_types_test.exscovers all 10 source types with an address + secret (19 pairs): changing the URL/host requires each secret again; whitespace-only changes don't.secret_retarget_test.exs(F2 audit test, updated for the fix): Test connection is refused and sends nothing, Save is refused, the stored key survives, a new key replaces it.mix precommitpasses, 630 tests.Non-blocking: changing only TLS trust (fingerprint/CA) keeps the stored secrets; exploiting that also needs network position, so a follow-up at most.