Skip to main content

Security Model

UPP uses a “First-Time Approval + Pre-Shared Key” security model that balances security with ease of use.

Key Principles

  1. User Approval Required - New pilots need explicit user approval
  2. Key-Based Authentication - Known pilots authenticate with pre-shared keys
  3. Internal Network Only - Designed for local network deployment, not public internet
  4. Key Persistence - Keys are stored securely for future connections

Authentication Flow

UPP Authentication Flow: Decision tree showing pilot registration and key verification process

First-Time Connection

When a pilot connects for the first time (without a key):

1. Pilot Sends Register

2. Qaptly Shows Approval Dialog

A dialog appears in Qaptly Desktop:

3. User Decision

If User Approves:
If User Rejects:

4. Pilot Stores Key

Important: Save the assignedKey for future connections!

Subsequent Connections

For known pilots with valid keys:

1. Pilot Sends Register With Key

2. Qaptly Verifies Key

Key is verified against stored hash. No user interaction needed.

3. Automatic Approval


Pre-Shared Keys (Advanced)

For production deployments, you can pre-configure keys before the first connection.

Use Cases

  • Embedded devices: Deploy with pre-configured keys
  • CI/CD pipelines: Automated test pilots
  • Fleet management: Deploy multiple pilots at once

Implementation

1. Generate Key Manually

In Qaptly Desktop’s pilot extension config file, add:

2. Deploy Key to Pilot Device

3. Pilot Connects

The pilot will be approved automatically without user interaction.
Pre-shared keys are useful for:
  • Production environments
  • Automated testing
  • Headless deployments
  • Fleet management

Security Best Practices

1. Internal Network Only

UPP is designed for local network deployments: ✅ Correct: ws://<qaptly_desktop_ip>:18765/upp (local network IP like 192.168.1.100) ❌ Never: Expose to public internet or bind to public IP addresses Security Guidelines:
  • Deploy only on trusted internal networks
  • Use firewall rules to restrict access if needed
  • Consider VPN for remote pilot access
  • Do not port-forward 18765 to the internet

2. Key Storage

Do NOT:
  • Commit keys to version control
  • Share keys publicly
  • Use same key for multiple pilots
  • Store keys in plaintext in production
Do:
  • Use environment variables or config files
  • Set proper file permissions (chmod 600)
  • Use different keys for development/production
  • Rotate keys periodically (optional)

3. Pilot ID Uniqueness

Choose unique pilot IDs:

4. Version Information

Always include accurate version numbers:
This helps users identify outdated pilots.

Key Management

Key Generation

Qaptly generates keys using:
  • 256-bit random bytes
  • Hex encoding
  • Cryptographic random number generator

Key Storage

Keys are stored with:
  • SHA-256 hashing (not plaintext)
  • Secure file permissions
  • Backup mechanism

Key Rotation (Optional)

To rotate a key:
  1. User: Revoke the old pilot in Qaptly Desktop
  2. Pilot: Connect without key (first-time flow)
  3. User: Approve and receive new key
  4. Pilot: Save and use new key

Error Codes

Authentication Errors

Handling AUTH_FAILED


Reconnection After Disconnect

If your pilot disconnects (network issue, restart, etc.):

Within 5 Minutes

  • Reconnect with same key
  • Qaptly remembers your registration
  • No user approval needed
  • Event subscriptions are restored

After 5 Minutes

  • Pilot is unregistered
  • Must register again with key
  • Same as “Subsequent Connections” flow
  • May need user approval if key is invalid

Testing Authentication

Test 1: First-Time Connection

Expected:
  1. “Waiting for user approval…”
  2. Dialog appears in Qaptly
  3. After approval: “Received assignedKey”

Test 2: Reconnection

Expected:
  1. Immediate success
  2. No user interaction

Test 3: Invalid Key

Expected:
  1. AUTH_FAILED error
  2. Pilot should handle gracefully

Example: Complete Auth Flow


Next Steps

Protocol Reference

Complete message specifications

Capabilities

Define capabilities with JSON Schema

Quick Start

Build your first pilot

Examples

Working implementations