INNER CODE UNIT · Python

reset_server

Nebulock-Inc/agentic-threat-hunting-framework · athf/mcp/server.py:114

def reset_server() -> None:
    """Reset global server state (for testing)."""
    global _workspace
    _workspace = None


DEFAULT_HOST = "127.0.0.1"

# Only these reach nothing beyond this machine. Everything else — a wildcard
# bind, a LAN address, a public address — is treated as exposed. The MCP server
# has no authentication and its tools read the full hunt corpus and can invoke
# LLM agents, so anything outside this set needs an explicit opt-in.
LOOPBACK_HOSTS = frozenset({"127.0.0.1", "localhost", "::1", "[::1]"})


def is_exposed_host(host: str) -> bool:
    """Return True if `host` accepts connections from beyond this machine."""
    return host.strip().lower() not in LOOPBACK_HOSTS

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…