diff --git a/README.md b/README.md index 5ef2db87c..2446b0540 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,7 @@ security/clamav -- Antivirus engine for detecting malicious threats security/intrusion-detection-content-et-pro -- IDS Proofpoint ET Pro ruleset (needs a valid subscription) security/intrusion-detection-content-pt-open -- IDS PT Research ruleset (only for non-commercial use) security/intrusion-detection-content-snort-vrt -- IDS Snort VRT ruleset (needs registration or subscription) +security/openconnect -- OpenConnect Client security/tinc -- Tinc VPN security/tor -- The Onion Router sysutils/boot-delay -- Apply a persistent 10 second boot delay diff --git a/security/openconnect/Makefile b/security/openconnect/Makefile new file mode 100644 index 000000000..9864258db --- /dev/null +++ b/security/openconnect/Makefile @@ -0,0 +1,8 @@ +PLUGIN_NAME= openconnect +PLUGIN_VERSION= 0.1 +PLUGIN_COMMENT= OpenConnect Client +PLUGIN_DEPENDS= openconnect +PLUGIN_MAINTAINER= m.muenz@gmail.com +PLUGIN_DEVEL= yes + +.include "../../Mk/plugins.mk" diff --git a/security/openconnect/pkg-descr b/security/openconnect/pkg-descr new file mode 100644 index 000000000..f34a11698 --- /dev/null +++ b/security/openconnect/pkg-descr @@ -0,0 +1,5 @@ +OpenConnect is an SSL VPN client initially created to support +Cisco's AnyConnect SSL VPN. It has since been ported to support +the Juniper SSL VPN which is now known as Pulse Connect Secure. + +WWW: http://www.infradead.org/openconnect/ diff --git a/security/openconnect/src/etc/inc/plugins.inc.d/openconnect.inc b/security/openconnect/src/etc/inc/plugins.inc.d/openconnect.inc new file mode 100644 index 000000000..b32dc7ec2 --- /dev/null +++ b/security/openconnect/src/etc/inc/plugins.inc.d/openconnect.inc @@ -0,0 +1,83 @@ +enabled == '1'; +} + +function openconnect_services() +{ + $services = array(); + + if (openconnect_enabled()) { + $services[] = array( + 'description' => gettext('OpenConnect'), + 'configd' => array( + 'restart' => array('openconnect restart'), + 'start' => array('openconnect start'), + 'stop' => array('openconnect stop'), + ), + 'name' => 'openconnect', + 'pidfile' => '/var/run/openconnect.pid' + ); + } + + return $services; +} + + +function openconnect_interfaces() +{ + $interfaces = array(); + + if (!openconnect_enabled()) { + return $interfaces; + } + + $oic = array('enable' => true); + $oic['if'] = 'ocvpn'; + $oic['descr'] = 'OpenConnect'; + $oic['type'] = 'group'; + $oic['virtual'] = true; + $oic['networks'] = array(); + $interfaces['ocvpn'] = $oic; + + return $interfaces; +} + +function openconnect_xmlrpc_sync() +{ + $result = array(); + $result['id'] = 'openconnectvpn'; + $result['section'] = 'OPNsense.openconnect'; + $result['description'] = gettext('OpenConnect'); + return array($result); +} diff --git a/security/openconnect/src/etc/rc.d/opnsense-openconnect b/security/openconnect/src/etc/rc.d/opnsense-openconnect new file mode 100755 index 000000000..51d06443d --- /dev/null +++ b/security/openconnect/src/etc/rc.d/opnsense-openconnect @@ -0,0 +1,58 @@ +#!/bin/sh +# +# $FreeBSD$ +# +# PROVIDE: opnsense-openconnect +# REQUIRE: SERVERS +# KEYWORD: shutdown +# + +. /etc/rc.subr + +name=openconnect + +stop_cmd=openconnect_stop +start_cmd=openconnect_start +status_cmd=openconnect_status +rcvar=openconnect_enable + +load_rc_config opnsense-openconnect +pidfile=/var/run/${name}.pid +command=/usr/local/sbin/${name} + +secret=/usr/local/etc/openconnect.secret + +[ -z "$openconnect_enable" ] && openconnect_enable="NO" + +# status of openconnect +openconnect_status() +{ + if [ -n "$rc_pid" ]; then + echo "${name} is running as pid $rc_pid." + return 0 + else + echo "${name} is not running." + fi +} + +# stop openconnect +openconnect_stop() +{ + echo "stopping openconnect" + killall openconnect + ifconfig ocvpn0 destroy + return 0 +} + +# start openconnect +openconnect_start() +{ + echo "starting openconnect" + /usr/local/sbin/openconnect ${openconnect_flags} < /usr/local/etc/openconnect.secret 2>&1 > /dev/null + sleep 5 + ifconfig tun30000 name ocvpn0 + ifconfig ocvpn0 group ocvpn + return 0 +} + +run_rc_command $1 diff --git a/security/openconnect/src/opnsense/mvc/app/controllers/OPNsense/Openconnect/Api/GeneralController.php b/security/openconnect/src/opnsense/mvc/app/controllers/OPNsense/Openconnect/Api/GeneralController.php new file mode 100644 index 000000000..762a2762b --- /dev/null +++ b/security/openconnect/src/opnsense/mvc/app/controllers/OPNsense/Openconnect/Api/GeneralController.php @@ -0,0 +1,37 @@ +view->generalForm = $this->getForm("general"); + $this->view->pick('OPNsense/Openconnect/general'); + } +} diff --git a/security/openconnect/src/opnsense/mvc/app/controllers/OPNsense/Openconnect/forms/general.xml b/security/openconnect/src/opnsense/mvc/app/controllers/OPNsense/Openconnect/forms/general.xml new file mode 100644 index 000000000..2e2c60bfd --- /dev/null +++ b/security/openconnect/src/opnsense/mvc/app/controllers/OPNsense/Openconnect/forms/general.xml @@ -0,0 +1,26 @@ +
diff --git a/security/openconnect/src/opnsense/mvc/app/models/OPNsense/Openconnect/ACL/ACL.xml b/security/openconnect/src/opnsense/mvc/app/models/OPNsense/Openconnect/ACL/ACL.xml new file mode 100644 index 000000000..9408998dd --- /dev/null +++ b/security/openconnect/src/opnsense/mvc/app/models/OPNsense/Openconnect/ACL/ACL.xml @@ -0,0 +1,9 @@ +