π Comprehensive automation system for Red Hat VPN access, SSO authentication, and ephemeral environment management
RH-OTP Auto-Connect is a multi-component system that streamlines Red Hat infrastructure access through:
- π 21 Global VPN Endpoints - One-click connection to Red Hat VPN worldwide
- π Automated Authentication - HOTP token generation and SSO auto-login
- π₯οΈ Desktop Integration - GNOME Shell extension with system tray
- π Chrome Extension - Browser automation for Red Hat portals
- βοΈ Ephemeral Namespaces - Bonfire/OpenShift environment management
- π― Cluster Management - OpenShift cluster configuration and access
- π₯οΈ Terminal Integration - One-click cluster terminal access
- π Secure Credentials - GPG-encrypted password storage
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β π― One System, Complete Infrastructure Access Automation β
β β
21 Global VPN Endpoints β’ β
Auto SSO Login β
β β
Cluster Management β’ β
Terminal Integration β
β β
GNOME Integration β’ β
Chrome Extension β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
graph TB
subgraph "User Interfaces"
CLI[CLI Tools]
Chrome[Chrome Extension]
GNOME[GNOME Extension]
end
subgraph "FastAPI Service :8009"
API[REST API<br/>17+ Endpoints]
end
subgraph "Services"
VPN[VPN Management<br/>21 Endpoints]
Pass[Password Store<br/>GPG Encrypted]
Bonfire[Ephemeral NS<br/>OpenShift]
end
subgraph "External"
NM[NetworkManager]
SSO[Red Hat SSO]
K8s[Kubernetes]
end
CLI --> API
Chrome --> API
GNOME --> API
API --> VPN
API --> Pass
API --> Bonfire
VPN --> NM
Chrome --> SSO
Bonfire --> K8s
style API fill:#4CAF50
style VPN fill:#2196F3
style Pass fill:#FF9800
- 21 Global Endpoints: IAD2 (US), BRQ2 (CZ), AMS2 (NL), NRT (JP), and more
- Profile-Based Configuration: YAML-driven VPN profiles
- One-Click Connection: CLI, API, or GUI
- Real-Time Status: Monitor active VPN connections
- Default Profile Management: Set preferred endpoint
- HOTP Token Generation: RFC 4226 compliant one-time passwords
- GPG Encryption: All credentials encrypted with user's GPG key
- Bearer Token API: Secure localhost-only API access
- Native Messaging: Secure Chrome extension bridge
- No Network Exposure: Service binds to localhost only
- System Tray Icon: Red Hat branded indicator
- VPN Profile Menu: All 21 endpoints organized by region
- Real-Time Monitoring: VPN status updates every 30 seconds
- Password Operations: Quick credential clipboard access
- Desktop Notifications: Operation feedback
- Native Settings: GNOME preferences integration
- Auto-Login: Automatic form filling on Red Hat SSO pages
- Native Messaging: Secure token access
- Manifest V3: Future-proof Chrome extension
- Context Switching: Associate vs. ephemeral credentials
- Ephemeral Integration: Namespace management from browser
- Bonfire Integration: OpenShift environment operations
- Namespace Details: Route, expiration, credentials
- Duration Extension: Extend reservations via API
- Status Monitoring: Check namespace availability
- Cache Management: Refresh namespace data
# Clone repository
git clone https://github.com/yourusername/rh-otp-auto-connect.git
cd rh-otp-auto-connect/src
# Install everything (service, extensions, profiles)
make install
# Start service
systemctl --user start rhotp# Initialize password store (if not already done)
pass init <your-gpg-key-id>
# Add required secrets
pass insert redhat.com/username
pass insert redhat.com/associate-password
pass insert redhat.com/hotp-secret
pass insert redhat.com/hotp-counter# Quick connect to default VPN
./vpn-connect
# Or using Makefile
make vpn-connect
# Connect to specific endpoint
./vpn-profile-manager connect BRQ2
# List all available profiles
make vpn-profiles-listOutput:
Found 21 VPN profiles:
ID Name Remote Proto
====================================================================================================
IAD2 Ashburn (IAD2) ovpn-iad2.redhat.com TCP
BRQ2 Brno (BRQ2) ovpn-brq2.redhat.com TCP
AMS2 Amsterdam (AMS2) ovpn-ams2.redhat.com TCP
...
| Document | Description |
|---|---|
| π User Guide | Installation, usage, troubleshooting |
| ποΈ Architecture | System design, components, data flows |
| π API Reference | Complete REST API documentation |
| π¨βπ» Developer Guide | Development setup, testing, contributing |
| π Authentication Flows | Security and credential diagrams |
| π VPN Workflows | VPN connection diagrams |
| π― Cluster Workflows | OpenShift cluster management diagrams |
| π Documentation Index | Complete documentation overview |
- 40+ Mermaid Diagrams - Interactive diagrams that render in GitHub
- 4,500+ Lines - Comprehensive coverage of all components
- Code Examples - Python, Bash, JavaScript samples
- Troubleshooting Guides - Common issues and solutions
- FAQ - Frequently asked questions
Core authentication and credential management API
- 17+ REST endpoints
- Bearer token authentication
- Uvicorn ASGI server
- Auto-reload in development mode
Key Endpoints:
GET /vpn/profiles # List all 21 VPN profiles
POST /vpn/connect/{id} # Connect to specific profile
GET /vpn/status # Get connection status
POST /vpn/disconnect # Disconnect active VPN
GET /get_creds # Get username + password + OTPManage 21 Red Hat VPN endpoints globally
πΊοΈ Supported Locations:
- π Americas: IAD2 (Ashburn), RDU2 (Raleigh), GRU2 (SΓ£o Paulo)
- π Europe: AMS2 (Amsterdam), BRQ2 (Brno), LCY (London), FAB (Farnborough)
- π Asia-Pacific: NRT (Tokyo), PEK2 (Beijing), SIN2 (Singapore), SYD (Sydney), PNQ2 (Pune)
- π Global: GLOBAL (ovpn.redhat.com)
π§ Tools:
vpn-connect- Quick VPN connection scriptvpn-profile-manager- Full CLI management toolvpn-profiles/profiles.yaml- Configuration file
VPN Workflows Documentation β
Browser automation for Red Hat SSO and ephemeral environments
β¨ Features:
- β Auto-fill credentials on Red Hat login pages
- β One-click password retrieval
- β Ephemeral namespace management
- β Native messaging for secure token access
- β Manifest V3 compliance
π Supported Pages:
auth.redhat.com- Main SSO portalsso.redhat.com- Secondary SSO- Ephemeral environment login pages
π¦ Installation:
make install-chrome
# Load extension in Chrome
# 1. chrome://extensions/ β Enable Developer mode
# 2. Load unpacked β Select src/rh-otp/
# 3. Copy extension ID
# 4. Run: python3 install_native_host.py --extension-id <ID>Desktop integration with system tray and notifications
β¨ Features:
- π― System tray icon with Red Hat branding
- π VPN profile submenu (21 endpoints by region)
- π Real-time VPN status monitoring
- π Password clipboard operations
- π Desktop notifications
- βοΈ Native GNOME preferences UI
π¦ Installation:
make install-gnome
make gnome-enable
# Open preferences
make gnome-prefsBonfire/OpenShift environment automation
β‘ Capabilities:
- List and filter namespaces
- Get namespace details (route, expiration, password)
- Extend reservation duration
- Cache management
π‘ Example:
TOKEN=$(cat ~/.cache/rhotp/auth_token)
# Get namespace details with password
curl -H "Authorization: Bearer $TOKEN" \
"http://localhost:8009/ephemeral/namespace/details?include_password=true"
# Extend namespace by 48 hours
curl -X POST \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"duration": "48h"}' \
http://localhost:8009/ephemeral/namespace/extendCentralized configuration and access for multiple OpenShift clusters
β¨ Features:
- β CRUD operations for cluster configurations
- β Search and filter clusters by name, description, or URL
- β
Get
oc logincommands via automated browser authentication - β One-click terminal access with persistent KUBECONFIG
- β One-click web console access in browser
- β GNOME extension integration with submenus
π Default Cluster Environments:
- Ephemeral (
e) - Temporary dev/test environments - Production (
p) - Production OpenShift cluster - Stage (
s) - Staging environment - App SRE Production (
ap) - App SRE prod cluster - App SRE Stage (
cp) - App SRE staging cluster - Stone Production (
k) - Stone prod cluster
π‘ Example:
TOKEN=$(cat ~/.cache/rhotp/auth_token)
# List all configured clusters
curl -H "Authorization: Bearer $TOKEN" \
http://localhost:8009/token/clusters
# Get oc login command for ephemeral environment
curl -H "Authorization: Bearer $TOKEN" \
"http://localhost:8009/token/oc-login?env=e&headless=true"
# Open terminal for production cluster (GNOME)
curl -X POST -H "Authorization: Bearer $TOKEN" \
http://localhost:8009/token/clusters/p/open-terminal
# Open web console for staging cluster
curl -X POST -H "Authorization: Bearer $TOKEN" \
http://localhost:8009/token/clusters/s/open-web
# Add a new cluster
curl -X POST \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Development Cluster",
"description": "Dev environment",
"url": "https://oauth-openshift.apps.dev.example.com/oauth/token/request"
}' \
http://localhost:8009/token/clusters/devπ¦ Tools:
rhtoken- OpenShift token acquisition script with auto-ChromeDriver managementkubeconfig.sh- Kubeconfig management functions (kube,kube-clean)rhtoken.json- Cluster configuration file
Cluster Workflows Documentation β
| Layer | Technology | Purpose |
|---|---|---|
| Backend | FastAPI, Uvicorn | REST API server |
| Frontend | Chrome Extension (Manifest V3) | Browser automation |
| Desktop | GNOME Shell Extension (GJS) | System integration |
| Security | GPG, Pass, HOTP (RFC 4226) | Credential management |
| VPN | NetworkManager, OpenVPN | VPN connectivity |
| Cloud | Bonfire, OpenShift, Kubernetes | Ephemeral environments |
sequenceDiagram
participant User
participant CLI as vpn-connect
participant API as FastAPI :8009
participant Pass as Password Store
participant NM as NetworkManager
User->>CLI: ./vpn-connect
CLI->>API: GET /vpn/default
API->>Pass: Get default UUID
Pass-->>API: UUID
API-->>CLI: Profile info
CLI->>API: GET /get_creds
API->>Pass: Generate HOTP token
Pass-->>API: username,password+OTP
API-->>CLI: Credentials
CLI->>NM: nmcli con up uuid <UUID>
NM-->>CLI: Connection active
CLI-->>User: Connected!
Full Architecture Documentation β
- GPG Encryption: All credentials encrypted with user's GPG key
- Password Store: Standard Unix
passpassword manager - HOTP Secrets: Never transmitted unencrypted
- Temp Files: Immediate deletion after use (chmod 600)
- Bearer Tokens: Cryptographically secure random tokens
- Localhost Only: No network exposure (binds to 127.0.0.1:8009)
- File Permissions: 600 on token file
- Timing-Safe Comparison:
secrets.compare_digest()for token validation
graph LR
Token[~/.cache/rhotp/auth_token<br/>Generated on startup]
Chrome[Chrome Extension]
GNOME[GNOME Extension]
CLI[CLI Scripts]
Token -.Native Messaging.-> Chrome
Token -.File Read.-> GNOME
Token -.File Read.-> CLI
Chrome --> API[FastAPI Bearer Auth]
GNOME --> API
CLI --> API
style Token fill:#FF9800
style API fill:#4CAF50
- OS: Linux (Fedora/RHEL recommended)
- Python: 3.11 or higher
- NetworkManager: For VPN connections
- GPG: Configured with user key
- Pass: Unix password manager
- Chrome/Chromium: For browser extension
- GNOME Shell: For desktop extension (versions 3.36-49+)
- Bonfire CLI: For ephemeral namespace management
- oc/kubectl: For Kubernetes operations
# Fedora/RHEL
sudo dnf install python3-pip NetworkManager-cli pass gpg
# Install Python dependencies
make install-deps
# Or using Pipenv
pipenv install# List all 21 VPN profiles
./vpn-profile-manager list
# Connect to specific endpoint
./vpn-profile-manager connect IAD2
# Check VPN status
make vpn-status
# Disconnect
make vpn-disconnectimport requests
TOKEN = open("~/.cache/rhotp/auth_token").read().strip()
BASE_URL = "http://localhost:8009"
HEADERS = {"Authorization": f"Bearer {TOKEN}"}
# List VPN profiles
response = requests.get(f"{BASE_URL}/vpn/profiles", headers=HEADERS)
profiles = response.json()
# Connect to VPN
response = requests.post(
f"{BASE_URL}/vpn/connect/brq2",
headers=HEADERS
)
print(response.json()["message"]) # "Connected to Brno (BRQ2)"
# Get credentials
response = requests.get(f"{BASE_URL}/get_creds", headers=HEADERS)
username, password_with_otp = response.text.strip().strip('"').split(',')TOKEN=$(cat ~/.cache/rhotp/auth_token)
BASE="http://localhost:8009"
# Get VPN status
curl -s -H "Authorization: Bearer $TOKEN" "$BASE/vpn/status" | jq .
# Extend ephemeral namespace
curl -s -X POST \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"duration": "48h"}' \
"$BASE/ephemeral/namespace/extend" | jq .# Install dev dependencies
pipenv install --dev
# Start service in dev mode (auto-reload)
make dev
# Run tests
make test
# Run linters
make lint
# Format code
make formatsrc/
βββ main.py # FastAPI entry point
βββ api/
β βββ routes/ # Endpoint handlers
β βββ models/ # Pydantic models
β βββ dependencies/ # Shared dependencies
βββ services/
β βββ vpn.py # VPN business logic
β βββ ephemeral.py # Bonfire integration
β βββ password_store.py # GPG/pass integration
βββ vpn-profiles/
β βββ profiles.yaml # VPN configuration
βββ rh-otp/ # Chrome extension
βββ rh-otp-gnome/ # GNOME extension
| π Global VPN | π Auto-Login | π₯οΈ Desktop UI | βοΈ Ephemeral |
|---|---|---|---|
| 21 worldwide endpoints | One-click SSO auth | GNOME integration | OpenShift mgmt |
| Real-time status | HOTP token gen | System tray icon | Namespace extend |
| Profile manager | Chrome extension | Notifications | API automation |
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Guidelines:
- Follow PEP 8 code style
- Add tests for new features
- Update documentation
- Use conventional commit messages
| Metric | Count |
|---|---|
| Total Code | ~3,500 lines |
| API Endpoints | 17+ |
| VPN Profiles | 21 global |
| Documentation | 4,500+ lines |
| Diagrams | 40+ Mermaid |
| Test Coverage | Growing |
- VPN management (21 global endpoints)
- Chrome extension with native messaging
- GNOME Shell extension
- Ephemeral namespace management
- HOTP token generation
- Comprehensive documentation
- Bonfire namespace reservation/release (See proposal)
- Application deployment management
- Resource monitoring and health checks
- Rate limiting for API
- Async operations (full async/await)
- Command-line tool consolidation (See analysis)
This project is licensed under the MIT License - see LICENSE.txt for details.
- FastAPI - Modern, fast web framework
- Pass - Standard Unix password manager
- NetworkManager - Linux network management
- Bonfire - Red Hat ephemeral environment tool
- GNOME - Desktop environment integration
- Documentation: docs/
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Architecture Diagrams: docs/drawings/
| Resource | Link |
|---|---|
| π Documentation | docs/README.md |
| ποΈ Architecture | docs/ARCHITECTURE.md |
| π API Reference | docs/API.md |
| π€ User Guide | docs/USER_GUIDE.md |
| π¨βπ» Developer Guide | docs/DEVELOPER_GUIDE.md |
| π Security Flows | docs/drawings/AUTH_FLOWS.md |
| π VPN Workflows | docs/drawings/VPN_WORKFLOWS.md |
| π― Cluster Workflows | docs/drawings/CLUSTER_WORKFLOWS.md |
| π Feature Plans | plans/ |
Made with β€οΈ for Red Hat Infrastructure Automation
π Documentation β’ π API Reference β’ π¨βπ» Contributing β’ π Report Bug β’ π‘ Request Feature
Give a βοΈ if this project helped you!
Built with FastAPI β’ Powered by Python β’ Secured with GPG