1357 Commits

Author SHA1 Message Date
Ad Schellevis
f384afa8f9 VPN: IPsec: Security Policy Database - Manual assignments linking to connection children (https://github.com/opnsense/core/issues/6451)
Add connection child as option for manual SPDs, to make sure these are easily selectable we'll extend ModelRelationField to include a method to return it's value (so we can combine parent descriptions)
2023-03-29 16:18:10 +02:00
Franco Fichtner
23dc326bb3 src: whitespace vs. stable 2023-03-24 10:22:36 +01:00
Ad Schellevis
4082fb4283 System/Logging - timezone parsing issue for zones west of UTC [-]. closes https://github.com/opnsense/core/pull/6443 2023-03-24 09:27:42 +01:00
Franco Fichtner
ea10c72f7d system: looks like we mask "loss" when "delay" is also reported
Add a new status although we didn't want to extend the functionality,
but this does look like a bug when loss indicator is used but not
properly reported.

PR: https://github.com/opnsense/core/issues/6231
2023-03-23 09:09:32 +01:00
Ad Schellevis
b9a1633a18 VPN: OpenVPN: Connection Status - refactor to MVC closes https://github.com/opnsense/core/issues/6382
o rename virtual_addr --> virtual_address in status call out
o add new endpoints to search connections and routes, kill sessions and service control
o remove old status page status_openvpn.php and change ACL and Menu registration
o offer two tab view on sessions / routes
o service controls (restart/start/stop) are shown for non client based records (p2p and client mode) or when no clients are connected.
2023-03-21 15:25:59 +01:00
Stephan de Wit
e9285f254b unbound: blocklists: adjust to rename 2023-03-20 09:15:49 +01:00
Stephan de Wit
b8d3e6a7ef unbound: blocklists: lowercase all domains
while here, also add size check to cached blocklists, as they might be empty
due to network errors.
2023-03-20 09:05:52 +01:00
Franco Fichtner
a50897b517 firmware: make error messages for subscriptions clearer #6373
These are the backend issues we have been having.  We can improve the
messages later, perhaps add better instructions.
2023-03-17 10:03:41 +01:00
Ad Schellevis
d1468a3f82 Interfaces: Diagnostics: Ping - minor adjustments for https://github.com/opnsense/core/issues/6378, limit the maximum runtime to a day, fix form help an add source address 2023-03-16 21:35:15 +01:00
Ad Schellevis
83ccec4330 Interfaces: Diagnostics: Ping - refactor diagnostics tool (https://github.com/opnsense/core/issues/6378) 2023-03-16 20:23:22 +01:00
Ad Schellevis
b528952260 VPN/OpenVPN - add missing static-challenge parsing, should fix https://forum.opnsense.org/index.php?topic=32939.msg159861#msg159861 2023-03-16 10:26:43 +01:00
Franco Fichtner
b60d7769b4 scripts: last bits of killbypid() converted 2023-03-14 10:45:13 +01:00
Ad Schellevis
febec04e28 Reporting/Health - simplify state collection for system-states.rrd which should increase performance and fixes the nat count 2023-03-09 17:35:58 +01:00
Ad Schellevis
06cbfb5c60 Firewall/Aliases - prevent networks from being send to DNS resolver in update_tables.py 2023-03-02 13:42:24 +01:00
Franco Fichtner
88a8a9754c src: style sweep 2023-03-01 14:51:23 +01:00
Ad Schellevis
bee2f8929f
Firewall / Aliases - Allow to create firewall rules for logged in OpenVPN user groups. (https://github.com/opnsense/core/issues/6312) (#6367)
o extend model with authgroup type (currently only for OpenVPN)
o add controller action to list user groups
o modify alias form to show group list in a similar way as network groups, simplify some of the code to prevent copying.
o add AuthGroup parser to glue the output of list_group_members.php and ovpn_status.py to a set of addresses per group for our new authgroup alias type to use
o hook 'learn-address' event in openvpn to trigger an alias update

Although theoretically we could pass addresses and common_names from learn-address further in our pipeline, for now we choose to use a common approach which should always offer the correct dataset (also after changing aliases and re-applying them). If for some reason this isn't fast enough, there are always options available to improve the situation, but usually at a cost in terms of complexity.
2023-03-01 14:47:19 +01:00
Ad Schellevis
0aa9e0bea0 System/Auth - add simple script and configd action to list current group membership (auth list groups). requirement for https://github.com/opnsense/core/issues/6312
redux (use group ids instead of names), correction on a6a4f2252a055003d18089f193c3cdaa27346bfe as group names maybe changed.
2023-03-01 14:24:09 +01:00
Franco Fichtner
ed6cd638ac system: create system_resolver_configure() to simplify callers
Replace a few easy spots.  Eventually we want to call both
functions for each spot instead of doing both (in switching order)
or only one of them.  They are both cheap operations since they
don't (re)start DNS processes any longer.
2023-03-01 08:56:16 +01:00
Stephan de Wit
b4e72bbeff Unbound: Blocklists: slight restructure of inherited code. No functional changes 2023-03-01 08:31:13 +01:00
Ad Schellevis
331b03a21a Interfaces: Diagnostics: Packet Capture - minor bugfix in extracting interface leading to mangled interfaces in the viewer (vlan0.1.2.3 turning into vlan0) 2023-02-28 13:43:51 +01:00
Stephan de Wit
afcbddc153 Unbound: set cache time as a property and missing config check 2023-02-28 13:21:10 +01:00
Stephan de Wit
501f08c87d Unbound: Blocklists: make sure to disable blocklist by writing an empty file when no data provided and properly merge configurations 2023-02-28 08:51:33 +01:00
Franco Fichtner
aaed91bbb2 src: style sweep 2023-02-26 21:18:34 +01:00
Ad Schellevis
78b76cb505
Firewall/Aliases - refactor alias update script (for https://github.com/opnsense/core/issues/6312) (#6362)
Cleanup alias handling uniforming operations so new types can be adopted more easily. 

o move all pf actions to it's own class
o move all alias related modules to l`ib/alias`
o move AliasParser to alias.py to make update_tables.py more readable
o add targetted alias (type) updates (update a list of aliases including dependencies)
o cache non managed aliases as well, so targeted updates have the opportunity to nest these (interface or bogus aliases for example)
o refactor cleanup a bit to store and keep "txt" files for external aliases
o add `BaseContentParser` type which should be inherited by all parsers and wrap existing types into the new base class.
o add unit tests for all current parsers.
2023-02-26 15:28:09 +01:00
Stephan de Wit
09f40f0e33
Unbound: blocklists: allow scripts to extend blocklist functionality (#6350) 2023-02-24 15:39:40 +01:00
Stephan de Wit
5fa74bfafa
Unbound: implement wildcard blocking and refactor dnsbl_module (#6344)
Co-authored-by: Ad Schellevis <ad@opnsense.org>
2023-02-24 15:38:27 +01:00
Ad Schellevis
a6a4f2252a System/Auth - add simple script and configd action to list current group membership (auth list groups). requirement for https://github.com/opnsense/core/issues/6312 2023-02-23 21:18:22 +01:00
Ad Schellevis
bb1aa66802 VPN/OpenVPN - add ovpn_status.py script and configd action to fetch connected clients, refactor legacy backend code while here (https://github.com/opnsense/core/issues/6312)
Eventually the old gui code should be replaced as well, but this is an easy to release step in between offering nearly the same output (p2p's presentation is aligned with server in stead of client) with code we are able to reuse for the openvpn aliases.
2023-02-23 11:09:06 +01:00
Franco Fichtner
58ffdc1684 interfaces: force renew for IPv6 2023-02-21 12:36:15 +01:00
Franco Fichtner
4950460715 interfaces: force newip calls through DHCP/PPP/OVPN on IPv4
In case addresses are removed and reapplied the routes are gone
and other related interface configuration is missing.  In these
cases do a full recycle even though the address did not change
visibly (which is good that we can detect it).

Also address the "miss" of the cached address clean now that we
know DHCP should not force-update us into a missing address
scenario during a renew.

PR: https://github.com/opnsense/core/issues/6338
2023-02-21 10:50:43 +01:00
kulikov-a
5d77a44ccf
unbound: fix typo in logger. create a pipe early in dnsbl_module.py (#6340) 2023-02-20 10:13:46 +01:00
kulikov-a
7ebe361340
unbound: wait for a pipe a bit (#6331) 2023-02-16 15:13:05 +01:00
Franco Fichtner
53fefd47a3 openvpn: style sweep 2023-02-10 10:08:09 +01:00
Ad Schellevis
89da198d62 VPN/OpenVPN/Servers - when using auth_control_file, success seems to be '1' according to the source (documentation doesn't seem to be explicit about this)
reference : ccf9d57249/src/openvpn/ssl_verify.c (L1079-L1082)
2023-02-09 16:21:32 +01:00
Franco Fichtner
02a05a4d4c src: style et al 2023-02-08 07:07:15 +01:00
Ad Schellevis
1e28d5b352 VPN:OpenVPN: Servers - deferred authentication, work in progress for https://github.com/opnsense/core/issues/6293
This initial commit focusses on structuring the event flow around user and client registration, moving events to our new ovpn_event.py handler.
By supporting both deferred and direct authentication in user_pass_verify.php, we should be able to start with a cleanup patch for OpenVPN 2.5.x and work our way up to
a smaller fix for 2.6.x.

In preperation for 2.6, this commit also moves --cipher to --data-ciphers-fallback as suggested by the warning "DEPRECATED OPTION: --cipher set to '' but missing in --data-ciphers". Rename the option in the gui while there and add a note in the help text.
2023-02-07 19:26:29 +01:00
Franco Fichtner
09b2bec389 pkg: remove CORE_FLAVOUR handling 2023-02-07 09:22:33 +01:00
Stephan de Wit
3170c77880 Unbound: small optimizations
No need to register callbacks when stats are not enabled and no need to use
a circular buffer on the logger side since we don't need to append left. This avoids
the need for converting it to a list.
2023-02-07 09:13:42 +01:00
Ad Schellevis
7a434a6845 Reporting: Unbound DNS - minor logger cleanups and don't try to "delete" every 10 seconds. 2023-02-02 13:44:43 +01:00
Ad Schellevis
02f44d9024 Reporting: Unbound DNS - duckdb consuming a lot of time doing index maintenance, this should lower the cpu load significantly. 2023-02-02 12:02:59 +01:00
Ad Schellevis
3d6876ee1d VPN: IPsec: Lease Status - bugfix username parsing, closes https://github.com/opnsense/core/issues/6294 2023-02-01 18:13:36 +01:00
Stephan de Wit
977dd3194b Unbound: Logger: switch client update list to a set 2023-02-01 11:52:48 +01:00
Franco Fichtner
05cc292031 interfaces: fix rename after proto addition
'proto' was set on to be deleted VLANs preventing them to be
deleted and also causing the new VLAN not to gain the proper
settings.  Likely needs a reboot on systems where this bad
state was reached since the system will not delete stray VLAN
devices it does not know about anymore/failed to delete before.

PR: https://forum.opnsense.org/index.php?topic=32225.0
2023-02-01 08:28:44 +01:00
Ad Schellevis
af7f4bacca Firewall/Alias - safeguard download_geolite() and log error after fetching a corrupted geoip zipfile 2023-01-31 21:51:47 +01:00
Franco Fichtner
0b04cc5efc system: deal with shell_exec() vs. trim() by wrapping all into shell_safe() 2023-01-31 09:01:12 +01:00
Franco Fichtner
4b662218aa src: style sweep 2023-01-30 12:50:21 +01:00
Stephan de Wit
4ffcd434a2 Unbound: blocklists: always prioritize whitelists over blocklists 2023-01-30 09:45:33 +01:00
Ad Schellevis
bb623c6033 Reporting: Traffic - bail dns resolve when no resolver is configured. closes https://github.com/opnsense/core/issues/6266 2023-01-26 17:50:51 +01:00
Ad Schellevis
798e827562 Services: Captive Portal - enforce a database repair if an sqlite3.DatabaseError is triggered during normal operation. 2023-01-24 18:09:55 +01:00
Ad Schellevis
8ee9521376 Services: Captive Portal - for static mac assignments make sure if the ip address actually changed before updating it. 2023-01-24 16:00:59 +01:00