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.3.tar.gz (351.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.3-cp37-abi3-win_amd64.whl (7.6 MB view details)

Uploaded CPython 3.7+Windows x86-64

keeper_pam_webrtc_rs-1.0.3-cp37-abi3-musllinux_1_2_x86_64.whl (7.7 MB view details)

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

keeper_pam_webrtc_rs-1.0.3-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.7 MB view details)

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

keeper_pam_webrtc_rs-1.0.3-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (8.7 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.17+ ARM64

keeper_pam_webrtc_rs-1.0.3-cp37-abi3-macosx_11_0_arm64.whl (7.8 MB view details)

Uploaded CPython 3.7+macOS 11.0+ ARM64

keeper_pam_webrtc_rs-1.0.3-cp37-abi3-macosx_10_12_x86_64.whl (8.2 MB view details)

Uploaded CPython 3.7+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: keeper_pam_webrtc_rs-1.0.3.tar.gz
  • Upload date:
  • Size: 351.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.3.tar.gz
Algorithm Hash digest
SHA256 a0a2e602b6218fbd901fb361306d6e61b5e25ec9e1ab53065c14f421176b75f0
MD5 8ae5b34c4e41cf10bf8d17387b999d0c
BLAKE2b-256 02a259cbb2b17f5e7d47629ddc31c052057efec3487ed53f8ac4143998f84337

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for keeper_pam_webrtc_rs-1.0.3-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 30a9efc24bccbee8492c3c29d46de0647a572bddb04ed0b0a33c99a8af666252
MD5 8d26d711ad404142d1b11cd47a2a00c6
BLAKE2b-256 ef605793b971c0b56b9399285f9d2b29931edc5fa24a12da087a1dc1efca1723

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for keeper_pam_webrtc_rs-1.0.3-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 9903abd9cb14d6f541ba2e83db789e91ed9affc23d4ed6bed112293f7a9f0983
MD5 2cb90b93ec3896a2b3b0cf5996294f9d
BLAKE2b-256 69cc9be6010e88e69339470d0540b57ad6ce72d971e6875ade805d0260b9f2cc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for keeper_pam_webrtc_rs-1.0.3-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 72e17d79e741d88cdf76b9733b32647361d6b6a99e39eb9c3aeba1e8996b7262
MD5 fc8e615f7ea272dacf5f123a61114d5b
BLAKE2b-256 def90c159d785a4d2ebb5a2e55901db5e3fa1dea4210116d9f07b3617d5013d2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for keeper_pam_webrtc_rs-1.0.3-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 fa9f0caaec8ed760fda01f939fadda77a1766bb21c5c931f6594a0a3403cfc02
MD5 525162a2717eaeb1b262c14fbe438692
BLAKE2b-256 d5950d53e014e96d3c33538602966b1e2c32b9a8ce8012fc9c257db01a546562

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for keeper_pam_webrtc_rs-1.0.3-cp37-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 da01e9755f214451f406bc8773f2d0f9e5ce411aa89db0c8d5b756dec10166f0
MD5 7252886fbb39f3977f8b4b1145f298f3
BLAKE2b-256 7c831915acc1c1e9e88f4c8596e5e250357559408aaa1d04ad8b9f4394eeebdb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for keeper_pam_webrtc_rs-1.0.3-cp37-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 27c6a4391dec4d2f7ace0c780ae0bfb682e503293c60ef4a26934ad5857c87ba
MD5 44f25e6a171a0256b086b0081b845b07
BLAKE2b-256 1501f421e40682ba5b14b9757dd8c35d6d1627a711ece68de7283a795a5fe40b

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