OpenStack VM Management Platform
Wiretap is a comprehensive web-based platform for managing OpenStack virtual machine instances, designed for educational workshops, competitions, and team-based environments. It provides a user-friendly interface for provisioning, monitoring, and controlling VM instances with advanced features like scheduled lockouts, team management, and console access.
- VM Instance Management: Create, update, delete, and monitor OpenStack VM instances
- Power Controls: Start, stop, restart instances with soft/hard reboot options
- Real-time Status Sync: Automatic synchronization with OpenStack every 30 seconds
- Console Access: VNC/NoVNC console access for direct VM interaction
- Multi-Provider Support: Manage instances across multiple OpenStack providers
- Workshop Organization: Organize instances by workshops with custom configurations
- Team Management: Assign users to teams with role-based access control
- Scheduled Lockouts: Automatically lock/unlock instances based on time windows
- Competition Mode: Support for competitive environments with access restrictions
- Role-Based Access Control: Admin, Service Account, and regular user roles
- OpenID Connect Integration: SSO authentication support
- JWT Authentication: Secure token-based authentication
- Bulk User Operations: Generate and manage multiple users efficiently
- Pending Team Assignments: Manage team membership requests
- Provider Management: Configure and test OpenStack provider connections
- Instance Lockout Controls: Manual lock/unlock capabilities for instances
- System Statistics: Dashboard with usage statistics and metrics
- Audit Logging: Comprehensive logging system with automatic cleanup
- Service Account Management: Create and manage service accounts for automation
- RESTful API: Well-documented REST API with Swagger/OpenAPI documentation
- WebSocket Support: Real-time communication capabilities
- Scheduled Tasks: Automated background tasks for maintenance
- Database Abstraction: MySQL-based data persistence
- Framework: Express.js (Node.js)
- Database: MySQL
- Authentication: JWT + OpenID Connect
- API Documentation: Swagger/OpenAPI
- Scheduled Tasks: Automated instance sync, session cleanup, log maintenance
- Framework: Vue.js 3
- Build Tool: Vite
- UI Library: Headless UI + Heroicons
- Styling: Tailwind CSS
- State Management: Pinia
- Node.js (v16 or higher)
- MySQL (v5.7 or higher)
- OpenStack environment with API access
- npm or yarn package manager
git clone <repository-url>
cd wiretapcd backend
npm installCreate a .env file in the backend directory:
# Database Configuration
DB_HOST=localhost
DB_USER=your_db_user
DB_PASSWORD=your_db_password
DB_NAME=wiretap
DB_PORT=3306
# Server Configuration
PORT=3000
NODE_ENV=development
# JWT Configuration
JWT_SECRET=your_jwt_secret_key
JWT_EXPIRES_IN=24h
# OpenID Connect (Optional)
OPENID_ISSUER=https://your-oidc-provider.com
OPENID_CLIENT_ID=your_client_id
OPENID_CLIENT_SECRET=your_client_secret
OPENID_REDIRECT_URI=http://localhost:3000/api/auth/openid/callback
# CORS Configuration
CORS_ORIGIN=http://localhost:5173cd frontend
npm installCreate a .env file in the frontend directory:
VITE_API_URL=http://localhost:3000The database tables will be automatically created on first run. Ensure your MySQL server is running and the database exists.
Backend:
cd backend
npm run devFrontend:
cd frontend
npm run devBackend:
cd backend
npm startFrontend:
cd frontend
npm run build
npm run previewThe backend API will be available at http://localhost:3000 and the frontend at http://localhost:5173 (development) or your configured production URL.
Once the backend is running, access the Swagger API documentation at:
http://localhost:3000/api-docs
Wiretap supports multiple authentication methods:
- Username/Password: Traditional login with JWT tokens
- OpenID Connect: SSO authentication via OIDC providers
- Service Accounts: Token-based authentication for automation
On first run, you may need to create an admin user. Check the authentication routes for user creation endpoints.
- Navigate to Providers section (Admin only)
- Add OpenStack provider credentials
- Test the connection
- Ingest existing instances if needed
- Create a new workshop
- Associate it with a provider
- Configure OpenStack project name
- Set lockout schedules if needed
- View all instances in the dashboard
- Filter by workshop, team, or status
- Use power controls to manage VM state
- Access console for direct VM interaction
- Sync instances to update status from OpenStack
The console pane offers two renderers, picked from the toolbar and remembered per instance:
- noVNC - the graphical framebuffer, in an iframe. Pasting types the text in as simulated keystrokes, 40 characters at a time.
- xterm.js - Nova's serial console, a raw byte stream rendered directly, so a paste arrives as a single write.
Terminal size. A serial line carries no window size. SSH and local terminals have a side channel for it; a UART does not, so the guest keeps whatever its getty started with (usually 80x24) however large the browser window is - vim draws into the top-left corner and long commands wrap at the wrong column. Nothing on this side can fix that: the size lives in the guest's termios, so the guest has to set it.
It can work this out for itself. Park the cursor far off-screen and ask where
it actually landed with a Cursor Position Report; xterm.js answers, and the
reply is the real size. Run at login this needs no interaction, and unlike
typing stty at the prompt it cannot land in an editor. Bake it into your
images as /etc/profile.d/serial-resize.sh:
case "$(tty 2>/dev/null)" in
/dev/ttyS*|/dev/ttyAMA*|/dev/hvc*)
if [ -t 0 ] && [ -n "$BASH_VERSION" ]; then
__old=$(stty -g)
stty raw -echo min 0 time 2
printf '\033[999;999H\033[6n' > /dev/tty
IFS='[;R' read -r -d R -t 2 _ __rows __cols < /dev/tty
stty "$__old"
[ -n "$__rows" ] && [ -n "$__cols" ] && stty rows "$__rows" cols "$__cols"
unset __old __rows __cols
fi
# The serial getty hands out TERM=vt220, which costs vim color and its
# better redraw path.
case "$TERM" in
vt220|vt100|dumb|'') TERM=xterm-256color; export TERM ;;
esac
;;
esacThe workshops repo installs this through its serial_console Ansible role. On
an image without it, log in and run stty rows R cols C by hand at a shell
prompt - never with an editor open, where those bytes are editor commands. If a
session is already wrong, reset clears the damage.
Requirements. The serial console needs [serial_console] enabled = true in
the cloud's nova.conf, and instances must have been created after it was
turned on - an older VM has no serial device attached. Wiretap answers 502 for
that case and the UI suggests noVNC. Nova serves one serial session per
instance at a time; a second viewer gets a connection error.
- Create teams and assign users
- Associate instances with teams
- Manage pending team assignments
- Control access based on team membership
The application runs several automated tasks:
- Instance Status Sync: Every 30 seconds - Updates instance status from OpenStack
- Session Cleanup: Every hour - Removes expired console sessions
- Log Cleanup: Daily at 2 AM - Removes logs older than 7 days
- Lockout Scheduler: Monitors and enforces scheduled lockout windows
wiretap/
βββ backend/
β βββ index.js # Application entry point
β βββ routes/ # API route handlers
β βββ managers/ # Business logic managers
β βββ middleware/ # Express middleware
β βββ utils/ # Utility functions
β βββ swaggerConfig/ # API documentation config
βββ frontend/
β βββ src/
β β βββ components/ # Vue components
β β βββ views/ # Page views
β β βββ stores/ # Pinia stores
β β βββ router/ # Vue Router config
β βββ public/ # Static assets
βββ README.md
- Backend: Follow Express.js best practices
- Frontend: ESLint + Prettier configured
- Run
npm run lintandnpm run formatbefore committing
API endpoints are documented with Swagger. Use the Swagger UI to test endpoints interactively.
ISC
Contributions are welcome! Please ensure your code follows the project's style guidelines and includes appropriate tests.
For issues, questions, or contributions, please open an issue on the repository.
Built with β€οΈ for OpenStack VM management