Giter Club home page Giter Club logo

docker-openconnect-proxy's Introduction

docker-openconnect-proxy

A docker container for using an openconnect VPN via an proxy

Usage

  1. Create a config file ~/.openconnect/config and chmod 600 ~/.openconnect/config
# Example Configuration

server=vpn.example.com/examplegroup
user=<YOUR USERNAME>

# As openconnect does not support passing a password via config the password needs to be in a comment ("#password"):
#password=<YOUR PASSCODE>

token-mode=totp
token-secret=base32:<YOUR TOTP SECRET>
  1. Then fire up the container by docker compose up and enjoy your proxy server under localhost:58443

  2. Use the proxy

http_proxy=http://localhost:58443 curl http://example.com

# OR

ssh -o ProxyCommand="nc -x localhost:58443 %h %p" [email protected]

# OR

google-chrome-beta --proxy-server="socks5://127.0.0.1:58443"

Warning & Alternative Credential Mechanisms

Be AWARE of the security risk of storing clear passwords. An alternative is passing credentials via the environment through docker, read from a passwordmanager like pass in an external wrapper script.

The password and secret can be passed via the Environment Variables OPENCONNECTPROXY_PASSCODE and OPENCONNECTPROXY_TOKEN_SECRET to docker compose up

Passing cert files can easily be done by adding to the volumes definition in docker-compose.yml

startVPNBrowser.sh

This wrapper script starts a google-chrome-beta together with the docker container and on close terminates both. I personally use google-chrome-beta to avoid clashing with my running google-chrome-stable...

This is clearly more to be seen as an Example than a way to use it for everyone.

Inspiration

Inspiration for this came from https://github.com/makinacorpus/docker-fortivpn

License

MIT

docker-openconnect-proxy's People

Contributors

mychaos87 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.