Skip to main content

No project description provided

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
  • 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
  • new_connection(tube_id, connection_id, settings) - Add connection to existing tube
  • create_channel(connection_id, tube_id, settings) - Create channel on tube
  • close_connection(tube_id, 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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

keeper_pam_webrtc_rs-0.2.3-cp37-abi3-win_amd64.whl (7.0 MB view details)

Uploaded CPython 3.7+Windows x86-64

keeper_pam_webrtc_rs-0.2.3-cp37-abi3-musllinux_1_2_x86_64.whl (8.3 MB view details)

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

keeper_pam_webrtc_rs-0.2.3-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.3 MB view details)

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

keeper_pam_webrtc_rs-0.2.3-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (8.2 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.17+ ARM64

keeper_pam_webrtc_rs-0.2.3-cp37-abi3-macosx_11_0_arm64.whl (7.4 MB view details)

Uploaded CPython 3.7+macOS 11.0+ ARM64

keeper_pam_webrtc_rs-0.2.3-cp37-abi3-macosx_10_7_x86_64.whl (7.7 MB view details)

Uploaded CPython 3.7+macOS 10.7+ x86-64

File details

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

File metadata

File hashes

Hashes for keeper_pam_webrtc_rs-0.2.3-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 40efe1fc911eeb38bd767de88c55add5091065d8e4ed36fc8eacd6d6972b6a06
MD5 fec87dc323fd7cc62b2f9fe9302ef745
BLAKE2b-256 ec62a08332a8e551437715a2bf728bf221752903e817a1deef3126b81c6c19ff

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for keeper_pam_webrtc_rs-0.2.3-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 e45a9c77696248aaac189e541f0ea317969d7b4378ba3d2cc9ad1d390efd03e7
MD5 7d44d476c973d3a17e5bad91fbec1f3f
BLAKE2b-256 8ad042bb781fb4f584af6222d0f3a990095a921a04ca4faf749951dba6e4e6d9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for keeper_pam_webrtc_rs-0.2.3-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2b94a2848e09305b722fed8dbb9f54150ac5aa491c1406312e7daff620dcc76d
MD5 310e1fad60a25099a5e7d9207c586767
BLAKE2b-256 bc4dc6fd4bc9466bc79fc984da44717cf8de91a45d4636b713500cc9727d8cfe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for keeper_pam_webrtc_rs-0.2.3-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 1c497d45d9343ef6d0fd56378b1de25a529bd621611ba8ebd9e5f31783b57757
MD5 eb18304307e9da1ada180228ffcb845b
BLAKE2b-256 11490b1b0853cd3395c9bbb41a76bfbf5beeaced798c6cb7dfe144be71d24d1b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for keeper_pam_webrtc_rs-0.2.3-cp37-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d4d98be829270a7e8d8e7dcdb50e1f6b866a418706842428d77433235a9b896d
MD5 826083e7b0d8d8ae9a7d0d8026541a9c
BLAKE2b-256 3f9c00c0a384e3d20e59b92f65f3fd5f5426e410d4285fadfb451cf5af49ec0f

See more details on using hashes here.

File details

Details for the file keeper_pam_webrtc_rs-0.2.3-cp37-abi3-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for keeper_pam_webrtc_rs-0.2.3-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 dabb00bea7de05ee56ea2d8bf517ef5ff6ccd239455f05c6221d9b2ca6d3ed67
MD5 c113d6e3cc8d14b905ef9530d288c3a4
BLAKE2b-256 2d3f95ff676d33f3a1767ccce346cc7cb34654835c3759ac4a500c4d2a8d235a

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