Skip to content

feat: implement scanner rules, CLI, tests, and lint config#1

Merged
dmchaledev merged 4 commits into
mainfrom
feat/scanner-implementation
May 19, 2026
Merged

feat: implement scanner rules, CLI, tests, and lint config#1
dmchaledev merged 4 commits into
mainfrom
feat/scanner-implementation

Conversation

@dmchaledev
Copy link
Copy Markdown
Contributor

Summary

Implements the full MCP security scanner library from the ground up.

New files

  • src/types.ts — Severity/RuleId enums, Finding/ScanConfig/SecurityReport interfaces
  • src/parser.ts — parseConfig() reads JSON/YAML config files and normalises to ParsedMcpConfig
  • src/scorer.ts — computeScore() and computeSummary()
  • src/rules/auth-rules.ts — NO_AUTH, WEAK_API_KEY, MISSING_TLS rules
  • src/rules/injection-rules.ts — TOOL_DESC_INJECTION, UNSAFE_TOOL_OUTPUT_PATH rules
  • src/rules/config-rules.ts — WILDCARD_CORS, VERBOSE_ERRORS, OVERPRIVILEGED_TOOL rules
  • src/rules/index.ts — Rule interface + getAllRules()
  • src/scanner.ts — scan() main entry point
  • src/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 tests
  • src/__tests__/scorer.test.ts — 8 scorer unit tests

Config files

  • jest.config.cjs — ts-jest in CJS mode with .js → .ts resolver
  • .eslintrc.cjs — ESLint + @typescript-eslint

Results

  • ✅ Build: tsc passes with zero errors
  • ✅ Tests: 35/35 pass
  • ✅ Lint: zero warnings

HailBytes Bot 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
@dmchaledev dmchaledev force-pushed the feat/scanner-implementation branch from f15c6d2 to 6f9ed64 Compare May 19, 2026 11:58
@dmchaledev dmchaledev merged commit 79df691 into main May 19, 2026
1 check passed
@dmchaledev dmchaledev deleted the feat/scanner-implementation branch May 19, 2026 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant