feat: implement scanner rules, CLI, tests, and lint config#1
Merged
Conversation
added 4 commits
May 19, 2026 05:57
- TypeScript strict mode, ES2022, NodeNext resolution - Package metadata, MIT license, .gitignore - src/index.ts stub with planned public API - .github/workflows/ci.yml (Node 20, install/lint/test/build) - CHANGELOG.md (Keep a Changelog), CONTRIBUTING.md (incubation notice)
- SECURITY.md: vulnerability reporting policy (security@hailbytes.com) - .github/ISSUE_TEMPLATE/bug_report.md - .github/ISSUE_TEMPLATE/rule_request.md - package.json: added typecheck script (tsc --noEmit) - CI: added typecheck step, CLI smoke-test step, removed continue-on-error
f15c6d2 to
6f9ed64
Compare
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.
Summary
Implements the full MCP security scanner library from the ground up.
New files
src/types.ts— Severity/RuleId enums, Finding/ScanConfig/SecurityReport interfacessrc/parser.ts— parseConfig() reads JSON/YAML config files and normalises to ParsedMcpConfigsrc/scorer.ts— computeScore() and computeSummary()src/rules/auth-rules.ts— NO_AUTH, WEAK_API_KEY, MISSING_TLS rulessrc/rules/injection-rules.ts— TOOL_DESC_INJECTION, UNSAFE_TOOL_OUTPUT_PATH rulessrc/rules/config-rules.ts— WILDCARD_CORS, VERBOSE_ERRORS, OVERPRIVILEGED_TOOL rulessrc/rules/index.ts— Rule interface + getAllRules()src/scanner.ts— scan() main entry pointsrc/index.ts— public re-exports (replaces stub)src/cli.ts— CLI entry point (exit code 1 on failure)src/__tests__/scanner.test.ts— 27 integration + unit testssrc/__tests__/scorer.test.ts— 8 scorer unit testsConfig files
jest.config.cjs— ts-jest in CJS mode with .js → .ts resolver.eslintrc.cjs— ESLint + @typescript-eslintResults
tscpasses with zero errors