Skip to main content

Keeper PAM WebRTC for Python - A secure, stable, and high-performance Tube API for Python, providing WebRTC-based secure tunneling with enterprise-grade security and reliability optimizations.

Project description

Keeper PAM WebRTC for Python

A secure, stable, and high-performance Tube API for Python, providing WebRTC-based secure tunneling with enterprise-grade security and reliability optimizations.

Core Values

Security • Stability • Performance - Built for Keeper Security's mission-critical applications:

  • 🔒 Security First: Memory-safe Rust implementation with comprehensive bounds checking
  • 🛡️ Enterprise Stability: Lock-free architecture eliminates race conditions and deadlocks
  • ⚡ Optimized Performance: Advanced optimizations deliver exceptional speed when you need it
  • 🔧 Production Ready: Zero-configuration reliability for demanding security applications

Description

keeper-pam-webrtc-rs provides Python bindings to a Rust-based Tube API for secure communication, designed for:

  • Secure tunneling via WebRTC data channels with memory-safe operations
  • Multi-connection management through tube abstractions
  • Reliable peer connection handling with comprehensive error handling
  • Efficient channel management for different communication patterns
  • Cross-platform compatibility (Linux, macOS, Windows, Alpine)
  • Mission-critical reliability for security-focused applications

This package is designed to be used with Keeper Gateway and Keeper Commander. It provides a secure, reliable tube-based communication system built on WebRTC, specifically tailored for Keeper Security's internal products and security-critical tunneling use cases.

Note: This package is intended for internal Keeper Security products and is not being actively advertised for general use.

Installation

pip install keeper-pam-webrtc-rs

Usage

import keeper_pam_webrtc_rs

# Create a tube registry
registry = keeper_pam_webrtc_rs.PyTubeRegistry()

# Define a signal callback for WebRTC events
def on_signal(signal_dict):
    print(f"Received signal: {signal_dict}")
    # Handle ICE candidates, connection state changes, etc.

# Create a server-side tube for tunneling
server_result = registry.create_tube(
    conversation_id="tunnel-session-123",
    settings={
        "conversationType": "tunnel",
        "target_host": "127.0.0.1", 
        "target_port": "22"  # SSH tunnel example
    },
    trickle_ice=True,
    callback_token="server-token",
    ksm_config="server-config",
    signal_callback=on_signal
)

# Get the offer SDP to send to the client
server_offer = server_result['offer']
server_tube_id = server_result['tube_id']

# Create a client-side tube with the offer
client_result = registry.create_tube(
    conversation_id="tunnel-client-123", 
    settings={
        "conversationType": "tunnel",
        "target_host": "192.168.1.100",
        "target_port": "22"
    },
    trickle_ice=True,
    callback_token="client-token", 
    ksm_config="client-config",
    offer=server_offer,  # Use server's offer
    signal_callback=on_signal
)

# Get the answer SDP to send back to server
client_answer = client_result['answer']
client_tube_id = client_result['tube_id']

# Set the remote description on the server
registry.set_remote_description(server_tube_id, client_answer, is_answer=True)

# Check connection state
state = registry.get_connection_state(server_tube_id)
print(f"Connection state: {state}")

# Close when done
registry.close_tube(server_tube_id)
registry.close_tube(client_tube_id)

Features

  • 🔒 Memory Safety: Rust-powered implementation prevents buffer overflows and memory corruption
  • 🛡️ Reliable Architecture: Lock-free design eliminates race conditions and ensures stability
  • ⚡ Efficient Performance: Optimized for speed without compromising security or stability
  • 🌊 Tube Abstraction: High-level API for managing WebRTC-based secure tunnels
  • 🌍 Cross-Platform: Secure, consistent behavior across Linux, macOS, Windows, Alpine
  • 🐍 Python Integration: Built with abi3 for maximum compatibility (Python 3.7+)
  • 🔧 Production Hardened: Comprehensive error handling and graceful degradation

Tube API Architecture

This implementation provides a Tube-based abstraction over WebRTC:

Security Features

  • Memory-Safe Operations: Rust's ownership system prevents common security vulnerabilities
  • Bounds Checking: Comprehensive validation prevents buffer overflows and data corruption
  • Zero Unsafe Code: Hot paths use only verified, safe Rust code (except vetted SIMD intrinsics)
  • Graceful Error Handling: Robust error recovery prevents crashes and data leaks

Tube Management

  • Multi-Connection Support: Each tube can manage multiple WebRTC connections
  • Channel Abstraction: High-level channel management for different protocols
  • State Management: Comprehensive connection state tracking and reporting
  • Signal Handling: Event-driven architecture for ICE candidates and state changes

Performance Features

  • SIMD Optimization: Hardware-accelerated frame parsing with safe fallbacks
  • Zero-Copy Pipelines: Efficient data handling minimizes memory overhead
  • Event-Driven Design: Native WebRTC events provide responsive communication
  • Always Optimized: Maximum efficiency by default, no configuration required

Tube API Reference

Core Methods

  • create_tube(conversation_id, settings, ...) - Create a new secure tube or add conversation to existing tube
  • set_remote_description(tube_id, sdp, is_answer) - Set remote SDP description
  • add_ice_candidate(tube_id, candidate) - Add ICE candidate for connection
  • get_connection_state(tube_id) - Get current connection state
  • close_connection(connection_id) - Close specific connection
  • close_tube(tube_id) - Close entire tube

Conversation Types

