diff --git a/scripts/contexte.py b/scripts/contexte.py index ca75db3..b83d975 100644 --- a/scripts/contexte.py +++ b/scripts/contexte.py @@ -555,8 +555,12 @@ class Locataire(Ecosysteme): for h, ip in sorted(ips.items())} # Les reseaux d'administration que le locataire DECLARE (l'intrant), et son tunnel. intrant: list[str] = [] + # La fiche du site d'abord (pas 4) : le locataire n'en porte plus de copie. + _src = self.intrants_du_site().get("nftables_admin_ssh") + if _src: + intrant = [str(s) for s in _src] if isinstance(_src, list) else [str(_src)] gv_all = self.dossier_inventaire() / "group_vars" / "all" - for fichier in sorted(gv_all.glob("*.yml")) if gv_all.is_dir() else []: + for fichier in (sorted(gv_all.glob("*.yml")) if gv_all.is_dir() and not intrant else []): if "vault" in fichier.name: continue d = _yaml(fichier) diff --git a/scripts/devis_reseau.py b/scripts/devis_reseau.py index 414dc9d..0eff380 100644 --- a/scripts/devis_reseau.py +++ b/scripts/devis_reseau.py @@ -471,6 +471,14 @@ def admin_de(nom_instance: str) -> list[str]: inv = inventaire_de(nom_instance) if not inv: return [] + # LA FICHE DU SITE D'ABORD (2026-10-25, pas 4) : le locataire n'en porte plus de copie. + try: + import contexte + src = contexte.Locataire(Path(inv).resolve().parents[2]).intrants_du_site().get("nftables_admin_ssh") + if src: + return [str(s) for s in src] if isinstance(src, list) else [str(src)] + except Exception: + pass for fichier in sorted((inv.parent / "group_vars" / "all").glob("*.yml")): if "vault" in fichier.name: continue diff --git a/scripts/inventory_gui.py b/scripts/inventory_gui.py index 1619cf9..d917dc2 100644 --- a/scripts/inventory_gui.py +++ b/scripts/inventory_gui.py @@ -284,7 +284,8 @@ INTRANTS_SCHEMA = [ ("fuseau_horaire", "identite", "defaut", "Identité", "Fuseau horaire", "str", "tenant"), ("organisation", "identite", "defaut", "Identité", "Organisation (annuaire LDAP, certificats)", "str", "tenant"), ("identite_realm", "identite", "defaut", "Identité", "Realm SSO (Keycloak)", "str", "tenant"), - ("nftables_admin_ssh", "identite", "catalogue", "Sécurité", "Sources SSH d'administration toujours autorisées (garde anti-lockout du pare-feu)", "liste", "tenant"), + # `nftables_admin_ssh` N'EST PLUS ICI (2026-10-25) : c'est le site qui le donne, par sa fiche + # (conception-contextes.md §2.5, pas 4). Le panneau l'aurait recree, vide, chez le locataire. ("proxmox_api_host", "proxmox_hebergeur", "constante", "Cluster", "Hôte API Proxmox", "str", "hebergeur"), ("proxmox_api_user", "proxmox_hebergeur", "constante", "Cluster", "Utilisateur API", "str", "hebergeur"), ("proxmox_api_port", "proxmox_hebergeur", "constante", "Cluster", "Port API", "str", "hebergeur"), diff --git a/scripts/resoudre_flux.py b/scripts/resoudre_flux.py index e137a82..7575e18 100644 --- a/scripts/resoudre_flux.py +++ b/scripts/resoudre_flux.py @@ -331,7 +331,19 @@ def _sources_admin_ssh() -> list[str]: Garde anti-lockout : le contexte d'ou l'on administre (controleur/VPN) doit rester joignable en SSH quelle que soit la resolution des flux. + + LA FICHE DU SITE D'ABORD (2026-10-25, pas 4) : ces sources sont celles que le site donne ; le + locataire n'en porte plus de copie. Les `group_vars` restent le repli d'un ecosysteme sans fiche. """ + try: + import contexte + fiche = contexte.Locataire(_inventaire().resolve().parents[2]).intrants_du_site() + src = fiche.get("nftables_admin_ssh") + if src: + recus = [str(s) for s in src] if isinstance(src, list) else [str(src)] + return sorted(set(recus) | set(_tunnel_admin_locataire())) + except Exception: + pass dossier = _inventaire().parent / "group_vars" / "all" for fichier in sorted(dossier.glob("*.yml")): if "vault" in fichier.name: diff --git a/scripts/site_intrants.py b/scripts/site_intrants.py index dee60a9..43da53a 100644 --- a/scripts/site_intrants.py +++ b/scripts/site_intrants.py @@ -281,7 +281,10 @@ DONNEES_DU_CONTRAT = ("domaine_site", "index_site", "forge_amont_ac", "serveur_o POSES_PAR_LA_FICHE = ("client_backup_cible", # Le DNS public et l'adresse publique (2026-10-25) : "dns_public_site", "dns_public_pairs", "dns_public_nom", "dns_public_noms_pairs", - "ip_publique_site", "ip_publique") + "ip_publique_site", "ip_publique", + # Les reseaux d'administration (2026-10-25) — `passerelle_sortie` non : aucun + # locataire ne la declare, aucun role ne la lit. + "nftables_admin_ssh") def _hote_de(valeur: str) -> str: