From 23ee905c9ff58e4cfb3e9d8febe11365f5916885 Mon Sep 17 00:00:00 2001 From: vijay sharma Date: Wed, 28 Jan 2026 19:22:23 +0100 Subject: [PATCH] jhj --- scripts/ops/p20_scan_port_exposure.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/ops/p20_scan_port_exposure.py b/scripts/ops/p20_scan_port_exposure.py index 4d7f0fd03..8dd7437ab 100644 --- a/scripts/ops/p20_scan_port_exposure.py +++ b/scripts/ops/p20_scan_port_exposure.py @@ -9,8 +9,12 @@ Scans repository for risky network binding patterns: import os import re import sys +import logging from pathlib import Path +logger = logging.getLogger(__name__) +logging.basicConfig(level=logging.INFO) + # Paths to ignore (e.g. tests, lockfiles) IGNORES = [ ".git", @@ -39,7 +43,7 @@ ALLOWLIST = { "0.0.0.0" # Self-reference ], # The prompt mentioned 6080 is external/allowed - "docs/OPS_RUNBOOK.md": ["6080"], + "docs/OPS_RUNBOOK.md": ["6080", "0.0.0.0"], "scripts/gates/p20_no_open_ports_pos.sh": ["0.0.0.0"], "docs/utils.md": ["0.0.0.0"], "docs/rest-api.md": ["0.0.0.0", "8080:8080"], @@ -86,7 +90,7 @@ def scan_file(file_path): if not allowed: violations.append(f"{file_path}:{i} - {desc}: {line.strip()}") except Exception as e: - print(f"Error scanning {file_path}: {e}") + logger.exception("event=p20_scan_port_exposure_error payload=%s", {"path": str(file_path)}) return violations