How legit-labs/legitify works
Main Components
a. Core Components:
• Command Line Interface (CLI)
• Analyzers Engine
• Collectors System
• Policy Engine
• Output Formatters
• GPT Integration
• Scorecard Integration
b. External Services:
• GitHub API
• GitLab API
• OpenAI API (for GPT analysis)
• OSSF Scorecard
┌─ User Interface Layer ─────────────────────┐
• CLI Commands │
• GitHub Action Interface │
• ┬───────────────────────┘
• ↓
┌─ Core Processing Layer ───────────────────┐
• ┌─ Collection Engine ─┐ ┌─ Analysis Engine┐│
• GitHub Collector │ │ - Policy Engine ││
• GitLab Collector │ │ - OPA Rules ││
• Entity Collectors │ │ - GPT Analyzer ││
• ┘ └─────────────────┘│
• ┬───────────────────────┘
• ↓
┌─ Integration Layer ────────────────────────┐
• GitHub API Client │
• GitLab API Client │
• Scorecard Integration │
• OpenAI Integration │
• ┬───────────────────────┘
• ↓
┌─ Output Layer ───────────────────────────┐
• Human-readable Formatter │
• JSON Formatter │
• SARIF Formatter │
• Output Schemes Handler │
• ┘
Additional Elements
Specific callouts for:
• Configuration management
• Error handling system
• Cache mechanism
• Authentication flow
• Policy evaluation pipeline
Technical Details to Highlight
• Built in Go
• Uses OPA (Open Policy Agent) for policy evaluation
• Supports multiple output formats
• Implements SLSA Level 3 Provenance
• Supports both cloud and enterprise deployments
Component Details
• Main purpose
• Key dependencies
• Input/Output formats
• Configuration options
Architectural Patterns to Emphasize
• Plugin architecture for collectors
• Strategy pattern for output formatting
• Factory pattern for client creation
• Observer pattern for progress monitoring