Skip to content

VPN/IPsec add new MVC module - #6187

Merged
AdSchellevis merged 24 commits into
masterfrom
IPsec_MVC
Dec 12, 2022
Merged

VPN/IPsec add new MVC module#6187
AdSchellevis merged 24 commits into
masterfrom
IPsec_MVC

Conversation

@AdSchellevis

@AdSchellevis AdSchellevis commented Dec 11, 2022

Copy link
Copy Markdown
Member

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)

…so we can "predict" an identifier upfront which eases navigation inside the edit tab (so we can hook grids for child entries)
Add local, remote auth and children in model and controller, show in view when editting an existing entry.
…ing a record.

o implement cascading delete
o use org_uuid field to let setter know this was a copy so we can copy children as well for ease of use.
…ication of both ends of the tunnel (legacy "My identifier" + "Peer identifier")
…connections" with [new] as this will eventually replace/supersede the current tunnel settings.
…mal viable product. Eventually we can also push attributes here, but for now we trust the attr plugin (https://docs.strongswan.org/docs/5.9/plugins/attr.html) to handle these (all pools the same)
… add stub to be populated later for local and remote nets so we can easily show and search them in the connection grid.
… intrefaces and make sure to show current assigned legacy tunnels
@AdSchellevis AdSchellevis self-assigned this Dec 11, 2022
@AdSchellevis AdSchellevis added the feature Adding new functionality label Dec 11, 2022
@AdSchellevis
AdSchellevis marked this pull request as ready for review December 12, 2022 09:19
@AdSchellevis
AdSchellevis merged commit 5752bd6 into master Dec 12, 2022
@ansibleguy

Copy link
Copy Markdown

Greetings.

As I'm curious - will those IPSec changes/updates enable us to API-manage tunnels (create/update/delete P1+P2) in the future?

Thanks (:

- AnsibleGuy

@fichtner

Copy link
Copy Markdown
Member

Hello @ansibleguy,

Yes it will. Biggest caveat is that we won’t migrate legacy data to new format (modelled around swanctl.conf) so with 23.1 you have a full API but existing P1/P2 can’t be edited.

The plan forward is not fully decided. We might just remove the legacy pages in 2024. Whether an automatic migration makes sense depends on user feedback and funding in 2023. But we would much rather keep working on API additions for other lacking components.

Cheers,
Franco

@ansibleguy

Copy link
Copy Markdown

Awesome! :D

Thanks for the information.
I'm looking forward to implementing it as Ansible module.

-AnsibleGuy

@fichtner

Copy link
Copy Markdown
Member

I'm looking forward to implementing it as Ansible module.

That was my secret hope :D Thanks for your work!

@AdSchellevis

Copy link
Copy Markdown
Member Author

@fichtner and initial usage 12363f5

@AdSchellevis AdSchellevis added the roadmap Major roadmap item label Jan 25, 2023
@AdSchellevis
AdSchellevis deleted the IPsec_MVC branch January 30, 2023 13:15
@ansibleguy

Copy link
Copy Markdown

I'm looking forward to implementing it as Ansible module.

That was my secret hope :D Thanks for your work!

FYI: The Ansible modules for IPSec are available => Docs

- AnsibleGuy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Adding new functionality roadmap Major roadmap item

Development

Successfully merging this pull request may close these issues.

3 participants