Skip to content
keylime-webtoolPublic

About

Modular React web interface designed to manage, monitor, and configure Keylime's hardware-based remote attestation and security posture verification through a clean, specimen-driven, and highly accessible user dashboard.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

Keylime Monitoring Dashboard - Frontend

Web-based frontend for the Keylime Monitoring Dashboard, providing centralized monitoring, management, and compliance for Keylime remote attestation infrastructure.

Built with React 18, TypeScript, Vite, and React Router.

Prerequisites

  • Node.js 18+
  • npm

Getting Started

# Install dependencies
npm install

# Start the development server
npm run dev

The app runs at http://localhost:5173 by default. API requests are proxied to http://localhost:8080 (the backend).

Available Scripts

Command Description
npm run dev Start development server with HMR
npm run build Type-check and build for production
npm run preview Preview the production build
npm run lint Run ESLint
npm run test Run tests with Vitest

TypeScript Tooling

TypeScript runs side by side, as recommended in the TypeScript 7.0 announcement:

  • @typescript/native aliases typescript@7, the native compiler that provides the tsc binary used for type checking and builds.
  • typescript aliases @typescript/typescript6, which keeps the JavaScript compiler API that typescript-eslint still requires (TypeScript 7 does not ship an API until 7.1).

Once typescript-eslint supports the TypeScript 7.1 API, the typescript6 alias can be dropped.

Environment Variables

Create a .env.local file to override defaults:

VITE_API_BASE_URL=http://localhost:8080
VITE_WS_URL=ws://localhost:8080/ws

Authentication

The dashboard supports an anonymous viewer mode (SR-001): unauthenticated users browse with the read-only Viewer role. Privileged (Operator/Admin) operations require an OIDC login; when such an action returns 401, the frontend redirects to /login?returnTo=<current page> so the user returns to where they were after authenticating.

OIDC sign-in flow:

  1. The user clicks Sign in (Login page or TopBar).
  2. POST /api/auth/login returns an opaque redirect_url; the browser is sent there (the frontend never constructs IdP URLs).
  3. The identity provider returns the browser to /auth/callback?code=…&state=….
  4. The SPA exchanges the code via POST /api/auth/callback and stores the short-lived JWT (SR-010) in sessionStorage under access_token.
  5. The user's role comes from the token's role claim, which the backend derives from the OIDC claims (SR-002 — MFA/acr/amr are never interpreted in the frontend).

Session tokens expire after 15 minutes; the API client transparently performs one POST /api/auth/refresh and retries the failed request when a token expires mid-session. Sign out calls POST /api/auth/logout (SR-011, server-side revocation) and clears the local session.

Note: the backend /api/auth/* endpoints are still stubs returning 500 not implemented. The frontend implements strictly against the contract above; end-to-end verification is pending the backend SR-001 task.

Project Structure

src/
  api/          - API client modules (Axios)
  components/   - Reusable UI components (Layout, DataTable, KpiCard, etc.)
  hooks/        - Custom React hooks (auth, WebSocket)
  pages/        - Page components for each module
  store/        - Zustand state stores
  types/        - TypeScript type definitions

Git Hooks

A pre-commit hook is provided to run CI checks (type check, lint, test, build) before each commit. To enable it:

git config core.hooksPath .githooks

You can also run the checks manually at any time:

./scripts/pre-commit.sh

License

Apache-2.0

About

Modular React web interface designed to manage, monitor, and configure Keylime's hardware-based remote attestation and security posture verification through a clean, specimen-driven, and highly accessible user dashboard.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages