An open API service indexing awesome lists of open source software.

https://github.com/dmarby/duo-openvpn-standalone

Standalone authentication plugin for openvpn using duo
https://github.com/dmarby/duo-openvpn-standalone

Last synced: 3 months ago
JSON representation

Standalone authentication plugin for openvpn using duo

Awesome Lists containing this project

README

        

# duo-openvpn-standalone
Standalone authentication plugin for openvpn using duo.
This plugin provides the ability to authenticate openvpn users via username/password + duo, without any other external dependencies.

## Installation
Compile the plugin by running `make`. You'll need to have [dep](https://github.com/golang/dep) installed.
Add the plugin to your openvpn server configuration:
```
plugin /path/to/duo-openvpn-standalone.so
```
By default the plugin will look for the configuration in `/etc/duo-openvpn-standalone.yml`.
If you want to explicitly set a config path, define it after the path to the .so:
```
plugin /path/to/duo-openvpn-standalone.so /path/to/config.yml
```

### Using with daemon mode
If you want to use the plugin when running openvpn in daemon mode, you need to use the intermediary c++ shared library as well.

In order to build it, run `make intermediary`.

This will create a file named `intermediary.so` in the `intermediary` directory.
To use it, add the following to your openvpn server configuration:
```
plugin /path/to/intermediary.so /path/to/duo-openvpn-standalone.so
```
To pass on the config path, simply add it to the end:
```
plugin /path/to/intermediary.so /path/to/duo-openvpn-standalone.so /path/to/config.yml
```

### Configuration
In order to create the configuration, use the CLI tool:
```
./duo-openvpn-standalone config
```

If you want to provide an explicit configuration path, do so by adding the `"-c"` flag.
```
./duo-openvpn-standalone -c /path/to/config.yml config
```

To list users:
```
./duo-openvpn-standalone users list
```

To add a user:
```
./duo-openvpn-standalone users add
```

To remove a user:
```
./duo-openpn-standalone users remove
```

## Development
Compile the plugin by running `make`.
Create a configuration file in `docker/duo-openvpn-standalone.yml`, using the CLI tool:
```
./duo-openvpn-standalone -c docker/duo-openvpn-standalone.yml
```
Add a user to test with:
```
./duo-openvpn-standalone -c docker/duo-openvpn-standalone.yml users add
```
Spin up a local docker container with the plugin loaded:
```
make docker
```
You can connect to it by importing the `docker/client.ovpn` file into your OpenVPN client of choice.

## License
See [LICENSE](LICENSE)