Repository navigation
Show exposure findings in the graph inspector - #48
Merged
Merged
Conversation
The canvas could only add a node's neighbors, one hop and untyped, with no sign when the fixed limit cut the result. An investigator following a suspected chain needs direction, types and caps, and needs to know when the answer is incomplete. Graph::explore walks breadth-first with one parameterized query per step, so caps and cancellation are enforced between queries, and says which cap cut the result. khonsu explore offers it to agents and scripts, and the inspector gets a panel with the hops to the selected node. gpui-graph cannot highlight a set of nodes, so showing a path narrows the canvas to it, and Back returns to earlier views. Refs #32 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A relationship on the canvas said nothing about where it came from. An investigator needs the source, the time and whether it was reported or worked out, and needs missing values stated rather than filled in. Each provenance field is explicitly known or unknown. khonsu evidence and explore --to give stable IDs, and the inspector shows the same record with buttons to copy it as JSON. Exports hold no source configuration, and secret-looking names and values are masked and listed. A sync does not rewrite an unchanged relationship, so its timestamp is named record_written_at, separate from the source's last successful sync. Refs #33 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add evidence records: what supports a node, relationship or path
An open security group rule or a walkable path isn't an actionable finding. An investigator needs to know why a resource was flagged, which fields say so, and what was never checked. khonsu exposure evaluates three documented rules. Each condition is met, not met or unknown and names the fields it read. The verdict follows from those alone: potential_exposure, insufficient_data or not_indicated. There is no score, and no verdict says reachable. The AWS plugin now reads route tables and IPv6 addresses, because a public address and an open rule mean little without a route. A record that should exist and doesn't gives unknown, not a clear result, since a missing saved response reads as empty (#38). A finding carries its path as a derived evidence record with its rule ID, plus the arguments to reopen it in khonsu explore. The new cases live in their own fixture, so the shop fixture's answers and the HawDB snapshot stay as they were. Refs #35, #33, #36 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The rules could only be read as JSON, so someone investigating in the window had to leave it to learn why an instance was flagged. Selecting an instance now offers a check. Each finding shows its verdict, rule, conditions with their AWS fields, candidate path and what wasn't checked. Showing a path narrows the canvas to it as a walk, so Back, Path Explorer and each record's evidence carry on working from there. Refs #35 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 2, 2026
KhonsuGraph is a general graph workbench, but its core held AWS semantics: EC2, security group, load balancer and route table rules, and a general `khonsu exposure` command for them. Every new provider would have added more. Plugins can now offer analyses, an optional part of the protocol. The host reads a bounded part of the graph and sends it with stable references to each record. The plugin answers with findings that point at those records. The host checks every reference, looks up field values itself, and rebuilds each path from the graph, so a plugin can't misquote a record or claim a connection that isn't there. A bad answer is refused whole, since dropping a finding would read as that resource having none. Nothing in the host names a provider's labels, rules or verdicts. The three rules, their field mappings, assumptions and verdict policy are now in plugins/aws/src/exposure.rs, run with `khonsu plugin analyze aws exposure`. Finding IDs, rule IDs, verdicts, order and condition text are unchanged. In the output, `aws_field` is now `source_field`, `instances` is now `subjects`, and a relationship's end reads as the field `@to`. Three false readings found in review are fixed, with regression tests: - Missing balancer group data read as "the target's rules don't allow it", clearing the finding. It's now unknown. - A TCP_UDP target group was treated as TCP only, so a UDP rule didn't count. - The target's security group membership wasn't in the rule's evidence. An example analyzer with nothing to do with AWS shows the interface, and tests how the host handles an answer that misbehaves. Refs #55, #35 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The inspector called the exposure evaluator in core, matched AWS rule constants to find its titles, and only appeared on nodes labelled Instance. It now asks plugins what they offer and shows each analysis on nodes with a label it declares. Titles, verdicts, rules and condition text all come from the plugin, including their Chinese, and a verdict's tone sets how it is shown. The graph is held only while its records are read, so a plugin that takes a while doesn't block the window, and Stop ends one. A plugin not approved as it is now isn't started just to ask what it offers. "Show path on canvas" draws what the host rebuilt from the plugin's references, which also replaces the fields that were skipped in JSON. A test checks that the command and the library the window calls give the same findings, and another that the window's code names no provider's labels or rules. Refs #55, #35 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Shows plugin analyses in the desktop window, so an investigator can see why a resource was flagged without leaving it. The window knows nothing about AWS: it shows whatever a plugin declares (#55).
Merge order: #47, then this. This branch is built on it, so its diff shows that work until it lands. It targets
main. Please merge these with merge commits, not squash or rebase, or each later branch stops containing the one before it (#55).How the window stays generic
Instance, and a test fails if the window's code names a provider's labels or rules.tonesets how it's shown.What changes
Selecting an instance on a graph canvas adds an Exposure section to the inspector, with a Run analysis button. Each finding shows:
There are two actions on each finding:
The check covers the whole graph, not just the canvas. It runs only when asked, and the result is dropped when the canvas gets a new result.
Checked in the real window
I ran the top of this chain (#54) on Windows against
plugins/aws/tests/fixture-exposure, after moving the rules:db-1Potential exposure, and the direct oneNot indicated, with conditions, fields and the claimNot checked in the window:
web-1andlegacy-1, clicking Back, Stop, and Copy finding as JSON. Stop's cancellation has an end-to-end test below the window, and the rest were checked before the move, except the clipboard.khonsu open --cypher ... --runright after launch: it reported delivered, but the query tab didn't change. I didn't look into it. It may be the known problem of a second open being dropped during startup, so I ran the query by hand.Limits
khonsu plugin analyzegives the whole list.rule_idunknown, because it copies the walk. Copy finding as JSON has the rule.Testing
cargo test --locked --workspacepasses on Windows, and CI will cover macOS.Issue status
For #35, the walkthrough still hasn't been timed with a new engineer, so I'm leaving the issue open for that criterion.
Refs #55, #35
🤖 Generated with Claude Code