CT 114: Audit prüft onion-only per JSON-Parse statt Regex
ci-static / secret-scan (push) Successful in 22s
ci-static / yamllint (push) Successful in 31s
ci-static / ansible-syntax (push) Successful in 30s
ci-static / markdown-links (push) Successful in 22s

getnetworkinfo listet ipv4/ipv6 als Eintraege mit reachable=false — die
alte Regex-Assertion war falsch. Jetzt JSON-Parse: onion reachable=true,
ipv4/ipv6 nicht reachable (live gegen CT 114 bestätigt).

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
2026-11-27 07:11:25 +01:00
parent b0536c5166
commit cac1f6a2dc
@@ -136,21 +136,29 @@
- name: Read the litecoind network state via the read-only wrapper
become: false
ansible.builtin.command:
argv: [/usr/bin/sudo, -n, /usr/local/bin/ltc-readonly, getnetworkinfo]
ansible.builtin.shell: |
/usr/bin/sudo -n /usr/local/bin/ltc-readonly getnetworkinfo | /usr/bin/python3 -c '
import json, sys
data = json.load(sys.stdin)
reach = {n["name"]: n.get("reachable") for n in data["networks"]}
print("network reachability:", reach)
if reach.get("onion") is not True:
sys.exit("onion network is not reachable")
if reach.get("ipv4") is True or reach.get("ipv6") is True:
sys.exit("clearnet network is reachable; expected onion-only")
'
args:
executable: /bin/bash
check_mode: false
changed_when: false
register: litecoin_audit_networkinfo
when: not ansible_check_mode
when:
- not ansible_check_mode
- litecoin_service_start_allowed | bool
- name: Require onion-only networking when the node is running
ansible.builtin.assert:
that:
- >-
'"onion"' in litecoin_audit_networkinfo.stdout
- >-
litecoin_audit_networkinfo.stdout is not
search('"name": "(ipv4|ipv6)"')
- name: Report the onion-only network state
ansible.builtin.debug:
msg: "{{ litecoin_audit_networkinfo.stdout | default('check mode or node stopped: skipped') }}"
when:
- not ansible_check_mode
- litecoin_service_start_allowed | bool