Skip to main content

Tools to manage VPN connections, profiles, and keys for UVA Anywhere VPN and other compatible providers.

Project description

Cloudmesh AI VPN Extension

Authors:

This extension provides tools to manage VPN connections, profiles, and keys, specifically tailored for UVA Anywhere VPN and other compatible providers. It focuses on a "zero-config" experience and high visibility into the connection state.

Installation

๐ŸŽ macOS

Recommended: Using pipx For the best experience with CLI tools, use pipx to install cloudmesh-ai-vpn in an isolated environment.

pipx install cloudmesh-ai-vpn

To install from a local directory: pipx install .

Using pip

pip install cloudmesh-ai-vpn

To install from a local directory: pip install .

Dependencies: Ensure openconnect and vpn-slice are installed via Homebrew:

brew install openconnect vpn-slice

๐Ÿง Linux

Recommended: Using pipx

pipx install cloudmesh-ai-vpn

To install from a local directory: pipx install .

Using pip

pip install cloudmesh-ai-vpn

Dependencies: Install openconnect and vpn-slice using your package manager (e.g., apt or dnf).

๐ŸชŸ Windows

Using pip

pip install cloudmesh-ai-vpn

โš ๏ธ Important Warning: The author does not have access to a Windows machine. Consequently, Windows support has not been tested and is not guaranteed to work. If you encounter issues, please report them in the issue tracker.

Dependencies & Chocolatey: This extension can attempt to manage Windows dependencies using Chocolatey. You can use the --choco flag when connecting to trigger dependency checks and installation:

cme vpn connect --choco

If you prefer manual installation, ensure you have a compatible OpenConnect client installed on your system.

Usage Examples

Connection Management

1. Connect to the default VPN service

cme vpn connect
Password: โ”€โ”€โ”€โ”€โ”€โ”€โ”€
โ ผ Checking dependencies...
โ ด Warming up sudo...
โ ‡ Launching OpenConnect...
โœ“ Connected to uva

2. Connect with a specific service and provider

cme vpn connect --service uva-hpc --provider openconnect-keychain
โ ผ Checking dependencies...
โ ด Warming up sudo...
โ ‡ Launching OpenConnect (Keychain)...
โœ“ Connected to uva-hpc

3. Disconnect from the VPN

cme vpn disconnect
โ„น Disconnecting OpenConnect...
โœ“ Successfully disconnected from VPN.

Status and Information

4. Check if the VPN is connected

cme vpn status
True

5. Get current location and connection info

cme vpn info
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    IP Information                        โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Field              โ”‚ Value                               โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ ip                 โ”‚ 128.118.x.x                         โ”‚
โ”‚ city               โ”‚ Charlottesville                     โ”‚
โ”‚ region             โ”‚ Virginia                            โ”‚
โ”‚ country            โ”‚ United States                       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Configuration and Maintenance

6. Reset VPN credentials

cme vpn reset --service uva
โœ“ Successfully reset routes for uva

7. Manage VPN profiles

cme vpn profile list
Default: {'service': 'uva'}
Work-Remote: {'service': 'uva-remote'}

8. Manage Keychain passphrases

cme vpn keychain
โ„น Searching Keychain for service: uva-key-pass...
โœ“ Passphrase securely retrieved from macOS Keychain.

9. Monitor connection

cme vpn watch 10

(See Appendix for detailed vpn watch output)

Command Reference

Command Description Options
connect / + Connects to the VPN. --service, --timeout, --provider, --profile, --nosplit
disconnect / - Disconnects from the VPN. -v (debug)
status Returns True if connected, False otherwise. -v (debug)
info Prints location and IP information. -v (debug)
reset Clears credentials/routes for the service. --service
watch Monitors the connection at an interval. [INTERVAL], --count
keychain Manages passphrases in macOS Keychain. [remove], --service
profile Manages user-specific connection profiles. [add|remove|list], --name, --service

Appendix: Advanced Functionality

๐Ÿš€ Granular Progress Reporting

The extension now features a rich CLI interface that provides real-time feedback during the connection process. Instead of a hanging terminal, you will see a dynamic spinner and status updates:

  • Dependency Checks: Verifies openconnect and vpn-slice are installed.
  • Sudo Warm-up: Handles system authentication before the UI starts to prevent prompt interference.
  • Provider-Specific Logs: Clearly indicates which authentication method (Keychain, Password, or Decrypted Cert) is being used.