The tube API supports different communication patterns:

  • tunnel - Secure TCP tunneling through WebRTC
  • guacd - Apache Guacamole protocol tunneling
  • socks5 - SOCKS5 proxy tunneling

Build & Verification

To build and verify the implementation:

# Standard build (all optimizations enabled)
cargo build --release

# Run comprehensive test suite
cargo test --release

# Optional: Enable debug logging for troubleshooting
cargo build --release --features production_debug

Why This Implementation?

Built specifically for Keeper Security's tunneling requirements:

  • Security-First Design: Memory safety and comprehensive validation prevent vulnerabilities
  • Mission-Critical Reliability: Lock-free architecture ensures stable operation under load
  • Optimized for Security Applications: Performance optimizations that don't compromise security
  • Tube Abstraction: High-level API designed specifically for secure tunneling use cases

The secure, stable, high-performance tube communication system for enterprise security applications.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

keeper_pam_webrtc_rs-1.0.0.tar.gz (340.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

keeper_pam_webrtc_rs-1.0.0-cp37-abi3-win_amd64.whl (7.4 MB view details)

Uploaded CPython 3.7+Windows x86-64

keeper_pam_webrtc_rs-1.0.0-cp37-abi3-musllinux_1_2_x86_64.whl (7.5 MB view details)

Uploaded CPython 3.7+musllinux: musl 1.2+ x86-64

keeper_pam_webrtc_rs-1.0.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.6 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.17+ x86-64

keeper_pam_webrtc_rs-1.0.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (8.5 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.17+ ARM64

keeper_pam_webrtc_rs-1.0.0-cp37-abi3-macosx_11_0_arm64.whl (7.6 MB view details)

Uploaded CPython 3.7+macOS 11.0+ ARM64

keeper_pam_webrtc_rs-1.0.0-cp37-abi3-macosx_10_12_x86_64.whl (8.0 MB view details)

Uploaded CPython 3.7+macOS 10.12+ x86-64

File details

Details for the file keeper_pam_webrtc_rs-1.0.0.tar.gz.

File metadata

  • Download URL: keeper_pam_webrtc_rs-1.0.0.tar.gz
  • Upload date:
  • Size: 340.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.3

File hashes

Hashes for keeper_pam_webrtc_rs-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b7b2f8ca4a93c80da421a09796ab32bc5fc52ebb5f7003a0257fe9d5426e2e0f
MD5 5e806acfb25615000cea3da3040ae0f5
BLAKE2b-256 f56e21fb44759eb8133ae47c734165860df37aa68ab133e9a0b7cad25192ba3e

See more details on using hashes here.

File details

Details for the file keeper_pam_webrtc_rs-1.0.0-cp37-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for keeper_pam_webrtc_rs-1.0.0-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 3fa4825d842ccaa18220bf4932b1f17d44e8ac51fc895b9332e5ad0c89f1087c
MD5 e248094a866bdd42176b66a6c23ecc98
BLAKE2b-256 4294be2941467266e2344a24c47717cd2c89cee25e988ff2f8672b0cc3f78577

See more details on using hashes here.

File details

Details for the file keeper_pam_webrtc_rs-1.0.0-cp37-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for keeper_pam_webrtc_rs-1.0.0-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 48b5dd3d586a61783ed8895ee0ea4acbabf9c5d2da04797070a8211fea86d061
MD5 81f9f57ebb428174d59dfb7efc6193c8
BLAKE2b-256 7e307f0a4184fcf04fa0c12d1e0c7bc8133f740814688ecc7b985f8cb8550ac0

See more details on using hashes here.

File details

Details for the file keeper_pam_webrtc_rs-1.0.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for keeper_pam_webrtc_rs-1.0.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 00f4103cb81a253c3782eface444b25dbeb699965550b59607430870a88e4c1e
MD5 2caab0729f4c4cf0829e9242506b2819
BLAKE2b-256 8ee1afc2473c3b7f5dd50d308c12ae3afaccdb71aba6ac43dbfe2e080642f83a

See more details on using hashes here.

File details

Details for the file keeper_pam_webrtc_rs-1.0.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for keeper_pam_webrtc_rs-1.0.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 8efa472585dfae40aa54886c6eab2ef14e63a6351b4defd7f91a7a0e631522bc
MD5 8198e7ad0bcea9843b2b054ca07f9731
BLAKE2b-256 e7f92324176bf3f49051b342886acca3c284953796063f112108b0bd0669cf2c

See more details on using hashes here.

File details

Details for the file keeper_pam_webrtc_rs-1.0.0-cp37-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for keeper_pam_webrtc_rs-1.0.0-cp37-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6a56bcab6810b8beb5c2d01ebdd5c97e55ab802ac29e5cca8a3aba439e73bf7a
MD5 b04541fa9effb3509c2fe026ddb5729d
BLAKE2b-256 7fcc6275b782924c2b9b794b17d23ef9635488858af63a0e94b509264b8ac76f

See more details on using hashes here.

File details

Details for the file keeper_pam_webrtc_rs-1.0.0-cp37-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for keeper_pam_webrtc_rs-1.0.0-cp37-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 014a35c40cbd031bd54642098ebbb1721ed9a0c27e612dfbe789b66d067cdf7b
MD5 c479a456af6bf6a384c676d685f5f961
BLAKE2b-256 2660e799bd61dd672bf3e4fe16eee4fca3ee2f3e4ad315c0bf2de6ec7e956909

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page