diff --git a/README.md b/README.md index aa6d028b5..b2da6e946 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,7 @@ security/intrusion-detection-content-et-pro -- IDS Proofpoint ET Pro ruleset (ne 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/softether -- Cross-platform Multi-protocol VPN Program security/tinc -- Tinc VPN security/tor -- The Onion Router sysutils/api-backup -- Provide the functionality to download the config.xml diff --git a/security/softether/Makefile b/security/softether/Makefile new file mode 100644 index 000000000..81341b10a --- /dev/null +++ b/security/softether/Makefile @@ -0,0 +1,8 @@ +PLUGIN_NAME= softether +PLUGIN_VERSION= 0.1 +PLUGIN_COMMENT= Cross-platform Multi-protocol VPN Program +PLUGIN_DEPENDS= softether +PLUGIN_MAINTAINER= m.muenz@gmail.com +PLUGIN_DEVEL= yes + +.include "../../Mk/plugins.mk" diff --git a/security/softether/pkg-descr b/security/softether/pkg-descr new file mode 100644 index 000000000..e49e2da52 --- /dev/null +++ b/security/softether/pkg-descr @@ -0,0 +1,8 @@ +SoftEther VPN ("SoftEther" means "Software Ethernet") is one of +the world's most powerful and easy-to-use multi-protocol VPN +software. It runs on Windows, Linux, Mac, FreeBSD and Solaris. + +SoftEther VPN is open source. You can use SoftEther for any +personal or commercial use for free charge. + +WWW: https://www.softether.org/ diff --git a/security/softether/src/etc/inc/plugins.inc.d/softether.inc b/security/softether/src/etc/inc/plugins.inc.d/softether.inc new file mode 100644 index 000000000..93a337adb --- /dev/null +++ b/security/softether/src/etc/inc/plugins.inc.d/softether.inc @@ -0,0 +1,54 @@ + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +*/ + +function softether_enabled() +{ + $model = new \OPNsense\Softether\General(); + return (string)$model->enabled == '1'; +} + +function softether_services() +{ + $services = array(); + + if (!softether_enabled()) { + return $services; + } + + $services[] = array( + 'description' => gettext('SoftEther VPN'), + 'configd' => array( + 'restart' => array('softether restart'), + 'start' => array('softether start'), + 'stop' => array('softether stop'), + ), + 'name' => 'vpnserver' + ); + + return $services; +} diff --git a/security/softether/src/opnsense/mvc/app/controllers/OPNsense/Softether/Api/GeneralController.php b/security/softether/src/opnsense/mvc/app/controllers/OPNsense/Softether/Api/GeneralController.php new file mode 100644 index 000000000..1547f90fd --- /dev/null +++ b/security/softether/src/opnsense/mvc/app/controllers/OPNsense/Softether/Api/GeneralController.php @@ -0,0 +1,39 @@ + + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + */ + +namespace OPNsense\Softether\Api; + +use OPNsense\Base\ApiMutableModelControllerBase; + +class GeneralController extends ApiMutableModelControllerBase +{ + static protected $internalModelClass = '\OPNsense\Softether\General'; + static protected $internalModelName = 'general'; +} diff --git a/security/softether/src/opnsense/mvc/app/controllers/OPNsense/Softether/Api/ServiceController.php b/security/softether/src/opnsense/mvc/app/controllers/OPNsense/Softether/Api/ServiceController.php new file mode 100644 index 000000000..ca49536d9 --- /dev/null +++ b/security/softether/src/opnsense/mvc/app/controllers/OPNsense/Softether/Api/ServiceController.php @@ -0,0 +1,47 @@ + + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + */ + +namespace OPNsense\Softether\Api; + +use OPNsense\Base\ApiMutableServiceControllerBase; +use OPNsense\Core\Backend; +use OPNsense\Softether\General; + +/** + * Class ServiceController + * @package OPNsense\Softether + */ +class ServiceController extends ApiMutableServiceControllerBase +{ + static protected $internalServiceClass = '\OPNsense\Softether\General'; + static protected $internalServiceTemplate = 'OPNsense/Softether'; + static protected $internalServiceEnabled = 'enabled'; + static protected $internalServiceName = 'softether'; +} diff --git a/security/softether/src/opnsense/mvc/app/controllers/OPNsense/Softether/GeneralController.php b/security/softether/src/opnsense/mvc/app/controllers/OPNsense/Softether/GeneralController.php new file mode 100644 index 000000000..7d83f2871 --- /dev/null +++ b/security/softether/src/opnsense/mvc/app/controllers/OPNsense/Softether/GeneralController.php @@ -0,0 +1,38 @@ + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +*/ + +namespace OPNsense\Softether; + +class GeneralController extends \OPNsense\Base\IndexController +{ + public function indexAction() + { + $this->view->generalForm = $this->getForm("general"); + $this->view->pick('OPNsense/Softether/general'); + } +} diff --git a/security/softether/src/opnsense/mvc/app/controllers/OPNsense/Softether/forms/general.xml b/security/softether/src/opnsense/mvc/app/controllers/OPNsense/Softether/forms/general.xml new file mode 100644 index 000000000..c5a99db13 --- /dev/null +++ b/security/softether/src/opnsense/mvc/app/controllers/OPNsense/Softether/forms/general.xml @@ -0,0 +1,8 @@ +
+ + general.enabled + + checkbox + This will activate SoftEther vpnserver process. + +
diff --git a/security/softether/src/opnsense/mvc/app/models/OPNsense/Softether/ACL/ACL.xml b/security/softether/src/opnsense/mvc/app/models/OPNsense/Softether/ACL/ACL.xml new file mode 100644 index 000000000..d7a964e55 --- /dev/null +++ b/security/softether/src/opnsense/mvc/app/models/OPNsense/Softether/ACL/ACL.xml @@ -0,0 +1,9 @@ + + + VPN: SoftEther + + ui/softether/* + api/softether/* + + + diff --git a/security/softether/src/opnsense/mvc/app/models/OPNsense/Softether/General.php b/security/softether/src/opnsense/mvc/app/models/OPNsense/Softether/General.php new file mode 100644 index 000000000..20ffb40cf --- /dev/null +++ b/security/softether/src/opnsense/mvc/app/models/OPNsense/Softether/General.php @@ -0,0 +1,35 @@ + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +*/ + +namespace OPNsense\Softether; + +use OPNsense\Base\BaseModel; + +class General extends BaseModel +{ +} diff --git a/security/softether/src/opnsense/mvc/app/models/OPNsense/Softether/General.xml b/security/softether/src/opnsense/mvc/app/models/OPNsense/Softether/General.xml new file mode 100644 index 000000000..743f6585d --- /dev/null +++ b/security/softether/src/opnsense/mvc/app/models/OPNsense/Softether/General.xml @@ -0,0 +1,11 @@ + + //OPNsense/softether/general + Softether configuration + 0.0.1 + + + 0 + Y + + + diff --git a/security/softether/src/opnsense/mvc/app/models/OPNsense/Softether/Menu/Menu.xml b/security/softether/src/opnsense/mvc/app/models/OPNsense/Softether/Menu/Menu.xml new file mode 100644 index 000000000..6bebfff37 --- /dev/null +++ b/security/softether/src/opnsense/mvc/app/models/OPNsense/Softether/Menu/Menu.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/security/softether/src/opnsense/mvc/app/views/OPNsense/Softether/general.volt b/security/softether/src/opnsense/mvc/app/views/OPNsense/Softether/general.volt new file mode 100644 index 000000000..7ddc14d6b --- /dev/null +++ b/security/softether/src/opnsense/mvc/app/views/OPNsense/Softether/general.volt @@ -0,0 +1,68 @@ +{# + +OPNsense® is Copyright © 2014 – 2018 by Deciso B.V. +This file is Copyright © 2018 by Michael Muenz +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +#} + + + + +
+
+
+ {{ partial("layout_partials/base_form",['fields':generalForm,'id':'frm_general_settings'])}} +
+
+ +
+
+
+
+ + diff --git a/security/softether/src/opnsense/scripts/OPNsense/Softether/setup.sh b/security/softether/src/opnsense/scripts/OPNsense/Softether/setup.sh new file mode 100755 index 000000000..f83ff509c --- /dev/null +++ b/security/softether/src/opnsense/scripts/OPNsense/Softether/setup.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +mkdir -p /var/db/softether +mkdir -p /var/log/softether diff --git a/security/softether/src/opnsense/service/conf/actions.d/actions_softether.conf b/security/softether/src/opnsense/service/conf/actions.d/actions_softether.conf new file mode 100644 index 000000000..2470ac33f --- /dev/null +++ b/security/softether/src/opnsense/service/conf/actions.d/actions_softether.conf @@ -0,0 +1,23 @@ +[start] +command:/usr/local/opnsense/scripts/OPNsense/Softether/setup.sh;/usr/local/etc/rc.d/softether_server start +parameters: +type:script +message:starting softether + +[stop] +command:/usr/local/etc/rc.d/softether_server stop +parameters: +type:script +message:stopping softether + +[restart] +command:/usr/local/opnsense/scripts/OPNsense/Softether/setup.sh;/usr/local/etc/rc.d/softether_server restart +parameters: +type:script +message:restarting softether + +[status] +command:sh /usr/local/etc/rc.d/softether_server status;exit 0 +parameters: +type:script_output +message:softether status diff --git a/security/softether/src/opnsense/service/templates/OPNsense/Softether/+TARGETS b/security/softether/src/opnsense/service/templates/OPNsense/Softether/+TARGETS new file mode 100644 index 000000000..04e32a977 --- /dev/null +++ b/security/softether/src/opnsense/service/templates/OPNsense/Softether/+TARGETS @@ -0,0 +1 @@ +softether_server:/etc/rc.conf.d/softether_server diff --git a/security/softether/src/opnsense/service/templates/OPNsense/Softether/softether_server b/security/softether/src/opnsense/service/templates/OPNsense/Softether/softether_server new file mode 100644 index 000000000..72a7f3048 --- /dev/null +++ b/security/softether/src/opnsense/service/templates/OPNsense/Softether/softether_server @@ -0,0 +1,6 @@ +{% if helpers.exists('OPNsense.softether.general.enabled') and OPNsense.softether.general.enabled == '1' %} +softether_server_var_script="/usr/local/opnsense/scripts/OPNsense/Softether/setup.sh" +softether_server_enable="YES" +{% else %} +softether_server_enable="NO" +{% endif %}