SHA256
1
0
forked from pool/ocserv
Go to file
Michael Du ecec316348 Accepting request 796111 from home:mnhauke:network
- Add signature and keyring for source verification
- Build with support for maxminddb
- Build with support for OATH
- Update to version 1.0.1
  * Prevent clients that use broken versions of gnutls from
    connecting using DTLS.
  * occtl: added machine-readable fields in json output.
  * occtl: IPs in ban list value is now reflecting the actual
    banned IPs rather than the database size.
- Update to version 1.0.0
  * Avoid crash on invalid configuration values.
  * Updated manpage generation to work with newer versions of ronn.
  * Ensure scripts have all the information on all disconnection
    types.
  * Several updates to further restrict the control that worker
    processes have on the main process.
  * Add support for RFC6750 bearer tokens. This adds the "auth=oidc"
    config option. See doc/README-oidc.md for more information.
  * Add USER_AGENT, DEVICE_TYPE and DEVICE_PLATFORM environment
    variables when connect/disconnect scripts execute.
  * Corrected issue with DTLS-PSK negotiation which prevented it
    from being enabled.
  * Improved IPv6 handling of AnyConnect client for Apple ios.
  * Fixed issue with Radius accounting.
- Update to version 0.12.6
  * Improved IPv6 support for anyconnect clients.
  * The 'split-dns' configuration directive can be used per-user.
  * The max-same-clients=1 configuration option no longer refuses
    the reconnection of an already connected user.
  * Added openat() to the accepted list of seccomp calls. This

OBS-URL: https://build.opensuse.org/request/show/796111
OBS-URL: https://build.opensuse.org/package/show/network:vpn/ocserv?expand=0&rev=30
2020-07-03 11:12:30 +00:00
.gitattributes Accepting request 285939 from home:MargueriteSu 2015-02-26 20:07:11 +00:00
.gitignore Accepting request 285939 from home:MargueriteSu 2015-02-26 20:07:11 +00:00
ca.tmpl Accepting request 285939 from home:MargueriteSu 2015-02-26 20:07:11 +00:00
ocserv-1.0.1.tar.xz Accepting request 796111 from home:mnhauke:network 2020-07-03 11:12:30 +00:00
ocserv-1.0.1.tar.xz.sig Accepting request 796111 from home:mnhauke:network 2020-07-03 11:12:30 +00:00
ocserv-enable-systemd.patch Accepting request 314133 from home:MargueriteSu 2015-06-28 05:23:02 +00:00
ocserv-LZ4_compress_default.patch Accepting request 580000 from home:MargueriteSu:branches:network:vpn 2018-02-26 02:10:00 +00:00
ocserv.changes Accepting request 796111 from home:mnhauke:network 2020-07-03 11:12:30 +00:00
ocserv.config.patch Accepting request 606481 from home:stawidy:branches:network:vpn 2018-05-13 01:22:59 +00:00
ocserv.firewalld.xml Accepting request 580402 from home:MargueriteSu:branches:network:vpn 2018-02-27 03:21:12 +00:00
ocserv.keyring Accepting request 796111 from home:mnhauke:network 2020-07-03 11:12:30 +00:00
ocserv.spec Accepting request 796111 from home:mnhauke:network 2020-07-03 11:12:30 +00:00
ocserv.sysctl Accepting request 361424 from home:MargueriteSu:branches:network:vpn 2016-02-25 14:38:11 +00:00
README.SUSE Accepting request 361424 from home:MargueriteSu:branches:network:vpn 2016-02-25 14:38:11 +00:00
server.tmpl Accepting request 285939 from home:MargueriteSu 2015-02-26 20:07:11 +00:00
user.tmpl Accepting request 285939 from home:MargueriteSu 2015-02-26 20:07:11 +00:00

## Setup AnyConnect VPN w/ ocserv

### What is Cisco Anyconnect? What is ocserv?

Cisco Anyconnect is an enterprise VPN first launched by Cisco.

The open source technology behind is OpenConnect.

It uses UDP DTLS (Datagram Transport Layer Security) to encrypt traffic 
during regular times, and uses TCP TLS for reconnect when offline.

So it's more stable then other types of VPN, and massively used by big multinational companys which make it unlikely to be overkilled. With its rare scale among individuals, it's less likely to attract blockage.

### Initialization 

After getting ocserv installed through zypper/YaST, you need to edit
/etc/ocserv/certificates/server.tmpl.

Change:

cn = "Your hostname or IP"

to the real one. You can /sbin/ifconfig -a to check yours.

#### Generate Certificates

cd /etc/ocserv/certificates
sudo certtool --generate-privkey --outfile ca-key.pem
sudo certtool --generate-self-signed --load-privkey ca-key.pem --template ca.tmpl --outfile ca-cert.pem
sudo certtool --generate-privkey --outfile server-key.pem
sudo certtool --generate-certificate --load-privkey server-key.pem --load-ca-certificate ca-cert.pem --load-ca-privkey ca-key.pem --template server.tmpl --outfile server-cert.pem

#### Generate passwd file

sudo ocpasswd -c /etc/ocserv/ocpasswd your_username_wanted

The later "your_username_wanted" is left for you.

Then log your chosen passwords twice.

#### Shutdown SUSEFirewall2 through YaST

Because I don't know how to convert iptables rules to SUSEFirewall2 ones.
If you can help me, please fork this package and submit back.

#### Set iptables rules

sudo /sbin/iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o eth0 -j MASQUERADE
sudo /sbin/iptables -A FORWARD -s 192.168.1.0/24 -j ACCEPT

The 9000/9001 ports, IP range 192.168.1.0/24 are default ones,
you can change them in /etc/ocserv/ocserv.conf

Warning: Your eth0 may not exist, you can ifconfig -a to find yours.

#### Test

sudo /sbin/ocserv -f -d 1

#### Enable systemd services

sudo systemctl enable ocserv.service
sudo systemctl start ocserv.service

### Client Cert Login

sudo certtool --generate-privkey --outfile user-key.pem
sudo certtool --generate-certificate --load-privkey user-key.pem --load-ca-certificate ca-cert.pem --load-ca-privkey ca-key.pem --template user.tmpl --outfile user-cert.pem

#### Change ocserv.conf

Change:

	#auth = "certificate"
	auth = "plain[/etc/ocserv/ocpasswd]"

To:

	auth = "certificate"
	#auth = "plain[/etc/ocserv/ocpasswd]"

And comment:

	#listen-clear-file = /var/run/ocserv-conn.socket

And uncomment:

	ca-cert = /etc/ocserv/certificates/ca-cert.pem

Restart service:

	sudo systemctl restart ocserv.service

#### Generate pk12 file for iOS

openssl pkcs12 -export -inkey user-key.pem -in user-cert.pem -certfile ca-cert.pem -out user.p12

### Client Connection

Remember to set the server address to xxx.xxx.xxx.xxx:your_port,
eg: opensuse.org:9000

#### iOS

Search "anyconnect" in App Store. 

Either type username/password manually or import the pk12 file
(You can put the later on your download server)

#### Linux

Install NetworkManager-openconnect, also plasma-nm-openconnect if you're under KDE. Support certificate login only.

You need your ca-cert.pem, user-cert.pem and user-key.pem.

#### Android

Search "AnyConnect", "SmoothConnect" or "OpenConnect" in Google Play.