Repository navigation
feat(launcher): reuse the asset inventory in the scope wizard - #1193
Merged
Merged
Conversation
added 2 commits
November 13, 2026 16:43
Wire internal/inventory into engagement scope entry (create + draft-edit). The
picker opens the stack-postgres inventory best-effort (nil when the stack isn't
up yet — common on a first run) and threads it into collectScope, which:
- Lookup(zone): reuses remembered assets from prior engagements,
- DiscoverScope: still runs the live passive query,
- Record(zone, finds): remembers this run's results for next time,
- mergeRecommendations: unions remembered ∪ live (deduped, remembered first)
as the suggestion list.
start.go builds the DSN from POSTGRES_PORT/PASSWORD and passes it to Select.
Every inventory call is nil-safe, so a missing inventory degrades to live-only.
Verified on sec-dev: go build / vet / test (engagement + cmd + inventory) green;
mergeRecommendations unit-tested; inventory storage live-verified in #1192.
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.
What
Wires the postgres asset inventory (#1192) into the engagement scope wizard so the launcher reuses prior passive-discovery lookups across engagements instead of re-querying every time — the CTEM behavior you asked for.
How
The picker opens the stack-postgres inventory best-effort (nil when the stack isn't up — common on a first run, since scope entry precedes
compose up) and threads it throughSelect → promptNewEngagement / promptEditDraftScope → collectScope. IncollectScope, for the seed zone:Lookup(zone)— reuse remembered assets from prior engagements (an info line tells the operator how many).DiscoverScope— still run the live passive query.Record(zone, finds)— remember this run's results for next time.mergeRecommendations— union(remembered, live), deduped, remembered first, shown in the suggestion multiselect.start.gobuilds the DSN fromPOSTGRES_PORT/POSTGRES_PASSWORD. Every inventory call is nil-safe, so a missing inventory degrades cleanly to live-only discovery.Verified
go build/go vet/go test(engagement + cmd + inventory) green on sec-dev.mergeRecommendationsunit-tested (order + dedupe); the inventory storage layer was live-verified against real postgres in #1192.Follow-up