Skip to content

Refactor the infection map graph to use new endpoints/data structures #2334

@mssalvatore

Description

@mssalvatore

Refactor

Component(s) to be refactored

  • Infection Map

Explanation

New data structures/models have replaced older ones. New endpoints are available to retrieve the data. Use the new endpoints and data models instead of the old ones when building the infection map and preview pane.

The map will rely on GET /api/agents, GET /api/machines, GET /api/nodes, GET /api/agent-events, and GET /api/agent-logs. The frontend components can manipulate this data and combine it in whatever way they need. For example, the map component can query for machines, nodes, and agents and combine the data into a structure like this:

Map Node:
    machine_id: int,
    operating_system: OperatingSystem,
    hostname: str
    network_interfaces: Sequence[IPv4Interface],
    agent_id: Optional[UUID],
    agent_is_running: bool,
    parent_id: Optional[UUID],
    island: bool
    propagated_to: bool
    connections: {machine_id: int, [ConnectionTypes]}

It can then use this structure to populate the map.

Tasks

  • ImplementGET /api/nodes (0d) @ilija-lazoroski
  • Implement GET /api/agents Done in BB: missing logs #2362
  • ImplementGET /api/machines Done in BB: missing logs #2362
  • Remove the map from the security report (0d) @ilija-lazoroski
  • Define the UI's MapNode data structure (0d) @ilija-lazoroski
  • Update ReactiveGraph.js to take the new MapNode structure, transform it, and draw the graph (0d) @cakekoa
  • Update the UI (MapPage) to use new endpoints - @VakarisZ, @cakekoa (0d)
    • Call GET /api/machines and update the UI's Node data structure
    • Call GET /api/agents and update in the UI's Node data structure
    • Call GET /api/nodes and populate the UI's Node data structure
    • Call GET /api/agent-events?type=PropagationEvent&success=true

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions