Skip to main content

OpenVPN Control Panel for Restricted Network.

Project description

OpenVPN Control Panel for Restricted Network

Tests CodeQL Advanced Package

Installation

In order to run along with OpenVPN server, the ROOT privilege is required.

sudo pipx install ovpncp

OpenVPN Server Setup

Make sure the client-to-client directive is disabled:

;client-to-client

Enable CCD & make it exclusive:

client-config-dir /etc/openvpn/ccd
ccd_exclusive

Enable the scripts of client connection:

client-connect /opt/ovpncp/scripts/client-connect.sh
client-disconnect /opt/ovpncp/scripts/client-disconnect.sh

Restart the server:

sudo systemctl restart openvpn

Start the application:

sudo -i ovpncp

Basic Usage

Init server by calling API with cURL:

curl -X POST http://127.0.0.1:8000/server

Check the health of OpenVPN server:

curl -X GET http://127.0.0.1:8000/server/health

Setup Client

Create the client:

curl -X POST http://127.0.0.1:8000/clients \ 
    -d '{"name": "client_1"}'

Create the gateway client for private network:

curl -X POST http://127.0.0.1:8000/clients \ 
--data-binary @- << EOF 
{
    "name": "gateway_1", 
    "cidr": "192.168.1.0/24"
}
EOF

Package the client certificate:

curl -X PUT http://127.0.0.1:8000/clients/client_1/package-cert

Download the archive:

curl -X GET http://127.0.0.1:8000/clients/client_1/download-cert

Assign IP to the client:

curl -X PUT http://127.0.0.1:8000/clients/client_1/assign-ip \ 
    -d '{"ip": "10.8.0.2"}'

Unassign IP from the client:

curl -X DELETE http://127.0.0.1:8000/clients/client_1/unassign-ip

Setup Restricted Network

IMPORTANT: make sure drop all forwarding on tun0 by default:

sudo iptables -A FORWARD -i tun0 -j DROP

Create the network:

curl -X POST http://127.0.0.1:8000/networks \ 
--data-binary @- << EOF 
{
    "source_client_name": "client_1", 
    "destination_client_name": "edge_device_1",
}
EOF

Create the network with a gateway with private network behind it:

curl -X POST http://127.0.0.1:8000/networks \ 
--data-binary @- << EOF 
{
    "source_name": "client_1", 
    "destination_name": "gateway_1", 
    "private_network_addresses": "192.168.1.1,192.168.1.2,192.168.1.3"
}
EOF

Drop the network:

curl -X DELETE http://127.0.0.1:8000/networks/1

Project details


Download files

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

Source Distribution

ovpncp-0.1.2.tar.gz (25.1 kB view details)

Uploaded Source

Built Distribution

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

ovpncp-0.1.2-py3-none-any.whl (20.7 kB view details)

Uploaded Python 3

File details

Details for the file ovpncp-0.1.2.tar.gz.

File metadata

  • Download URL: ovpncp-0.1.2.tar.gz
  • Upload date:
  • Size: 25.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for ovpncp-0.1.2.tar.gz
Algorithm Hash digest
SHA256 6438fdab47f37471a22f24dc11f826a7f90e9f16081f43ee876caebd8f7d69a0
MD5 55ad803d83016a6df13564e96093f21e
BLAKE2b-256 3e876ba3515e8af6b0c44f786122afb7e5c0fcc3393401a721a862d39403d018

See more details on using hashes here.

Provenance

The following attestation bundles were made for ovpncp-0.1.2.tar.gz:

Publisher: package.yml on scia-iot/ovpncp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ovpncp-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: ovpncp-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 20.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for ovpncp-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 eb6d3333dc7aa130e7fb6416854396062634a336760a9409b57868c8f36aa82f
MD5 0a69517d51232923ac2482c37786cd41
BLAKE2b-256 203aed4a99da436d482131643e309116b1edf36e403274a48ee226fea0b06f59

See more details on using hashes here.

Provenance

The following attestation bundles were made for ovpncp-0.1.2-py3-none-any.whl:

Publisher: package.yml on scia-iot/ovpncp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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