23 Commits

Author SHA1 Message Date
Ad Schellevis
5752bd6eb3
VPN/IPsec add new MVC module (#6187)
Add new component to manage IPsec connections in a similar format as `swanctl.conf` is defined (https://docs.strongswan.org/docs/5.9/swanctl/swanctlConf.html).  As this needs to work in conjunction with the legacy IPsec module, some minor changes are needed to the current state. 

o VPN/IPsec/Pre-Shared Keys - add optional remote identifier (merges in `ipsec.inc`)
o VPN/IPsec/Virtual Tunnel Interfaces - new component to show existing VTI's and add new ones (as these are separate entities)
o VPN/IPsec/Connections [new] - configuration tool to build `swanctl.conf` 
o Integrate MVC generated `swanctl.conf` into `ipsec.inc` (legacy overlays)
o Integrate manually configured VTI's into `ipsec.inc` (`array_merge(ipsec_get_configured_vtis(), (new \OPNsense\IPsec\Swanctl())->getVtiDevices())`)
o fix minor php warning when changing reqid's (`$local|remote_configured` initialisation when `$configured_intf[$intf]` not found)
2022-12-12 10:37:43 +01:00
Ad Schellevis
0adf843ff6
VPN / IPsec - migrate ipsec.conf to swanctl.conf (#6076)
* VPN/IPsec - work in progress refactoring ipsec.conf to swanctl.conf for https://github.com/opnsense/core/issues/5636

Wrap the following blocks in functions:

o generation of strongswan.conf
o write and cleanup IPsec's CA database
o write certificates used by IPsec
o write RSA Key Pairs
o construct ipsec.secrets for swanctl, combining different sources, phase1 PSK's, certificates, keypairs
o replace VPN: IPsec: Lease Status with new mvc version that uses swanctl underneath

Remap ipsec.conf to swanctl.conf attributes using https://wiki.strongswan.org/projects/strongswan/wiki/Fromipsecconf

Remove lifetime defaults from phase 1 and 2 so new connections will use Strongswan's defaults and move the option in phase above Margintime/Rekeyfuzz as these combined are being migrated (see margintime in Fromipsecconf doc).

Restructure used path directives so we can use the default structure as descried in https://docs.strongswan.org/docs/5.9/swanctl/swanctlDir.html and installed via ports.

IPsec status overview needs a small fix as well (passthrough network seems to be returned by vici, but doesn't contain a class (which crashes list_status.py).)

While here, also remove some php warnings.
2022-10-10 19:52:36 +02:00
Ad Schellevis
3726f67882 VPN: IPsec: Security Association Database - refactor to MVC and extend functionality.
o provide option to delete entries
o show Ikeid and Reqid including optional phase[1|2] description when provided
o extend fields with data provided from setkey -D
2022-07-07 18:47:29 +02:00
Ad Schellevis
023d8e4a35 VPN: IPsec: Security Policy Database - refactor to MVC and extend functionality.
missed a spot in the previous commit, make sure we're not omitting host entries as they skip a subnet definition
2022-07-07 11:40:58 +02:00
Ad Schellevis
434a0a80e8 VPN: IPsec: Security Policy Database - refactor to MVC and extend functionality.
o add a remove button hooking spddelete to remove entries when not cleanedup correctly for some reason to ease maintenance
o add reqid to IPsec phase 2 tunnel view for clarity so we can easily inspect if traffic is trying to pass the right policy
o show Ikeid and Reqid including optional phase[1|2] description when provided
o extend fields with data provided from setkey -DP, but keep them  deselected in the default view (e.g. Upperspec, Mode, Type, ..)
2022-07-06 17:36:07 +02:00
Ad Schellevis
becf4e9342 VPN: IPsec: Status Overview - cleanup, remove vici library in favour of port package 2022-07-05 11:11:53 +02:00
Franco Fichtner
f68816a8c2 src: fix a couple of stray whitespace issues 2021-11-09 13:33:11 +01:00
Robin Schneider
5b8228430d
Use HTTPS everywhere (mechanical edit using util from https-everywhere) (#4534) 2021-03-08 20:04:45 +01:00
Ad Schellevis
30a9195437 IPsec: list_status seems to have issues with byte type data, https://github.com/opnsense/core/issues/4189 2020-06-28 19:43:35 +02:00
Ad Schellevis
c0a2f87471 python3: replace subprocess.call in src/opnsense/scripts/ipsec/* for https://github.com/opnsense/core/issues/3574 2019-07-23 18:18:29 +02:00
Ad Schellevis
a4a70fdfbc python 2->3 ipsec scripts 2019-05-13 13:42:35 +02:00
Franco Fichtner
86c7f6242c src: fix lint-exec pass 2019-01-14 08:14:06 +01:00
Ad Schellevis
c202aee904 ipsec, upgrade vici lib to 5.5.3. https://github.com/opnsense/core/issues/1981 2017-12-12 20:24:22 +01:00
Franco Fichtner
0c2fefab03 src: transform Ad's copyrights, add e-mail everywhere 2017-08-06 11:19:35 +02:00
Ad Schellevis
efd256585a ipsec, add routed when SA is installed and routed, for https://github.com/opnsense/core/issues/1688 2017-06-22 20:10:24 +02:00
Ad Schellevis
d5c6ce3576 ipsec/diag, list non routed connections, for https://github.com/opnsense/core/issues/1688 2017-06-22 19:54:12 +02:00
Ad Schellevis
1d1c2c6acc (ipsec) add list pool leases script (https://github.com/opnsense/core/issues/139) 2016-01-08 16:38:27 +01:00
Ad Schellevis
efb83c621d (ipsec, vici) ignore socket connect issues and report back 2015-11-25 16:22:18 +00:00
Franco Fichtner
e346ceaddc src: whitespace and style sweep 2015-11-10 07:21:36 +01:00
Ad Schellevis
5dcae9cf25 (legacy, ipsec) fix ipsec diag page, connect to vici, drop smp support, add privilege separation using configd 2015-11-06 13:44:52 +00:00
Franco Fichtner
2d2a7c11ef src: whitespace sweep 2015-11-06 12:38:10 +01:00
Ad Schellevis
0cadf36d9d (ipsec) whitespace 2015-11-05 09:10:35 +01:00
Ad Schellevis
a87623867b (ipsec) add status call using vici, related to https://github.com/opnsense/core/issues/139
First step is to switch the current status page away from legacy smp.
(work in progress)
2015-11-05 08:06:12 +00:00