How openclarity/kubeclarity works
Main components
• API/Backend Server – Found in the “api”, “backend”, and “sbom_db” directories. This layer handles REST API endpoints (with subcomponents for operations, models, and controllers) and communicates with the underlying database for managing applications, resources, packages, and vulnerabilities.
• CLI Tool – The “cli” directory contains command‐line functionality. It is used in CI/CD pipelines to generate SBOMs and perform vulnerability scans, and then export results back to the backend.
• UI – Under the “ui” directory, which implements the web dashboard. It provides user interactions for viewing applications, scan results, and performing actions such as scheduling a runtime scan.
• Scanners and Analyzers – Scanners for vulnerabilities and SBOM generators are integrated throughout the project. Look at the “runtime_k8s_scanner”, “cis_docker_benchmark_scanner”, and the shared packages under “shared/pkg/analyzer” and “shared/pkg/scanner”. They implement support for tools like Syft, CycloneDX, Grype, and Trivy.
• Deployment & Configuration – The “charts” directory provides Helm charts for Kubernetes deployment. Additionally, configuration files (Dockerfiles, Makefile, go.mod files) indicate containerized deployment, CI workflows (under .github/workflows), and integration into Kubernetes.
• Utility & Shared Components – The “shared” directory contains common utilities, converters, analyzers, and job managers that support various pipelines across the system.
Relationships & Data Flow
• The UI interacts with the API/Backend via REST calls, obtaining data for dashboards (e.g., vulnerabilities, scan statuses, SBOMs).
• The CLI tool (and runtime scanners like “runtime_k8s_scanner”) serves as an external client that triggers SBOM generation and vulnerability scans, then sends data (using export functionality) to the API/Backend.
• Analyzers and scanners are plugged into both CLI and backend pipelines; they fetch data from containers (or local images/registries), process SBOM creation, scan for vulnerabilities, and then aggregate results.
• Deployment is orchestrated using Helm charts for Kubernetes, and jobs (such as scheduled or on-demand scanning jobs) rely on proper RBAC permissions and secret management.
Architectural Patterns and Design Principles
• Separation of Concerns: There is a clear split between API (with its models, operations, and endpoints) and the CLI/UI layers that consume these endpoints.
• Modular and Pluggable Architecture: The design accommodates multiple SBOM generators and vulnerability scanners, with configuration (such as environment variables) allowing for easy swapping or adding of tools.
• Microservices/Containerization: Multiple Dockerfiles indicate that different parts (backend, CLI, runtime scanners, cis docker benchmark updater, and SBOM DB) can be run as separate containers.
• Kubernetes Deployment: Integration with Helm charts, K8s RBAC, and secret management for container registry access underscores that deployment is designed for cloud orchestration.