TP16.1 Nachlauf: Mgmt-ACL via GC auf alle 4 Geraete (72/72), CF-Schalter entschieden
Neue Compliance-Feature ip-service (17->18 Regeln, 68->72 Checks). Sollzustand einheitlich im Template: ssh/www/winbox/api = 10.40.0.0/16,100.96.0.0/12; ftp/telnet/api-ssl disabled. Deploy gestaffelt (ap2 zuerst, am Geraet gegengeprueft), Job liegt als 'mgmt-acl' in gc-configplan.py. Befund war invertiert: branch/ap1/ap2 hatten GAR KEINE Address-Beschraenkung und waren laengst per Mesh erreichbar; winbox war auf allen vier offen. Aus dem Erreichbarkeits-Fix wurde eine Haertung. ftp/telnet/api-ssl dabei abgeschaltet. CF-Schalter 'Allow all Cloudflare One traffic to reach enrolled devices': recherchiert, bleibt AUS - er oeffnet die Client<->Client-Richtung, unsere laeuft ohne ihn. Kein API-Feld, CF-Docs widersprechen sich (Profil- vs. globale Einstellung). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -281,7 +281,56 @@ def job_drift_cleanup():
|
||||
]
|
||||
|
||||
|
||||
JOBS = {"drift-cleanup": job_drift_cleanup}
|
||||
def job_mgmt_acl():
|
||||
"""TP16.1 (2026-08-17): Mgmt-Dienste + Address-ACL auf allen vier Geraeten.
|
||||
|
||||
WARUM: seit dem Cloudflare-Mesh kommt der Remote-Zugriff aus 100.96.0.0/12. Eine ACL,
|
||||
die nur 10.40.0.0/16 kennt, laesst Ping durch und sperrt SSH/REST/MikroMCP aus -- genau
|
||||
das ist auf dem Core passiert. Umgekehrt fuhren branch/ap1/ap2 ssh/www/winbox/api/ftp/
|
||||
telnet komplett OHNE Address-Beschraenkung; winbox war auf allen vier offen.
|
||||
|
||||
KEIN LOCKOUT-RISIKO: der Deploy laeuft von Nautobot (10.40.20.30) aus, also aus
|
||||
10.40.0.0/16 -- die Adresse bleibt in jeder gesetzten ACL enthalten. RouterOS wendet
|
||||
`address=` ohnehin erst auf NEUE Verbindungen an, die laufende Session ueberlebt.
|
||||
|
||||
SCHREIBWEISE: `/ip service set ssh ...` mit dem Dienstnamen, NICHT `[find name=ssh]` --
|
||||
letzteres trifft auch den dynamischen Verbindungs-Eintrag (`D c ssh ... local <ip>`)
|
||||
und quittiert mit `failure: this is configured elsewhere` (TP16.1-Befund).
|
||||
"""
|
||||
acl = "10.40.0.0/16,100.96.0.0/12"
|
||||
|
||||
def line(svc, attr):
|
||||
return (
|
||||
f":do {{ /ip service set {svc} {attr} }} "
|
||||
f'on-error={{ :log info "mgmt-acl: {svc} hat geworfen" }}'
|
||||
)
|
||||
|
||||
# Erst die Abschaltungen (Angriffsflaeche runter), dann die ACLs.
|
||||
full_set = "\n".join(
|
||||
[line(s, "disabled=yes") for s in ("ftp", "telnet", "api-ssl")]
|
||||
+ [line(s, f"address={acl}") for s in ("ssh", "www", "winbox", "api")]
|
||||
+ [
|
||||
':log info ("mgmt-acl: ssh=" . [/ip service get [find name=ssh and !dynamic] address]'
|
||||
' . " winbox=" . [/ip service get [find name=winbox and !dynamic] address]'
|
||||
' . " telnet-disabled=" . [:tostr [/ip service get [find name=telnet and !dynamic] disabled]])'
|
||||
]
|
||||
)
|
||||
# Der Core hat ftp/telnet/api-ssl bereits aus und ssh/www bereits korrekt --
|
||||
# ihm fehlen nur winbox (war offen) und die Mesh-Range auf api.
|
||||
core_set = "\n".join(
|
||||
[line(s, f"address={acl}") for s in ("winbox", "api")]
|
||||
+ [
|
||||
':log info ("mgmt-acl: winbox=" . [/ip service get [find name=winbox and !dynamic] address]'
|
||||
' . " api=" . [/ip service get [find name=api and !dynamic] address])'
|
||||
]
|
||||
)
|
||||
return [
|
||||
(["crs326-branch", "ap1", "ap2"], full_set, "TP16.1-mgmt-acl-mesh"),
|
||||
(["crs326-core"], core_set, "TP16.1-mgmt-acl-mesh-core"),
|
||||
]
|
||||
|
||||
|
||||
JOBS = {"drift-cleanup": job_drift_cleanup, "mgmt-acl": job_mgmt_acl}
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------ main
|
||||
|
||||
Reference in New Issue
Block a user