๐Ÿ›  macOS Provider Guide

Depending on your security preference and available files, you can choose from several providers via the --provider flag:

Provider Use Case Requirement
openconnect-decrypted Fastest, no passphrase prompt. Decrypted .pem file in ~/.ssh/uva/
openconnect-keychain Secure and seamless. Passphrase stored in macOS Keychain
openconnect-pw Standard authentication. Username and Password
mac-cisco Legacy support. Cisco AnyConnect Client installed

๐Ÿ” Connection Monitoring (vpn watch)

The vpn watch command provides a high-fidelity view of your tunnel's health. Unlike simple status checks, it performs a multi-layered verification:

  1. Process Check: Verifies that openconnect and vpn-slice processes are active.
  2. Route Verification: Executes netstat -rn to confirm that the specific IP ranges for your organization are actually present in the system routing table.
  3. Dynamic Feedback: Updates in real-time, allowing you to see exactly when a tunnel drops or a route is removed.

Example Output:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ VPN Watch | Iteration: 1 | Service: uva                      โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Category           โ”‚ Status                                  โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Process            โ”‚ 'vpn-slice' is running (PIDs: 1234)      โ”‚
โ”‚ Process            โ”‚ 'openconnect' is running (PIDs: 5678)    โ”‚
โ”‚ OpenConnect        โ”‚ Routes configured: 128.143.0.0/16        โ”‚
โ”‚ Routing Table      โ”‚ Route to 128.143.0.0/16 found (netstat)  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐ŸŒ Split-Tunneling with vpn-slice

By default, this extension implements Split-Tunneling using vpn-slice. This is critical for maintaining performance and accessibility.

  • Split-Tunnel (Default): Only traffic destined for the VPN's specific IP ranges (e.g., UVA internal networks) is routed through the tunnel. Your general internet traffic (web browsing, streaming, etc.) continues to use your local gateway.
  • Full-Tunnel (--nosplit): All system traffic is routed through the VPN. This is useful for high-security environments but will significantly increase latency for non-VPN traffic and may break local network access.
  • How it works: The extension identifies the required IP ranges from the organization config and instructs vpn-slice to create precise routing entries in your OS.

๐Ÿ“‚ Zero-Config File Structure

For the openconnect-decrypted and openconnect-keychain providers to work without extra flags, place your certificates in the following default location:

~/.ssh/uva/
โ”œโ”€โ”€ user.crt          # Public Certificate
โ”œโ”€โ”€ user.key          # Private Key
โ””โ”€โ”€ decrypted_user.pem # Decrypted PEM (for decrypted provider)

๐ŸŽ“ UVA Custom Configuration

If you are a UVA user and need to override the default organization settings, you can use a custom YAML configuration file.

Customizing your Identity: To ensure the VPN connects with your specific credentials, locate the organizations.yaml file (or your custom override) and update the username field:

cloudmesh:
  vpn:
    uva:
      username: "your_computing_id"  # <--- Change this to your UVA Computing ID
      auth: cert
      name: UVA Anywhere
      host: uva-anywhere-1.itc.virginia.edu
      user: false
      2fa: false
      group: false
      keychain: true
      cert:
        - ~/.ssh/uva/user.pem
      ip: 
        - rivanna.hpc.virginia.edu 
        - 128.143.0.0/16 
        - 137.54.0.0/16
        - 199.111.0.0/16
        - 199.111.160.0/19
        - 199.111.192.0/18
      domain: virginia.edu
      connection_check:
        - University of Virginia
        - UVA

By updating this value, the extension will automatically use your identity across all connection attempts without requiring manual flags.

Project details


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 Distribution

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

cloudmesh_ai_vpn-7.1.3-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file cloudmesh_ai_vpn-7.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for cloudmesh_ai_vpn-7.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1cc8cbb791a5f698e8bdd1c637dd1f9ca29a95742c69dfdc63eb93ab8090d778
MD5 c8202f9c5c653885f825da7d5f89f8fd
BLAKE2b-256 9e7c03ac89c659a10f02a59fa5258b09595dfca0740f99b5898e6d9b6f2bd062

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