12790 Commits

Author SHA1 Message Date
David Mora
03f43d6c5b
Fix for Unbound Stats: zero_ttl is no longer a valid statistic (#5793)
* Update Unbound Stats to fix zero_ttl name and add additional stats

* Unbound stats - change to custom sort order
2022-05-29 18:35:06 +02:00
Ad Schellevis
77e3794081 Firewall / Aliases - exclude internal aliases on import. 2022-05-28 13:09:27 +02:00
Paul Kelso
37a1b761d7
Fix grammar. Missing period. (#5791)
Grammatical error - period missing.
2022-05-28 09:25:06 +02:00
Ad Schellevis
021786612c Firewall / Alias - when reading current alias content using pfctl, make sure to ignore empty lines. closes https://github.com/opnsense/core/issues/5788 2022-05-26 10:53:44 +02:00
Franco Fichtner
11e8c26079 firewall: remove file_notice() in filter HA sync 2022-05-24 14:07:20 +02:00
Franco Fichtner
079f1fa914 system: style sweep 2022-05-24 13:36:37 +02:00
Stephan de Wit
d61b901881
PHP80: CRL support (#5675)
Since php-openssl still has no implementation for CRLs, phpseclib is now used to provide this.

To test this commit:
- Create a CA
- Create a certificate signed by the CA
- Create a CRL and revoke the above certificate
openssl verify -crl_check_all -CRLfile <crl>.crl -CAfile <ca>.crt <certificate>.crt
2022-05-24 12:05:00 +02:00
Franco Fichtner
b1a304bef8 dpinger: no use to check twice 2022-05-24 10:23:34 +02:00
Franco Fichtner
2a7550fd0c openvpn: move device handling to plugins facility #5411
While here remove a couple of references from loops and
improve coding style while at it.

While openvpn_prepare() is not the same as reconfiguring
a device (pluginctl -d ovpns1 vs. pluginctl -s openvpn 1)
we can get away with it as used before.  It might be the
subject of later work but for the sake of clearing the
scope of interfaces_configure() this is more than enough.
2022-05-24 10:06:24 +02:00
Franco Fichtner
9cd0073030 interface: next piece of the puzzle is the post-load hardcoding #5411 2022-05-23 17:02:09 +02:00
Franco Fichtner
9e78c7ebbf ipsec: enc device is also ipsec 2022-05-23 16:51:57 +02:00
Franco Fichtner
c2cac175eb ipsec: inline device configuration #5411 2022-05-23 15:39:26 +02:00
Franco Fichtner
584f86570d firmware: move previous to v= since it special handling for it already exists 2022-05-20 12:36:55 +02:00
gibwar
507b96eeb0
Bypass cache with timestamp in upgradestatus call (#5771)
Even though the server responds with proper cache headers to avoid
browser caching, it seems that Safari (and maybe others) may still cache
repeated calls to `/api/core/firmware/upgradestatus`. This change adds
in the time-old tradition of appending the current timestamp in
milliseconds to each request which should force the browser to fetch the
resource.

Ref: https://www.reddit.com/r/opnsense/comments/umhx04/opnsense_2217_released/i83bp36/?context=5
2022-05-20 12:31:10 +02:00
Franco Fichtner
a69cade7fe firmware: lowercase search in plugins/packages
Make sure that columns don't overlap without a delimiter
to get spurious results by unwanted text concatenation.
2022-05-20 08:14:39 +02:00
Franco Fichtner
b91257d7e7 pluginctl: newline shifted elsewhere already 2022-05-19 21:53:56 +02:00
Franco Fichtner
0e908f7b1c pluginctl: fix copy+paste issue 2022-05-19 13:35:01 +02:00
Franco Fichtner
83a2d2feeb interfaces: convert loopback for #5411 2022-05-19 11:06:08 +02:00
Franco Fichtner
4641e84eb2 interfaces: fix two typos here in loopback code 2022-05-19 10:54:36 +02:00
Ad Schellevis
e810712f8b Services: Intrusion Detection: Log File - ACL mismatch, closes https://github.com/opnsense/core/issues/5781 2022-05-19 10:24:29 +02:00
Franco Fichtner
06bb115fce interfaces: add per-device worker to get rid of batch vxlan_prepare #5411 2022-05-18 17:09:00 +02:00
Franco Fichtner
59ae67c55c src: style sweep 2022-05-18 17:08:13 +02:00
Ad Schellevis
cd46d2a0c6 Fireewall : Aliases - bug fix for 49e21188a8 missed an alias name 2022-05-18 16:24:57 +02:00
Stephan
292b701ca8 Unbound: do not compare identity when checking exit code 2022-05-18 13:56:59 +02:00
Franco Fichtner
c5212719c9 system: dpinger support for IPv6 aliases #5777
Since gateways support VIPs we need dpinger to support it too.

The implementation is a little different asking for runtime address
of the interface and trying to match a subnet before falling back
to the standard address.

IPv4 slightly adjusted to follow the same pattern, but without the
pin to an explict VIP address.
2022-05-18 07:53:54 +02:00
Franco Fichtner
7b1f3d7045 system: support 1500000 baudrate selection for ARM
Sticky 115200 when no value was set since it is still the most
common setting.
2022-05-18 07:53:54 +02:00
Ad Schellevis
25f2a8cb73 gateway monitoring - prevent dpinger event from getting into a "reload filter" loop. while here, also make sure we only pass skip_alias as parameter as gateway has no functional meaning. (and reloading aliases shouldn't be neccesary when a gateway drops). 2022-05-17 15:55:04 +02:00
Ad Schellevis
49e21188a8 Firewall: Aliases - performance improvement for large numbers of port type aliases.
o add caching in alias model for aliasIterator() to prevent duplicate parsing.
o since 'content' is exploded multiple times, we do have an opportunity here to move that operation inside the class method for consistency
o pass list of known aliases into filter_core_get_port_alias() to prevent excessive is_alias() calls
2022-05-16 19:03:55 +02:00
Franco Fichtner
d3ea41d1a4 system: adjust gateway validation to "new" reality #5766 2022-05-16 09:50:03 +02:00
Ad Schellevis
dd7d21a3db Interfaces: Assignments - add technical interface ID as these are critical when synchronising content (either hasync or OPNcentral) 2022-05-13 19:14:49 +02:00
Franco Fichtner
4173fbca0e mvc: clean up previous 2022-05-11 12:43:03 +02:00
Stephan de Wit
b25d3e30ad Phalcon compat layer: add Url validator 2022-05-11 12:34:48 +02:00
Franco Fichtner
b7bbc690f7 ipsec: squelch spurious errors on stderr for ipsec status 2022-05-11 10:45:56 +02:00
Stephan de Wit
317e7755ae
Unit tests: remove Monit tests as these cannot be performed in a vacuum (#5762) 2022-05-09 16:47:06 +02:00
Franco Fichtner
c0cd729060 src: style sweep 2022-05-09 16:35:22 +02:00
Stephan de Wit
1f1502acf4
Unbound blocklists / OPNsense UI: strengthen error handling (#5761)
* Unbound blocklists / OPNsense UI: strengthen error handling

Also changes the OPNsense UI error handling routine to display a 'status_msg' if provided. Otherwise just display 'status' to preserve backwards compatibility.
2022-05-09 16:27:20 +02:00
Stephan de Wit
73a062c6cb
unbound: make blocklist additions/removals dynamic to prevent a restart (#5747)
* unbound: make blocklist additions/removals dynamic to prevent a restart

This commit contains an optimization for the way unbound can be updated in its' configuration
without the need for restarting Unbound and by extension a loss of internet connectivity.

Hopefully this will pave the way for optimizations on other aspects of Unbounds' configuration as well.
We could for example look into making the provided wrapper function more generic.

The GUI has also been modified slightly to inform the user of the amount of RRs added/removed.

* Services: Unbound DNS: Blocklist, review comments for https://github.com/opnsense/core/pull/5747

Changed the following minor items:

o gettext() for human readable reponse message
o simplify comparison loop (only new or diff are actually the same operation)
o replace one-liner split into a loop with validation in case an empty record exists (or something that doesn't fit the pattern)
o remove optional (but always) set -f option

* unbound: blocklists: minor style fix and strip more agressively

Co-authored-by: Ad Schellevis <ad@opnsense.org>
2022-05-09 11:23:15 +02:00
Franco Fichtner
8e989d4069 system: whitespace issue 2022-05-09 10:47:23 +02:00
Ad Schellevis
416687de49 VPN / IPsec - mobile property (boolean) duplication in phase 2, closes https://github.com/opnsense/core/issues/5598
do not store "mobile" flag on phase 2 entries, as phase 1 is responsible here.
2022-05-07 20:35:15 +02:00
csbyte
1adae6e9c2
Config::save : call microtime(true) once (#5740)
* Config::save : call microtime(true) once

Co-authored-by: corentin <corentin.smigiel@agoracalyce.com>
2022-05-08 11:02:17 +02:00
Franco Fichtner
f59b133b01 dhcp: fix plist and add .php suffix for clarity
(it's easier to syntax check scripts with a file suffix)
2022-05-06 08:50:19 +02:00
Ad Schellevis
a4c482f66c Config: prevent config crashes when an attribute already exists, while here also make sure we report the error as it will now silently fail. SimpleXMLElement's addAttribute() is only valida when the it doesn't already exist.
Strangly enough, this doesn't seem to happen very often, but during ha sync we are able to crash without notice.
2022-05-02 16:38:30 +02:00
Ad Schellevis
00bd62fbdd Services / Unbound - change grid label when no results are returned (https://github.com/opnsense/core/issues/5752). Should make master/detail more explicit without complicating the world. 2022-05-01 19:16:30 +02:00
Franco Fichtner
ba2da34854 system: only restore missign or zero size ACL files #5746 2022-04-29 10:04:38 +02:00
Ad Schellevis
ba413ce7c5 MVC - API usage : destinct between 401 (Unauthorized) and 403 (Forbidden) when authorisation (or authentication) fails. closes https://github.com/opnsense/core/issues/5749 2022-04-28 20:28:06 +02:00
Ad Schellevis
14e210815b Services: Unbound DNS: Overrides - Restore duplicate domain behaviour to how it was before refactoring to MVC. Sort overrides per domain, suppress "forward-zone:" sections when the previous entry is the same. closes https://github.com/opnsense/core/issues/5748 2022-04-28 18:54:03 +02:00
Ad Schellevis
eb0eb519db Services: DHCPv4 : leases - Move delete action to separate script in configd and offer the ability there to cleanse leases file for duplicate static leases. Since remove a single address or a list of (mac) addresses are two sides of the same coin it seems to make sense to add a script responsible for dhcpdv4 lease cleanup.
Hooking this into dhcpd_dhcp_configure before startup also closes https://github.com/opnsense/core/issues/5724
2022-04-28 14:30:46 +02:00
Franco Fichtner
0cbb2514b6 interfaces: plug vxlan into device population mechanism #5411
Adds pluginctl -d mode to list device types supported, their device
names and finally allows calling a device reconfiguration by name.

This is only the beginning of vlxan refactor.
2022-04-28 10:45:22 +02:00
Franco Fichtner
6e69e7e5db mvc: style sweep 2022-04-28 10:42:15 +02:00
Franco Fichtner
4080345a59 interfaces: include VIPS for primary IPv4 detection #5742
This was surfaced in 22.1.1 when CARP was treated as an alias as well
leaving setups with "none" IPv4 configuration stranded when calling
get_interface_ip() if the service does not support any explicit listening
on a CARP address (which the function actually does support).  Caveats
apply as to which VIP will win as with the code before.  Best used with
just one CARP address.  IP alias doesn't as much sense since that would
be a static IPv4 configuration.

The latter is the reason why we cannot make a similar change to IPv6
where the primary concept is not equal to "first address in ifconfig"
for (sad) reasons.
2022-04-27 14:13:49 +02:00