How machindra7/trustlens-pipeline works
TrustLens scans a selected repository with Checkov, Trivy, and Semgrep, normalizes and deduplicates their results into a unified finding model, writes JSON, and can upload findings to PostgreSQL. A Next.js application exposes findings and database health endpoints and includes landing and dashboard pages. Scanner, normalization, ingestion, and API-to-database relationships are supported by the sampled source. The page-to-API wiring and unsampled dashboard behavior are not shown, so those links are omitted.
Main entry points: main.py CLI pipeline · checkov_scanner.py Checkov scanner · trivy_scanner.py Trivy scanner · semgrep_scanner.py Semgrep scanner
Components 20
Scanning and normalization
- CLI pipeline
trustlens/main.py - Checkov scanner
trustlens/scanners/checkov_scanner.py - Trivy scanner
trustlens/scanners/trivy_scanner.py - Semgrep scanner
trustlens/scanners/semgrep_scanner.py - Finding normalizer
trustlens/normalizer/normalize.py - Unified finding model
trustlens/models/finding.py
Ingestion and storage
- Findings JSON
- Database ingestion
trustlens/ingest_findings.py - Findings table
src/db/schema.ts
Web application
- Web database client
src/db/index.ts - Findings API
src/app/api/findings/route.ts - Health API
src/app/api/health/route.ts - Landing page
src/app/page.tsx - Dashboard page
src/app/dashboard/page.tsx
Other components
- Operator
- Target repository
- Checkov
- Trivy
- Semgrep
- PostgreSQL
Connections 22
- Operator → CLI pipeline: runs scan
trustlens/main.py - Target repository → CLI pipeline: scan target
trustlens/main.py - CLI pipeline → Checkov scanner: calls scan
trustlens/main.py - CLI pipeline → Trivy scanner: calls scan
trustlens/main.py - CLI pipeline → Semgrep scanner: calls scan
trustlens/main.py - Checkov scanner → Checkov: runs
trustlens/scanners/checkov_scanner.py - Trivy scanner → Trivy: runs
trustlens/scanners/trivy_scanner.py - Semgrep scanner → Semgrep: runs
trustlens/scanners/semgrep_scanner.py - Checkov scanner → CLI pipeline: returns findings
trustlens/main.py - Trivy scanner → CLI pipeline: returns findings
trustlens/main.py - Semgrep scanner → CLI pipeline: returns findings
trustlens/main.py - CLI pipeline → Finding normalizer: normalizes results
trustlens/main.py - Finding normalizer → Unified finding model: creates findings
trustlens/normalizer/normalize.py - CLI pipeline → Findings JSON: writes findings
trustlens/main.py - CLI pipeline → Database ingestion: starts upload
trustlens/main.py - Database ingestion → Findings JSON: reads findings
trustlens/ingest_findings.py - Database ingestion → PostgreSQL: inserts rows
trustlens/ingest_findings.py - Findings API → Web database client: queries
src/app/api/findings/route.ts - Findings API → Findings table: selects rows
src/app/api/findings/route.ts - Web database client → PostgreSQL: connects
src/db/index.ts - Health API → Web database client: checks connection
src/app/api/health/route.ts - Health API → PostgreSQL: tests query
src/app/api/health/route.ts