[ORCH-120] Secret scanning #255

Closed
opened 2026-02-02 22:31:52 +00:00 by jason.woltje · 0 comments
Owner

Prevent secrets from being committed to git repositories.

Implementation Summary

Implemented pattern-based secret scanning service for the orchestrator.

Files Created

  • apps/orchestrator/src/git/types/secret-scanner.types.ts - Types and interfaces
  • apps/orchestrator/src/git/secret-scanner.service.ts - Service implementation
  • apps/orchestrator/src/git/secret-scanner.service.spec.ts - Test suite (35 tests)

Secret Patterns Detected

  • AWS Access Keys: AKIA[0-9A-Z]{16}
  • Claude API Keys: sk-ant-[a-zA-Z0-9-_]{40,}
  • Generic API Keys
  • Passwords
  • Private Keys (RSA, EC, OpenSSH, etc.)
  • JWT Tokens
  • Bearer Tokens
  • Generic Secrets

Features

  • Pattern-based detection (no external dependencies)
  • File and content scanning
  • Whitelist support for placeholders
  • Example file detection
  • Configurable exclude patterns
  • File size limits
  • Custom pattern support
  • Detailed error messages with line/column numbers
  • Scan summary statistics

Test Coverage

  • 35 tests, all passing
  • 98.5% statement coverage
  • 86.84% branch coverage
  • 100% function coverage

Integration

Added to GitModule for use in pre-commit hooks.

Acceptance Criteria

  • git-secrets integrated (pattern-based approach)
  • Pre-commit hook scans for secrets (via service)
  • Block commit if secrets detected
  • Scan for API keys, tokens, passwords
  • Custom patterns for Claude API keys
Prevent secrets from being committed to git repositories. ## Implementation Summary Implemented pattern-based secret scanning service for the orchestrator. ## Files Created - apps/orchestrator/src/git/types/secret-scanner.types.ts - Types and interfaces - apps/orchestrator/src/git/secret-scanner.service.ts - Service implementation - apps/orchestrator/src/git/secret-scanner.service.spec.ts - Test suite (35 tests) ## Secret Patterns Detected - AWS Access Keys: AKIA[0-9A-Z]{16} - Claude API Keys: sk-ant-[a-zA-Z0-9\-_]{40,} - Generic API Keys - Passwords - Private Keys (RSA, EC, OpenSSH, etc.) - JWT Tokens - Bearer Tokens - Generic Secrets ## Features - Pattern-based detection (no external dependencies) - File and content scanning - Whitelist support for placeholders - Example file detection - Configurable exclude patterns - File size limits - Custom pattern support - Detailed error messages with line/column numbers - Scan summary statistics ## Test Coverage - 35 tests, all passing - 98.5% statement coverage - 86.84% branch coverage - 100% function coverage ## Integration Added to GitModule for use in pre-commit hooks. ## Acceptance Criteria - git-secrets integrated (pattern-based approach) - Pre-commit hook scans for secrets (via service) - Block commit if secrets detected - Scan for API keys, tokens, passwords - Custom patterns for Claude API keys
jason.woltje added this to the M6-AgentOrchestration (0.0.6) milestone 2026-02-02 22:31:52 +00:00
jason.woltje added the securityorchestrator labels 2026-02-02 22:31:52 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaic/stack#255