saas-dr: phase 3 detection packs scaffolding#158
Conversation
Introduces a versioned detection-pack model that groups built-in rules into curated bundles per provider, so operators can reason about Aperio's SaaS detection coverage in coherent chunks instead of a flat toggle list. - New DetectionPack type and registry in internal/ingestionworker with 6 initial packs across GitHub, Slack, Okta, and Google Workspace (identity, mail, drive). - RuleCatalogEntry extended with PackID, MitreTechniques, Intent, and Tags. All 16 existing rules backfilled with MITRE ATT&CK mappings, attacker-intent statements, and canonical cross-provider tags. - New ListDetectionPacks Connect RPC with provider filter, Go handler in internal/bootstrap, TypeScript client wrapper, and fetchDetectionPacks on apps/web/lib/api.ts. - Tests pin pack-registry shape (semver, unique ids, known providers), catalog-to-pack linkage, MITRE id shape, canonical-tag membership, rules-in-pack ordering, and proto hydration. New evaluators (github.branch_protection_disabled, slack.external_user_added_to_private_channel, google_workspace.mass_drive_download) are tracked separately in #157 and will ship with their TS-parity fixtures. Phase 2 nice-to-haves moved to follow-ups: #151 (link/unlink findings), #152 (UpdateSaasIncident), #153 (note timeline events), #154 (CancelSaasResponseAction), #155 (SLA breach reactor), #156 (dashboard incidents widget). Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
|
Droid finished @dcoln25-writer's task —— View job Solid scaffolding for the Phase 3 detection-pack model: the registry shape, MITRE backfill, proto/Connect wiring, and test coverage are all well-structured. Three minor issues to address: a dead-code nil-guard in the Connect handler that misrepresents the framework contract, a documentation-contract mismatch in |
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
|
Droid encountered an error —— View job Droid is reviewing code and running a security check… |
Pack descriptions are analyst-facing capability statements per the DetectionPack doc comment, so they cannot claim coverage that does not yet ship. Trim three packs to match only the rules backing them in this PR; the deferred detections in #157 will reintroduce the broader coverage language when they land. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
|
Droid finished @dcoln25-writer's task —— View job The detection-pack scaffolding is well-structured: registry shape, MITRE backfill, proto/Connect wiring, and test coverage are all solid, and the latest commit correctly trimmed the drive, slack, and github pack descriptions that the prior review flagged. One description oversight remains: the |
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
|
Droid finished @dcoln25-writer's task —— View job The detection-pack scaffolding is well-structured overall: the registry shape, proto wiring, Connect handler, and TypeScript client are all correct, and all three previously flagged issues (nil guard, RulesInPack doc comment, and pack description over-claims) have been addressed. Two issues remain: a MITRE technique misassignment (T1556.003 -- Linux PAM -- used for a Google Workspace recovery-email rule) and four catalog |
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
|
Droid finished @dcoln25-writer's task —— View job All issues from prior review rounds have been resolved: the nil guard dead code, |
There was a problem hiding this comment.
Reviewed the detection-packs scaffolding. The implementation is well-structured and all new fields (PackID, MitreTechniques, Intent, Tags) are consistently populated. One blocking issue: detection_packs_test.go has two extra trailing blank lines that fail the gofmt CI check. Everything else — the proto definition, the Go handler, the connect-TS client, and the test coverage — looks correct.
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
|
Droid finished @dcoln25-writer's task —— View job The detection-pack scaffolding is well-structured and all issues from prior review rounds have been addressed. Three concrete evaluator-vs-catalog tag mismatches remain in the mail pack rules ( |
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
|
Droid finished @dcoln25-writer's task —— View job All issues raised in prior review rounds have been resolved at HEAD: the Connect handler nil-guard dead code, the |
|
Droid finished @dcoln25-writer's task —— View job LGTM — no issues found. All items raised in prior review rounds (nil-guard dead code, RulesInPack doc comment, pack description over-claims, T1556.003/T1213 MITRE misassignments, and catalog-vs-evaluator tag mismatches) are resolved at HEAD. The detection-pack scaffolding, proto/Connect wiring, TypeScript client, and test coverage are all correct, and no security vulnerabilities were identified in the new ListDetectionPacks RPC. |
|
Droid finished @dcoln25-writer's task —— View job LGTM — no issues found. The detection-pack scaffolding, proto/Connect wiring, TypeScript client, and test coverage are all correct at HEAD. All issues from prior review rounds (nil-guard dead code, RulesInPack doc comment, pack description over-claims, T1556.003/T1213 MITRE misassignments, and catalog-vs-evaluator tag mismatches) remain resolved, and no new correctness or security vulnerabilities were identified in the new ListDetectionPacks RPC. |
Why
Phase 3 of the SaaS DR pivot is curated, versioned detection packs. Today the worker has 16 built-in rules in a flat catalog. Operators have no way to reason about coverage in bundles ("what does Aperio detect on Google Workspace for mailbox exfiltration?") and no way to pivot from a finding to MITRE ATT&CK context.
What
internal/ingestionworker/detection_packs.gowith 6 initial packs (GitHub core, Slack core, Okta core, Google Workspace identity / mail / drive). Each pack carries a stable id, semver version, provider, and analyst-facing description.PackID,MitreTechniques,Intent,Tags. All 16 existing rules backfilled with MITRE ATT&CK mappings (e.g. T1078.004, T1098.003, T1556.006, T1530, T1114.003), attacker-intent statements, and canonical cross-provider tags fromtags.go.ListDetectionPacksConnect RPC with an optional provider filter, Go handler ininternal/bootstrap/detection_packs.go, TS client wrapper, andfetchDetectionPacksonapps/web/lib/api.ts.What is NOT in this PR (intentional)
fetchDetectionPacksis the natural next step.Validation
go test ./...greennpm run guardrails:migrationgreen (156 tests)npm run test:apigreen (156 tests)node_modules/.bin/tsc -p tsconfig.json --noEmitgreennpm run proto:checkgreennpm run db:validategreennpx next build apps/webgreenRelated