Admin Dashboard Interface
Relevant source files
The following files were used as context for generating this wiki page:
The Warpgate Admin Dashboard Interface is a web-based management console built with Svelte, TypeScript, and Bootstrap. It provides administrators with tools to manage users, roles, targets, and active sessions, as well as review historical recordings and logs. The interface interacts with a Rust-based backend via an OpenAPI-generated client.
Sources: warpgate-web/src/admin/App.svelte:1-73, README.md:92-98
Navigation and Routing
The dashboard uses svelte-spa-router to handle client-side navigation. The application is structured around a main header containing links to primary modules and an AuthBar for session management.
Primary Routes
| Route Path | Component | Description |
|---|---|---|
/ | Home.svelte | Main dashboard overview and active sessions. |
/sessions/:id | Session.svelte | Detailed view of a specific connection session. |
/targets/:id | Target.svelte | Configuration for specific connection targets. |
/users/:id | User.svelte | Individual user management and credential policies. |
/log | Log.svelte | Global system log viewer. |
/config | Config.svelte | General system configuration entry point. |
Sources: warpgate-web/src/admin/App.svelte:20-65
Target Management
Targets are the destination hosts (SSH, HTTP, MySQL, or PostgreSQL) that users connect to through Warpgate. The admin interface allows for detailed configuration of connection parameters, authentication methods for the target, and role-based access control (RBAC) assignments.
Target Types and Options
Warpgate supports several target kinds, each with specific configuration requirements:
- SSH: Requires host, port, username, and authentication (Warpgate private keys or password).
- HTTP: Requires a target URL and TLS configuration.
- MySQL/PostgreSQL: Requires host, port, username, password, and TLS configuration.
Sources: warpgate-web/src/admin/Target.svelte:105-185, warpgate-web/src/admin/CreateTarget.svelte:14-49
Target Configuration Flow
The following diagram illustrates the lifecycle of a target within the admin interface:
The flow shows the transition from target creation to role assignment and connection testing.
Sources: warpgate-web/src/admin/Target.svelte:20-68, warpgate-web/src/admin/CreateTarget.svelte:14-55
Session and Recording Management
The dashboard provides real-time visibility into active user sessions. Administrators can monitor session status, view live logs, and terminate connections manually.
Session Features
- Snapshot View: Displays the authenticated user, selected target, and connection duration.
- Active Control: Allows administrators to close active sessions via
api.closeSession. - Recordings: Lists terminal recordings associated with the session for later replay.
- Contextual Logs: Shows logs filtered specifically for the selected session ID.
Sources: warpgate-web/src/admin/Session.svelte:26-105
Session Data Architecture
This class diagram represents the relationship between a session and its associated data types.
Sources: warpgate-web/src/admin/Session.svelte:2-10, warpgate-web/src/admin/LogViewer.svelte:8-13
Access Control: Users and Roles
Warpgate implements a role-based access control system. Users are assigned roles, and roles are granted access to specific targets.
User Configuration
Administrators can manage user metadata, credential policies (requiring specific factors like TOTP or Public Keys), and role assignments.
Sources: warpgate-web/src/admin/User.svelte:25-83
Access Tickets
Access tickets allow for temporary, often single-use or time-bound, access to a target for a specific user without permanent role assignment.
- Expiry: Optional date/time when the ticket becomes invalid.
- Use Limit: Optional number of times the ticket can be used.
- Secret: A unique token shown only once upon creation.
Sources: warpgate-web/src/admin/CreateTicket.svelte:35-50
Monitoring and Auditing
The LogViewer component provides a technical audit trail of system events. It supports real-time updates and historical searching.
Log Viewer Functional Logic
- Initial Load: Fetches the most recent 1000 items (
PAGE_SIZE). - Live Updates: An interval calls
loadNewer()every 1 second to fetch entries appearing after the current head timestamp. - Pagination: Uses an
IntersectionObserveron a "Load older" button to triggerloadOlder()when the user scrolls to the bottom. - Filtering: Logs can be filtered by
sessionIdor specific text search queries.
Sources: warpgate-web/src/admin/LogViewer.svelte:20-100
Summary
The Warpgate Admin Dashboard serves as the central orchestration point for the bastion host. By integrating session monitoring, granular target configuration, and robust logging, it enables secure and auditable access to internal infrastructure. The interface leverages Svelte's reactive state management and a generated API client to ensure technical consistency with the Rust backend.
Sources: README.md:65-75, warpgate-web/src/admin/App.svelte:75-108