镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content
vgridPublic

About

Trivy UI – vulnerability dashboard for Kubernetes clusters

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

Trivy UI Dashboard

Docker Image License: MIT Go Version React Version

A modern, high-performance web dashboard for visualizing, auditing, and analyzing security scan results generated by the Trivy Operator across Kubernetes clusters.


Key Highlights

  • 🌐 Multi-Cluster Fleet Hub: Centralized cross-cluster security overview, global 30-day severity trends, cluster risk rankings, and directory cards.
  • 🛡️ Comprehensive Trivy Operator Support: Automatically discovers all Trivy CRDs — Vulnerability, ConfigAudit, RBAC Assessment, Exposed Secrets, Infra Assessment, Compliance, and SBOM (including cluster-scoped variants).
  • 📊 Executive & Engineering Views: Equal-height symmetrical layouts featuring 30-day vulnerability volume, scan breakdown matrices, and top vulnerable workloads.
  • 🗂️ Modern UX & Navigation: Resizable sidebar (220px–480px) with persistent width, Aqua Security semantic iconography, and instant type search.
  • 🔐 Authentication & Fine-Grained RBAC: File-backed local authentication (auth.yaml) with user/group scopes, browser password manager integration, and anti-timing protections.
  • ⚡ High-Performance Architecture: Informer-based in-memory caching with disk snapshot persistence, sub-millisecond response times, and background polling sleep when tabs are inactive.

Screenshots

Fleet Hub (Cross-Cluster Overview)

Fleet Hub

Cluster Overview Dashboard

Cluster Overview

Web UI Login

Web UI Login

📸 Explore more screenshots: For reports list filtering, workload badges, and detail drawer inspection, see Dashboard Features & Navigation.


Quick Start

Option 1: Docker Standalone

Run Trivy UI directly with Docker by mounting a directory containing your kubeconfig file(s):

docker run -d \
  --name trivy-ui \
  -v /path/to/kubeconfigs:/kubeconfigs \
  -e KUBECONFIG_DIR=/kubeconfigs \
  -p 8080:8080 \
  locustbaby/trivy-ui:v0.0.5

Open http://localhost:8080 in your browser. Every context in each mounted kubeconfig file is automatically discovered and initialized as a separate cluster.

Option 2: Deploy with Helm (Kubernetes)

Deploy to your Kubernetes cluster directly from Docker Hub's OCI registry:

helm upgrade --install trivy-ui oci://registry-1.docker.io/locustbaby/trivy-ui

To provide multiple cluster credentials via a Secret:

kubectl create secret generic kubeconfigs \
  --from-file=prod=/path/to/prod-kubeconfig \
  --from-file=staging=/path/to/staging-kubeconfig

helm upgrade --install trivy-ui oci://registry-1.docker.io/locustbaby/trivy-ui \
  --set kubeconfigs.create=false \
  --set kubeconfigs.secretName=kubeconfigs

Authentication & Access Control (RBAC)

Trivy UI includes built-in file-backed authentication with fine-grained role-based access control (RBAC):

  • Fine-Grained Scopes: Restrict users or teams to specific clusters, namespaces, or cluster-scoped audit reports.
  • Native Login Experience: Seamless integration with browser password managers (Chrome, Safari, 1Password, Bitwarden), show/hide password toggle, and "Remember username".
  • Hardened Security: Bcrypt password hashing, in-flight concurrency limiting, and anti-timing protections.
# auth.yaml example
version: v1
users:
  admin:
    passwordHash: "$2a$12$REPLACE_WITH_YOUR_BCRYPT_HASH"
    scopes:
      - cluster: "*"
        namespaces: ["*", "_"]  # All Namespaced and Cluster-scoped reports
  developer:
    passwordHash: "$2a$12$REPLACE_WITH_YOUR_BCRYPT_HASH"
    scopes:
      - cluster: "prod"
        namespaces: ["team-a"]   # Restricted to team-a in prod

📖 How to Configure Authentication:


Documentation

Full operational, configuration, and developer guides are available in the User Guide:

Guide Focus
📖 01. Installation & Configuration Helm deployment, standalone Docker, ingress, cache tuning, and environment variables
🔐 02. Authentication & Access Control Password hashing, auth.yaml scopes, Web UI login experience, and API access
🌐 03. Multi-Cluster Collection Multi-cluster kubeconfig secrets, Fleet Hub cross-cluster overview, and cluster switching
🛠️ 04. Operations & Troubleshooting 401 Unauthorized troubleshooting, cluster permissions, and production health checks
📊 05. Dashboard Features & Navigation Resizable sidebar, Aqua semantic icons, 30-day trends, report filtering, and detail drawers
🔌 06. API Reference & Error Codes REST API endpoints, query filters, JSON error schema, and cURL examples
📦 Helm Chart Reference Complete list of Helm values and configurable deployment options

Architecture

trivy-ui/
├── go-server/         # High-performance Go backend with K8s client-go informers
├── trivy-dashboard/   # Modern React 19 + TypeScript + Vite + Tailwind CSS frontend
├── charts/            # Production-ready Helm chart
└── docs/              # Comprehensive user and architectural documentation

Data Flow

  1. Discovery: Backend dynamically discovers Trivy Operator CRDs and namespaces via the Kubernetes API.
  2. Streaming Watch: Kubernetes Informers establish persistent watches over discovered report types across all clusters.
  3. Optimized In-Memory Store: SetTransform strips large unused fields, keeping memory lean and queries sub-millisecond.
  4. On-Demand Detail Fetch: Full report payloads and CVE remediations are loaded on demand and cached with a short TTL.
  5. Snapshot Persistence: Disk caching enables immediate warm startup on pod restarts without blocking on full cluster re-syncs.

Development & Testing

Running Locally

sh start.sh

This builds the frontend assets and launches the unified server at http://localhost:8080.

Running Tests

# Unit tests
cd go-server && go test ./...

# Frontend lint & build
cd trivy-dashboard && npm run lint && npm run build

License

This project is licensed under the MIT License.

About

Trivy UI – vulnerability dashboard for Kubernetes clusters

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages