13552 Commits

Author SHA1 Message Date
Stephan de Wit
33a253a748 unbound: finish up unbound/advanced MVC conversion 2022-09-27 14:34:02 +02:00
Stephan de Wit
d2b18299b4 unbound: advanced page MVC migration prep 2022-09-27 14:34:02 +02:00
Franco Fichtner
af9e9b48b7 system: wrap $g handling into a singleton
Adds a bit of code on the initialization but allows to trace the
information without magic globals.

Has been on the wishlist forever, but nowadays it's simple enough
to replace the few instances using it.
2022-09-27 11:07:49 +02:00
Franco Fichtner
15ac360559 system: avoid $g use if we have data already
Still don't like the appended line here but we will see how
this works in practice.
2022-09-27 11:06:14 +02:00
Franco Fichtner
dd42c8785a firmware: restructure license information handling
opnsense-update -K will handle subscription key return if found.
Fetch the license metadata if it exists, move it to core version
meta file and handle the contents dymanically if it exists.

The only issue for later is that changing the mirror away from
business we have a lingering license file until the next check
for updates is done.
2022-09-27 09:13:45 +02:00
Ad Schellevis
261c76d00d Firewall / Aliases - add os-firewall alias paths in getAliasSource() to prevent removal when being used. closes https://github.com/opnsense/plugins/issues/3140 2022-09-25 13:21:11 +02:00
Ad Schellevis
0210a42096 MVC / dropdown field presentation. remove "clear all", "copy" and "paste" options when only a single entry is allowed. 2022-09-24 17:26:11 +02:00
Franco Fichtner
0798b98a16 src: whitespace sweep 2022-09-23 20:31:42 +02:00
Stephan de Wit
2351f17c33 unbound: account for hostname during PTR creation, regression in 547c8b1 2022-09-23 08:54:17 +00:00
Ad Schellevis
7c0db67577 Firewall/Rules - support tos/dscp matching. validation issue in a002251146 for https://github.com/opnsense/core/issues/6045 2022-09-22 17:12:54 +02:00
Ad Schellevis
a002251146 Firewall/Rules - support tos/dscp matching. closes https://github.com/opnsense/core/issues/6045
Add the `tos` keyword to the filter rule edit page and render in pf.conf when set.
2022-09-22 11:45:40 +02:00
Ad Schellevis
797764c10a Core/Firmware - display license validity when applicable
Extends check.sh to fetch license json file when a uuid is found and flush this to /usr/local/opnsense/license.json.
The firmware page adds a license validity row, which is hidden by default and only shown when product.php returns 'product_license_valid_to'.

For the dashboard widget we'll add the "licensed until" string to the core product string when available.
2022-09-21 15:37:17 +02:00
Ad Schellevis
67d22336fa Firewall/Log Files/Live View - various performance and usablility improvements. for https://github.com/opnsense/core/issues/6042
o bulk insert <tr/> objects to prevent overhead finding the top item in the list
o fetch with a minimum of 1000 records, so the browser has something to apply filtering too, this also prevents the issue of not being able to find results when > 25 records per second arrive. Processing 1000 visible records is a lot more effort for the browser than handling 1000 invisible ones.
o simplify table cleanup, as records over "max_rows" would be dropped anyway.
2022-09-20 18:34:43 +02:00
Ad Schellevis
9a956d065a Lobby: Dashboard - RSS widget, catch Error to prevent dashboard breakage. for https://github.com/opnsense/core/issues/6043 2022-09-20 15:51:33 +02:00
Ad Schellevis
ffd64bcfd5 Firewall/Rules - simplify firewall_rule_lookup.php by reusing filter_core_rules_user(), add reference and rule sequence to filter_core_rules_user().
```
$fw = filter_core_get_initialized_plugin_system();
filter_core_bootstrap($fw);
plugins_firewall($fw);
filter_core_rules_user($fw);
```

Above block should offer a complete view on the firewall rules now, which we may use in the gui as well. There's still an idea to offer a full view on all firewall rules that apply to an interface (including floating and groups), a bit inspired by this request https://github.com/opnsense/core/issues/6024. In order to do this, we should likely be able to offer a single rule provider first so we can just query the object.
2022-09-20 13:08:47 +02:00
Ad Schellevis
cebea865c9 Firewall/Rules - extend legacy configuration with uuid's to align with mvc code.
Since filter_rules_sort() is only called via front end pages, it should be safe to check if rules already have a uuid assigned and assign them if they don't. This prevents a migration and increases the change of fast adoption of the rule uuid's.

This commit adds generate_uuid() to config.inc and mimics the same behaviour as mvc models will do, if at a later point in time we would like to hook uuid's to xml attributes in other areas as well, we can simply reuse this.

It is likely a good idea to start using the uuid's in filter_core_rules_user() as labels too as this would prevent the use of the rule hash calculation (saves time and is a more stable id in most cases).

Impact of this change should be rather low as nothing depends on the uuids yet.
2022-09-20 11:17:29 +02:00
Ad Schellevis
d20a9c8236 filter - refactor filter_configure_sync() to wrap user rule registration in a separate function called filter_core_rules_user()
This eases re-use of the rule database from other areas of the system.
2022-09-19 21:19:05 +02:00
kulikov-a
6c82c417be
Firewall:Util - php 8 fix (#6040) 2022-09-19 19:45:55 +02:00
Ad Schellevis
5bf6256367 Interfaces/Other Types/VLAN - user configurable device names. closes https://github.com/opnsense/core/issues/6038 2022-09-19 18:26:48 +02:00
Ad Schellevis
85bc68df66 Firewall/NAT/Port Forward - simplify logic for delete and toggle and make sure to toggle firewall rule as well. closes https://github.com/opnsense/core/issues/5548
while here, also remove the dblclick behaviour on <tr/> as we have removed that on firewall rules years ago (d52fc47acc)
2022-09-19 11:45:06 +02:00
Wagner Sartori Junior
3c59ce3b61
VPN/IPsec - Fix bug when tunnel isolation is disabled (#6033)
Fix #6022 that will add multiple phase 2 IPs to the same interface when tunnel isolation is disabled.
2022-09-19 10:15:41 +02:00
kulikov-a
98f21ed601
unbound: reduce blocklist read timeout (#6030) 2022-09-18 10:14:12 +02:00
Ad Schellevis
1ba8910df4 System/Trust/Revocation - remove unnecessary crl_update() calls in crl export and openvpn as the contents in the text field should be populated in earlier calls (e.g. cert_revoke(), cert_unrevoke()). closes https://github.com/opnsense/core/issues/6005 2022-09-17 20:04:36 +02:00
Ad Schellevis
67e4a1dd99 System / Trust / Revocation - only use withPadding() for RSA based public keys. regression in 9606957ef8 2022-09-16 10:34:35 +02:00
kulikov-a
24aa099509
Dashboard / widgets / OpenVPN - link event before scripts stripping (#6023) 2022-09-14 18:43:59 +02:00
Ad Schellevis
f22c05ec61 Firewall/Diagnostics/Sessions: parse pftop internal data conversion (minor cleanups for https://github.com/opnsense/core/pull/6020) 2022-09-14 11:13:55 +02:00
kulikov-a
0f84667e37 parse pftop internal data conversion 2022-09-13 17:53:24 +03:00
kulikov-a
f4f05f23d5
OpenSSL: follow RFC on basicConstraints too (#6018) 2022-09-13 13:24:54 +02:00
Ad Schellevis
1548ae0eb7 Interfaces / Diagnostics / ARP Table - small cleanups for https://github.com/opnsense/core/pull/6016 2022-09-13 11:55:05 +02:00
moi
d2ee799998 Merge commit '7a06f387ca7fd6dea91a9c94adeaf44cf7d6fd8e' into arp_table_hostname 2022-09-12 23:17:20 +02:00
moi
5f4cd3306f ARP table: IP addresses natural sort 2022-09-12 23:12:15 +02:00
moi
cdc4189b1b Optionally use reverse DNS resolution for ARP table hostnames 2022-09-12 23:07:46 +02:00
moi
f2f158d884 list.arp additional parameter 2022-09-12 23:05:17 +02:00
moi
d5d837487f Resolves DNS only when -r arg is set + use Arp Internal DNS resolution 2022-09-12 23:03:51 +02:00
kulikov-a
7a06f387ca
OpenSSL: add keyUsage extension in CA config (#6017)
see https://www.rfc-editor.org/rfc/rfc5280.html#section-4.2.1.3
2022-09-12 19:42:56 +02:00
gacekjk
a256ae1a8d
Services / Proxy - update pattern to zst for the Arch packages (#6014) 2022-09-12 19:23:56 +02:00
soif
de07e8dcf1 ARP Table: hostname uses reverse DNS lookup as fallback 2022-09-12 12:30:33 +02:00
Franco Fichtner
745d46c4ee interfaces: reload newwanip event for IPv6 for each tracked LAN as well #5966 2022-09-08 14:00:48 +02:00
Franco Fichtner
42caf521af system: 'host' shall not be empty 2022-09-07 08:21:45 +02:00
Franco Fichtner
144a9c64b8 interfaces: whitespace 2022-09-07 08:08:53 +02:00
kulikov-a
7e8ac1eb59
certs: misleading message (#6004) 2022-09-06 12:36:58 +02:00
Stephan de Wit
96229a2e23 traffic widget: fix missing tooltip 2022-09-06 09:36:11 +02:00
Ad Schellevis
9606957ef8 System: Trust: Revocation - phpseclib3 UnsupportedAlgorithmException() issue.
According to the notes in https://phpseclib.com/docs/x509 the signCRL() method previously set the signatureAlgorithm by default (sha1WithRSAEncryption), without specific request we now seem to be using SIGNATURE_PSS by default.

```
Note that whereas in the 1.0 and 2.0 branches, the signature algorithm was set by using an additional parameter in the sign method (or signCSR, signCRL, etc) in this case it's set based on the key. So if you want to create an rsaEncryption X509 cert you'd need to do $publicKey = $publicKey->withHashing(RSA::SIGNATURE_PKCS1) since, by default, RSA keys use RSA::SIGNATURE_PSS.
```

This commit implements the suggested approach to revert the default hashing back to what it was, which at least generates CRL's and is properly handled in validateSignature().

Most likely this fixes https://forum.opnsense.org/index.php?topic=30164.msg145633#msg145633

cc @swhite2
2022-09-04 15:13:29 +02:00
Ad Schellevis
76fb91f071 System: Trust: Revocation - Consider dates after 2050 as lifetime in GeneralizedTime format (rfc5280#section-4.1.2.5) to prevent generating invalid certificates.
Our current default of 9999 days will calculate to a date in 2050, we could either choose to cap on 20491231 here or set to lifetime, the latter seems to be more logical when the number of days is higher than a couple of years.

fix a small php 8 notice as well in the same scope.

noted here https://forum.opnsense.org/index.php?topic=30164.msg145665#msg145665
2022-09-04 11:28:40 +02:00
Ad Schellevis
e1d8b471d0 Interfaces/Other Types/VLAN - pass proto to vlan interface for 802.1ad (QinQ) interface types.
Currently this doesn't work (yet), likely needs https://reviews.freebsd.org/D35848 so vlanproto can be set after the interface creation phase (now it's only possible to set proto there).
If `ifconfig XXXX vlanproto 802.1ad` sets the property, we do need this code to make sure we set these on QinQ parent vlan tags. As a workaround we could pass proto in legacy_interface_create() as well to make this (only) work on boot, but looking at the upstream fix, this might be something easy to pull in the near future.

for https://github.com/opnsense/core/issues/5893
2022-09-03 15:31:25 +02:00
Stephan de Wit
f6cebb421b phpseclib: also include version 3 in certmanager for CSR parsing 2022-09-02 11:15:46 +02:00
Franco Fichtner
1f567a418a interfaces: ipfw(8) explains that ipfw0 is a logging device 2022-09-02 09:54:50 +02:00
Franco Fichtner
111540815d system: give autoloader a chance to try and load it 2022-09-01 20:08:25 +02:00
Ad Schellevis
fc46a52682 certs.inc - safeguard phpseclib3 loading in crl_update() 2022-09-01 17:24:44 +02:00
Ad Schellevis
3b39e2d1f6 OpenVPN / CRL - trap validateSignature() exceptions to syslog 2022-09-01 16:46:21 +02:00