Group sessions by user and target over a time window
Problem
Automation through the bastion produces a lot of short sessions. An Ansible run opens at least one session per host, and a day of runs fills the sessions page with near-identical rows for the same user and targets. To answer "what was run on host X today", you open them one by one.
Most of what is needed is already recorded: every exec is logged as
Exec command and interactive shells as Shell command (#2235), with the
session and the username attached. What is missing is a way to look at them
together.
Proposal
- Group by on the sessions page: collapse target sessions by user and target, merging those less than N minutes apart (one burst is typically one Ansible run). A group row shows the count and the time span, and expands to the individual sessions.
- The group's commands in the log view rather than a new page: let
/logsaccept several session IDs, or a target, so a group can link toExec command/Shell commandentries in time order, each linking to its recording.
No new data or migration: user sessions, target sessions and log entries already carry what is needed. A single merged replay of several recordings is out of scope.
This builds on the filters in #2528 (and #2074, #2418, #457) rather than replacing them.
Would you accept a PR along these lines, and in which shape? I'd be happy to implement it.
Source: warp-tech/warpgate