Enhanced security features for safely sharing Firebase emulators with team members and clients.
- ✅ Session Timeouts - Auto-expire sharing sessions (default: 1 hour)
- ✅ HTTP Basic Auth - Password protection for sensitive UIs
- ✅ Service Filtering - Only share approved services
- ✅ Secure Tokens - Generated authentication credentials
- ✅ Region Control - Specify ngrok regions
- ✅ Session Management - Proper cleanup and monitoring
- ✅ Security Warnings - Clear alerts about exposure risks
# 1. Install prerequisites
brew install ngrok jq
# 2. Install both basic and secure aliases
cd /path/to/firebase-devops-toolkit
./install-global-alias.sh
source ~/.zshrc# Start with password protection and 30min timeout
secure-share-emulators start --timeout 1800
# Output:
🔒 Security Settings:
🕐 Session expires: 2024-01-15T15:30:00Z
🔐 Auth required: true
🔑 Auth credentials: demo:a1b2c3d4e5f6...
📱 Secure Public URLs:
🎛️ Emulator UI: https://abc123.ngrok.io (password protected)
🌐 Frontend: https://def456.ngrok.io (password protected)# Limited services, longer timeout, with auth
secure-share-emulators start --timeout 7200 --services ui,frontend# No auth for trusted team, short timeout
secure-share-emulators start --no-auth --timeout 900 --services ui,functions,frontend# Basic sharing (not recommended for production data)
share-emulators startsecure-share-emulators start [options] # Start secure sharing
secure-share-emulators stop # Stop sharing
secure-share-emulators status # Check status + security info
secure-share-emulators urls # Show URLs + credentials
secure-share-emulators restart [options] # Restart with new settings--timeout SECONDS- Session timeout (default: 3600 = 1 hour)--no-auth- Disable password protection--services LIST- Comma-separated services (ui,functions,frontend,firestore,auth,hosting)
| Use Case | Command | Security Level |
|---|---|---|
| Client Demo | --timeout 1800 --services ui,frontend |
High |
| Team Testing | --timeout 3600 --services ui,functions,frontend |
Medium |
| Internal Dev | --no-auth --timeout 900 |
Low |
| Quick Test | --timeout 300 --services ui |
High |
- ✅ Use password protection for client demos
- ✅ Set short timeouts (15-30 minutes)
- ✅ Limit services to only what's needed
- ✅ Stop sharing immediately after demos
- ✅ Monitor active sessions with
status - ✅ Use secure networks when sharing
- ❌ Share URLs in public channels
- ❌ Leave sessions running overnight
- ❌ Use
--no-authwith production data - ❌ Share all services unless necessary
- ❌ Forget to check session expiry
secure-share-emulators status✅ Secure emulator sharing is active (2 tunnels)
🔒 Security Settings:
🕐 Session expires: 2024-01-15T15:30:00Z
🔐 Auth required: true
📋 Allowed services: ui,frontend
🔑 Auth credentials: demo:a1b2c3d4e5f6...
📱 Secure Public URLs:
🎛️ Emulator UI: https://abc123.ngrok.io
🌐 Frontend: https://def456.ngrok.io
⚠️ SECURITY WARNING:
• These URLs expose your local emulators publicly
• Only share with trusted developers
• Stop sharing when demo/testing is complete
• Sessions auto-expire for security
The system provides multiple security warnings:
- Session Expiry: Automatic timeout enforcement
- Public Exposure: Clear warnings about internet accessibility
- Service Filtering: Only approved services are exposed
- Auth Requirements: Password protection for sensitive UIs
When auth is enabled:
- Username:
demo - Password: Auto-generated secure token
- Browser Prompt: Standard HTTP Basic Auth dialog
- Credential Display: Shown in terminal for easy sharing
firebase-devops-toolkit/
├── .emulator-sharing/
│ ├── security_config.json # Session settings
│ ├── auth_tokens.txt # Current auth token
│ ├── ngrok_pids.txt # Process IDs
│ ├── ngrok_urls.txt # Extracted URLs
│ └── ngrok_*.log # Individual service logs
- Auto-Expiry: Sessions automatically stop when timeout reached
- Manual Stop: Use
stopcommand anytime - Restart: Use
restartto change settings - Status Check: Monitor active sessions and remaining time
- ngrok Regions: Uses 'us' region by default
- HTTPS Only: All tunnels use encrypted connections
- Temporary URLs: ngrok URLs are temporary and rotate
- No Persistence: No permanent exposure of local services
This secure sharing system balances accessibility with safety, perfect for client demos and team collaboration!