Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# deepsec

`deepsec` an agent-powered vulnerability scanner that you can run in your own infrastructure, optimized to perform on-demand review of all code in existing
`deepsec` is an agent-powered vulnerability scanner that you can run in your own infrastructure, optimized to perform on-demand review of all code in existing
large-scale repos.

`deepsec` is designed to surface hard-to-find issues that have been lurking in applications for a long time. It is configured to use the best models at maximum thinking levels, meaning scans can cost thousands or even tens-of-thousands of dollars for large codebases. Our customers have found the cost worth it for how quickly they were able to patch vulnerabilities that would have otherwise gone unfixed.
Expand Down
10 changes: 10 additions & 0 deletions e2e/scan.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,14 @@ describe("scan e2e", () => {
const meta = JSON.parse(fs.readFileSync(runPath, "utf-8"));
expect(meta.scannerConfig.matcherSlugs).toEqual(["xss", "rce"]);
});

it("throws when matcher filter includes an unknown slug", async () => {
await expect(
scan({
projectId: PROJECT_ID,
root: FIXTURES,
matcherSlugs: ["xss", "does-not-exist"],
}),
).rejects.toThrow(/Unknown matcher slug\(s\): does-not-exist/);
});
});
8 changes: 5 additions & 3 deletions packages/scanner/src/matcher-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ export class MatcherRegistry {
}

getBySlugs(slugs: string[]): MatcherPlugin[] {
return slugs
.map((s) => this.matchers.get(s))
.filter((m): m is MatcherPlugin => m !== undefined);
const missing = slugs.filter((slug) => !this.matchers.has(slug));
if (missing.length > 0) {
throw new Error(`Unknown matcher slug(s): ${missing.join(", ")}`);
}
return slugs.map((slug) => this.matchers.get(slug)!);
}

slugs(): string[] {
Expand Down
Loading