03 §12a: trust in Proxmox by the root CA copy is built, not released (R-1380); R-1396 filed; red-proofs

This commit is contained in:
admin committed 2026-11-14 16:38:44 +01:00
1 parent fe8247665d
commit d809a1d444
5 files changed
+194 -14

No files matched your search

@@ -0,0 +1,72 @@
== MUTATION: the config is written BEFORE the proof
RED on the mutant, GREEN on the real file
--- FAIL: TestOldBox_MovesAndTheFingerprintIsClearedOnlyAfterTheProof (0.01s)
pvetrust_test.go:254: order = [copy probe(fp="",ca=true) while the file says fp="" apply(fp="",ca=true)]
--- FAIL: TestProofFails_TheFingerprintStays (0.00s)
pvetrust_test.go:292: the config was written although the proof failed
== MUTATION: the proof's answer is ignored
RED on the mutant, GREEN on the real file
--- FAIL: TestProofFails_TheFingerprintStays (0.00s)
pvetrust_test.go:288: the trust changed although the proof failed
== MUTATION: the write keeps the fingerprint
RED on the mutant, GREEN on the real file
--- FAIL: TestOldBox_MovesAndTheFingerprintIsClearedOnlyAfterTheProof (0.00s)
pvetrust_test.go:250: the box did not move: &{Mode:fingerprint Problem:config_not_written Detail:the config did not read back as written (<nil>) — the old config was put back CANotAfter:2036-08-17T15:44:42Z CADaysLeft:0x21c7815067
--- FAIL: TestPinnedBox_NewCertificate_HealsWithNoRestart (0.01s)
pvetrust_test.go:319: the box is still blind after the move: proxmox: GET /version: Get "https://127.0.0.1:41039/api2/json/version": proxmox: TLS pin mismatch: server cert sha256 does not match configured fingerprint ([copy probe(
== MUTATION: a failed call on trust starts nothing
RED on the mutant, GREEN on the real file
--- FAIL: TestPinnedBox_NewCertificate_HealsWithNoRestart (0.01s)
pvetrust_test.go:319: the box is still blind after the move: proxmox: GET /version: Get "https://127.0.0.1:33489/api2/json/version": proxmox: TLS pin mismatch: server cert sha256 does not match configured fingerprint ([])
== MUTATION: a refreshed copy is not reloaded by the running client
RED on the mutant, GREEN on the real file
--- FAIL: TestCARenewedWithTheSameKey_TheCopyIsRefreshedAndReloaded (0.00s)
pvetrust_test.go:350: a refreshed copy must be proven and reloaded: [copy probe(fp="",ca=true) while the file says fp=""]
== MUTATION: an operator's own CA file is replaced
RED on the mutant, GREEN on the real file
--- FAIL: TestNeverMoved (0.01s)
pvetrust_test.go:412: own CA file: moved ([copy probe(fp="",ca=true) while the file says fp="" apply(fp="",ca=true)])
== MUTATION: a box with checks switched off is moved
RED on the mutant, GREEN on the real file
--- FAIL: TestNeverMoved (0.01s)
pvetrust_test.go:412: insecure: moved ([copy probe(fp="",ca=true) while the file says fp="" apply(fp="",ca=true)])
== MUTATION: a config that is not a file is 'moved' in memory
*** NOT A RED-PROOF *** (mutant rc=0 built=True real rc=0)
== MUTATION: a failed config write still changes the running client
RED on the mutant, GREEN on the real file
--- FAIL: TestConfigCannotBeWritten_TheFingerprintStays (0.01s)
pvetrust_test.go:391: the trust changed without a saved config: [copy probe(fp="",ca=true) while the file says fp="1e4a6394a6837f9a3d32139d497210b4403ed3a3d66804b723f5f99df055d20b" apply(fp="",ca=true)]
== MUTATION: the throttle removed
*** NOT A RED-PROOF *** (mutant rc=1 built=False real rc=0)
FAIL gitea.dooplex.hu/admin/felhom-agent/internal/pvetrust [build failed]
internal/pvetrust/pvetrust.go:155:2: declared and not used: tooSoon
== MUTATION: 'ends soon' never said
RED on the mutant, GREEN on the real file
--- FAIL: TestCopyEndsSoon (0.00s)
pvetrust_test.go:438: status = &{Mode:ca Problem: Detail: CANotAfter:2026-11-26T00:00:00Z CADaysLeft:0x2200200ea7b8 MovedAt: CheckedAt:2026-11-14T15:32:23Z}
11 mutations, 2 not a red-proof
-- NOTE: the mutation „a config that is not a file is moved in memory” is NOT a red-proof and is not a rule: without that branch the write itself fails (there is no file) and the outcome is the same problem, the same unchanged client. The branch only gives a clearer log line.
== MUTATION: the throttle removed (done again: the first try did not compile)
RED on the mutant, GREEN on the real file
--- FAIL: TestOnCallError_Throttled (0.01s)
pvetrust_test.go:457: a second failure inside the gap ran again: [copy probe(fp="",ca=true) while the file says fp="8e4954b82a48cda044d0ac88160dbb028ea5ba173a2afbe1d4fb1e067a3307ca"]
1 mutations, 0 not a red-proof
-- the wiring (cmd/felhom-agent/main.go)
== MUTATION: main.go does not feed a failed collect to the trust manager
RED on the mutant, GREEN on the real file
--- FAIL: TestMainWiresPVETrust (0.01s)
pvetrust_wiring_test.go:59: main.go wires "hook" 0 time(s), want at least 1 (the two-call ones: at start and after a bundle install)
== MUTATION: main.go does not run the trust order at start
RED on the mutant, GREEN on the real file
--- FAIL: TestMainWiresPVETrust (0.01s)
pvetrust_wiring_test.go:59: main.go wires "ensure" 1 time(s), want at least 2 (the two-call ones: at start and after a bundle install)
== MUTATION: main.go does not report the trust stanza
RED on the mutant, GREEN on the real file
--- FAIL: TestMainWiresPVETrust (0.01s)
pvetrust_wiring_test.go:59: main.go wires "stanza" 0 time(s), want at least 1 (the two-call ones: at start and after a bundle install)
3 mutations, 0 not a red-proof
@@ -0,0 +1,22 @@
== MUTATION: the proof is ignored (the copy is used whatever the handshake says)
RED on the mutant: 1 failing line(s)
FAIL test_pve_trust_a_copy_that_does_not_verify_falls_back_to_the_pin -- never neither: no proven copy → the served certificate is pinned. Got ca='/tmp/hostinstall-test-1e6m_k4e/etc-felhom-agent/pve-root-ca.pem' fp=''
== MUTATION: the CA check removed (a leaf is copied)
RED on the mutant: 1 failing line(s)
FAIL test_pve_trust_a_source_that_is_not_a_ca_is_never_copied -- leaf.pem: copied although it is not a CA certificate
== MUTATION: the fallback pin dropped (neither way)
RED on the mutant: 2 failing line(s)
FAIL test_pve_trust_a_copy_that_does_not_verify_falls_back_to_the_pin -- never neither: no proven copy → the served certificate is pinned. Got ca='' fp=''
FAIL test_pve_trust_a_source_that_is_not_a_ca_is_never_copied -- leaf.pem: the fallback pin is missing: ''
== MUTATION: a proven copy still pins the certificate too (the fingerprint would win over the CA)
RED on the mutant: 1 failing line(s)
FAIL test_pve_trust_a_new_box_gets_the_ca_copy_and_no_fingerprint -- the box's own CA verified the handshake, so: ca_file set, NO fingerprint. Got ca='/tmp/hostinstall-test-z1ib0ej6/etc-felhom-agent/pve-root-ca.pem' fp='99:36:74:0
== MUTATION: the dry run writes the copy
RED on the mutant: 1 failing line(s)
FAIL test_pve_trust_dry_run_writes_nothing -- [DRY-RUN] copy /tmp/hostinstall-test-nee1qiqg/pki/ca.pem -> /tmp/hostinstall-test-nee1qiqg/etc-felhom-agent/pve-root-ca.pem (0644) and prove a TLS handshake to 127.0.0.1:51319 with the
== MUTATION: step_agent_config does not call it
RED on the mutant: 1 failing line(s)
FAIL test_pve_trust_is_wired_into_the_agent_config -- step_agent_config no longer calls resolve_pve_trust
the real file: 0 failing line(s)
6 mutations, 0 not a red-proof
@@ -0,0 +1,38 @@
== MUTATION: the CA check removed (a leaf is copied)
if not re.search(r"\bCA:TRUE\b", out): -> if False:
tests: 2 mutant: Ran 2 tests in 0.211s | FAILED (failures=1, errors=1) real: Ran 2 tests in 0.251s | OK
RED on the mutant, GREEN on the real file
TypeError: 'NoneType' object is not subscriptable
AssertionError: 'written' != 'T3'
== MUTATION: the plan may name things (T1 removed)
if extra: -> if False:
tests: 1 mutant: Ran 1 test in 0.008s | FAILED (errors=1) real: Ran 1 test in 0.002s | OK
RED on the mutant, GREEN on the real file
TypeError: 'NoneType' object is not subscriptable
== MUTATION: the one-certificate check removed
if len(certs) != 1 or b"PRIVATE KEY" in data: -> if False:
tests: 1 mutant: Ran 1 test in 0.009s | FAILED (errors=1) real: Ran 1 test in 0.004s | OK
RED on the mutant, GREEN on the real file
TypeError: 'NoneType' object is not subscriptable
== MUTATION: the end-date check removed
if days < 0: -> if False:
tests: 1 mutant: Ran 1 test in 0.009s | FAILED (errors=1) real: Ran 1 test in 0.004s | OK
RED on the mutant, GREEN on the real file
TypeError: 'NoneType' object is not subscriptable
== MUTATION: 'same' removed (the copy is rewritten every time)
if have == data: -> if False:
tests: 1 mutant: Ran 1 test in 0.009s | FAILED (failures=1) real: Ran 1 test in 0.007s | OK
RED on the mutant, GREEN on the real file
AssertionError: Tuples differ: (0, 'written', [('/etc/felhom-agent/pve-root-c[108 chars]20)]) != (0, 'same', [])
== MUTATION: the copy goes to another place
PVE_CA_COPY = "/etc/felhom-agent/pve-root-ca.pem" -> PVE_CA_COPY = "/etc/felhom-agent/other.pem"
tests: 1 mutant: Ran 1 test in 0.008s | FAILED (failures=1) real: Ran 1 test in 0.007s | OK
RED on the mutant, GREEN on the real file
AssertionError: Tuples differ: ('written', '/etc/felhom-agent/other.pem', False) != ('written', '/etc/felhom-agent/pve-root-ca.pem', False)
== MUTATION: an appliance check added (a BYO host gets no copy)
return self.pve_ca_copy() -> self.check_appliance()
tests: 1 mutant: Ran 1 test in 0.002s | FAILED (errors=1) real: Ran 1 test in 0.007s | OK
RED on the mutant, GREEN on the real file
KeyError: 'pve_ca_copy'
7 mutations, 0 not a red-proof