Skip to content

M2: Unify graph edge and schema vocabulary used by analytics, auto-wiring, and tests #77

Backlog

Description

@h45sh

Context

Hard-coded graph vocabulary has drifted from the canonical schemas, and the tests use the wrong vocabulary, so CI does not catch it:

  1. GraphAnalyticsEngine.evaluate_deception groups services by edges with relation_type == "hosts" (src/ether/graph/analytics.py:361). Real edges are has_service from NetworkService.create (src/ether/schemas/network.py:73) and hosts_service from auto-wiring (src/ether/graph/store.py:907). The edge path never fires in production; only the host_ip fallback works. tests/unit/test_belief_engine.py:21,53,82 and tests/unit/test_graph_analytics.py:34 use "hosts", which is why it stays green.
  2. The auto-wiring branch checks schema_type in ("vulnerability", "cve") (src/ether/graph/store.py:922). Real types are vulnerability.found and web.vulnerability; the branch is dead. tests/unit/test_storage_edges_and_deception.py:62-70 only exercises it by fabricating schema_type="vulnerability", a type nothing emits.
  3. identify_critical_assets flags schema == "host_internal" (src/ether/graph/analytics.py:180). No schema or adapter emits that type, so the "internal corporate hosts" crown-jewel case can never trigger.

Acceptance criteria

  • Define shared constants/enums for relation types and schema types; use them in the store, auto-wiring and analytics.
  • Either wire vulnerability.found / web.vulnerability into auto-wiring or delete the dead branch.
  • Replace "hosts" test fixtures with edges the store actually writes and assert production-shaped rows.
  • Add a test where a service with no explicit parent is grouped to its host through the edge path and triggers port-sprawl detection.
  • Resolve or remove the host_internal crown-jewel branch.

Out of scope

Renaming relation types already persisted in existing databases (migration is separate).

Part of #25

Activity

  1. added this to the M2 Scale milestone on Nov 30, 2026
  2. added
    type:bug
    area:graph
    priority:P2
    on Nov 30, 2026
  3. h45sh commented on Dec 1, 2026

    @h45sh
    OwnerAuthor

    Observed auto-wiring gap:

    • http_probe wires network.service -[hosts_endpoint]-> web.endpoint, whereas ffuf-discovered web.endpoint nodes are persisted as orphaned nodes without hosts_endpoint edges from their parent network.service.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:graphpriority:P2type:bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions