14554 Commits

Author SHA1 Message Date
Franco Fichtner
dfadc8190e console: store UUID for VLAN device #6086 2022-10-17 12:07:12 +02:00
Franco Fichtner
5d62b395d1 unbound: fix bail on python glue chown (read-only error) 2022-10-17 11:04:51 +02:00
Ad Schellevis
3edd472aaa Services: Unbound DNS - remove 127/8 from private-address block when rebind protection is enabled as advised by unbound (https://unbound.docs.nlnetlabs.nl/en/latest/manpages/unbound.conf.html#term-private-address-IP-address-or-subnet) and make the default items configurable via the advanced page. closes https://github.com/opnsense/core/issues/5871 2022-10-16 18:31:02 +02:00
Ad Schellevis
926a4c8e68 MVC : UIBootgrid - enforce json request data (set content and data type) instead of form encoded data.
o fixes some bugs in default form handling (UIModelGrid), get() vs getPost()
o when properly encoded, sort is an empty array in ApiControllerBase->searchRecordsetBase()
2022-10-15 20:22:33 +02:00
Stephan de Wit
d14ffae466
unbound: rework DNSBL implementation to python module (#6083)
Replaces the current blocklist implementation to use python instead of relying on unbound-control. The latter had the drawback of a very long execution time to administrate the local-data entries both locally and in Unbound. The memory footprint was also considerably larger due to unbound internals, while the python module keeps it all in memory in a simple dictionary - reducing the total amount of memory consumption by more than a factor of 10. A drawback is a potential decrease in performance of ~15%, although most setups shouldn't be affected by this as most hardware which is capable of running this should be scaled towards its intended use.

The option of returning NXDOMAIN has also been added (fixes #6027), which in this implementation is a lot easier than what we would have to do if local-data were to be used.
2022-10-14 17:02:23 +02:00
Franco Fichtner
e2c182bd4b system: wait 1 second for configd socket to become available; closes #6012 2022-10-14 16:55:03 +02:00
Franco Fichtner
47bef28ae3 unbound: error while opening DoT page
This is due to e5bace2969c, but since we view the overview page here
I'm not even sure the decision about forward/dot can be correct since
there will be no POST data about 'dot' or the type.

[14-Oct-2022 08:28:20 Europe/Berlin] Exception: Error at /usr/local/opnsense/mvc/app/controllers/OPNsense/Unbound/Api/SettingsController.php:67 - Trying to access array offset on value of type null (errno=2) in /usr/local/opnsense/mvc/app/controllers/OPNsense/Base/ApiControllerBase.php:159
Stack trace:
2022-10-14 08:48:48 +02:00
Franco Fichtner
13391b3c7c ui: fix previous 2022-10-14 08:35:45 +02:00
Ad Schellevis
41911f8a85 MVC : UIBootgrid - various improvements
o minor style fixes and more strict json handling
o easier handle to add commands using a commands named array

$().UIBootgrid({
   ....
   commands: {
      myaction: {
         method: function(){};
         classname: 'fa fa-fw fa-remove',
         sequence: 10
      },
      copy: {
         classname: undefined // hide button
      }
   }
});
2022-10-13 20:52:37 +02:00
Ad Schellevis
d854e59771 VPN / IPsec - migrate ipsec.conf to swanctl.conf (https://github.com/opnsense/core/pull/6076).
remove legacy files unconditionally as pkg creates the directory structure anyway it seems.

discussed with @fichtner
2022-10-13 16:00:06 +02:00
Ad Schellevis
c730ce2023 Firewall: Log Files: Live View - possible race condition when changing limit, make sure the fetch before the change isn't populated into the grid. 2022-10-13 15:56:36 +02:00
Franco Fichtner
edd0d25423 firewall: off-by-one in regex for target port range parse
PR: https://forum.opnsense.org/index.php?topic=30652.0
2022-10-13 11:03:33 +02:00
Franco Fichtner
8d50193182 firmware: remove faulty changelog to force a clean refetch 2022-10-12 10:01:45 +02:00
Franco Fichtner
edb286cf6a mvc: translate base field error
Without gettext() wrapping we never produce a string in the
translation for it.  It gets passed to gettext() twice then
but that is matters not as the target string cannot be translated
again when called a second time.
2022-10-10 20:23:53 +02:00
Franco Fichtner
f70b71ce12 ipsec: style sweep 2022-10-10 20:23:26 +02: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
385d182798 Firewall: Aliases - support Maxmind's unclassified EU (region, country unknown) as country selector EU
6255148,en,EU,Europe,,,0

Although the same applies for Asia, we can't use AS as country code here, so we do have to skip this for now until we find a better alternative.

6255147,en,AS,Asia,,,0

closes https://github.com/opnsense/core/issues/6063
2022-10-10 18:24:32 +02:00
Franco Fichtner
6a2190695d ipsec: ACL fix for sessions users #6067 2022-10-09 09:28:07 +02:00
Ad Schellevis
6f53ca0b22 MVC / form validation handling - when multiple messages are returned, wrap each message in a div. closes https://github.com/opnsense/core/issues/6073 2022-10-08 08:47:17 +02:00
Ad Schellevis
a31a21bd93 Interfaces: Other Types: VLAN - show attached interface on device, for https://github.com/opnsense/core/pull/6074 2022-10-07 19:55:50 +02:00
Franco Fichtner
26a0bf2337 interfaces: fix validation the way it was intended 2022-10-07 13:44:10 +02:00
Ad Schellevis
054a7ee834 Interfaces: Other Types: VLAN - setItemAction() loop variable issue, overlapping with requested node leading to faulty validation results. 2022-10-07 11:05:08 +02:00
Franco Fichtner
6798d9a438 interfaces: also fix the help text 2022-10-07 10:44:44 +02:00
Franco Fichtner
46657fcc67 interfaces: simplify and tighten the matching 2022-10-07 10:31:40 +02:00
Franco Fichtner
6f83fd8eff interfaces: tweak device name validation messages 2022-10-07 10:01:45 +02:00
Ad Schellevis
91d8b7f8bf MVC - ApiControllerBase.php / fix typo in searchRecordsetBase() 2022-10-06 22:16:28 +02:00
Franco Fichtner
7fec5111bd system: contain abysmal CRL code in crlmanager page
Also try to reconfigure after write_config() which is the sensible
thing to do...
2022-10-06 12:00:57 +02:00
Ad Schellevis
9a77be0040 System/Trust/Revocation - Fix inconsistent is_crl_internal() implementation and make sure we always generate a crl when saved 2022-10-06 11:26:38 +02:00
Franco Fichtner
26ccc7839f system: remove _defaultgw(v6) file handling; closes #5900
Try to avoid touching default routes in dhclient-script which we
already partially do now.  PPPoE linkdown certainly doesn't need
to handle the file as well to remove the default route then.
2022-10-06 09:29:12 +02:00
Stephan de Wit
37fc19bfed unbound: move the removal of pluggable files above the configuration check
if bad input files are given, the root.key repair is triggered, which doesn't
make a lot of sense so just let unbound fail when this happens.

also remove the redirect to /dev/null to prevent possible file permission issues.
2022-10-04 12:10:00 +02:00
Franco Fichtner
b4979dc5eb unbound: stop testing staged changes
Not a lot of users for this manual testing script.  Only print
errors for current configuration.
2022-10-04 11:58:04 +02:00
Ad Schellevis
a9d81e3fd8 IPSec: move user PSK and legacy PSK items to new PSK mvc module. (https://github.com/opnsense/core/issues/4614)
o prevent migration issues when empty <mobilekey/> tags exists.
2022-10-04 11:33:33 +02:00
Stephan de Wit
9c9a15b9ec unbound: relocate preloading of blocklist cache to start.sh
It doesn't really make sense to let unbound.inc handle this, instead it should
be part of the staging script.
2022-10-04 11:27:23 +02:00
Franco Fichtner
f65d40f4bc interfaces: fix message, reserve last char for \0 2022-10-04 09:59:49 +02:00
Ad Schellevis
df6f7484a7 Revert "PSec: move user PSK and legacy PSK items to new PSK mvc module. (https://github.com/opnsense/core/issues/4614)"
This reverts commit eddb9128f72686e2222fe55109165f79560cf31c.
2022-10-04 09:41:23 +02:00
Ad Schellevis
eddb9128f7 PSec: move user PSK and legacy PSK items to new PSK mvc module. (https://github.com/opnsense/core/issues/4614)
Drop input mask as the legacy one allowed all characters.
2022-10-03 15:48:49 +02:00
Ad Schellevis
77569c29fb Firewall: NAT: Port Forward - php8 error when using any-{port} or {port}-any in destinations. fix local-port calculation 2022-10-03 15:27:00 +02:00
Stephan de Wit
e101c6040d unbound: maintain a consistent dnsbl cache state
In situations where a cache does not exist (mainly boot), a start/stop/restart of unbound
should make the system aware of the current dnsbl configuration in order to properly diff
on it. This includes unbound starting on boot.
2022-10-03 14:17:37 +02:00
Franco Fichtner
00bb9e273b src: style sweep 2022-10-02 21:08:34 +02:00
Ad Schellevis
9448b0cacc IPSec: move user PSK and legacy PSK items to new PSK mvc module. closes https://github.com/opnsense/core/issues/4614
There is some overlap in https://github.com/opnsense/core/issues/5636 as this cleans-up ipsec.conf further.
2022-10-02 19:49:21 +02:00
Ad Schellevis
7d672da990 Interfaces/Other Types/VLAN - constraint user input further for https://github.com/opnsense/core/issues/6038 to avoid future naming collisions. missed a spot in previous commit. 2022-10-02 16:27:47 +02:00
Ad Schellevis
2d74c6b641 Interfaces/Other Types/VLAN - constraint user input further for https://github.com/opnsense/core/issues/6038 to avoid future naming collisions. 2022-10-01 09:42:01 +02:00
Franco Fichtner
4f9e12c999 src: style sweep 2022-09-30 17:11:50 +02:00
Stephan de Wit
346cc08c99
Unbound: addition to advanced rework (#6053)
Small addition to https://github.com/opnsense/core/pull/6050:

- Move private/insecure domains to advanced as its intended use has a larger scope than DNSBLs only. Fixes https://github.com/opnsense/core/issues/5256
- Extends the migration to also include these domains.
- leftover cleanup of legacy settings in migration.
- Adds the `serve-expired-reply-ttl`, `serve-expired-ttl`, `serve-expired-ttl-reset`, `serve-expired-client-timeout` options. These options are hidden until the `serve-expired` checkbox is checked, and indented to signify a relationship.
- Removes all dropdowns and instead provides numeric fields to input raw values for more control and less "guessing" of what is acceptable.
- Removes default settings to prevent mismatches with upstream in the future. It's probably best to refer to the Unbound documentation in our own documentation.
- Previously, `rrset-cache-size` and `outgoing-range` were implicitly set. These are now input fields. The migration code will take care of legacy setting assumptions.

Fixes https://github.com/opnsense/core/issues/5978
Fixes https://github.com/opnsense/core/issues/5795
2022-09-30 17:08:34 +02:00
Franco Fichtner
9cf0b30348 system: redirect spurious error #6059 2022-09-30 10:11:12 +02:00
Franco Fichtner
e48fa6539f system: for recovery reasons can't depend on mwexec() #6059 2022-09-30 10:02:49 +02:00
Franco Fichtner
74238dec17 system: remove stray installer account since ba2da34854a
PR: https://github.com/opnsense/core/issues/6059
2022-09-30 09:27:03 +02:00
kulikov-a
e5bace2969
support setting type value via api call (#6054)
Closes https://github.com/opnsense/core/issues/6047
2022-09-30 09:22:32 +02:00
Franco Fichtner
073dd2ec6d system: avoid error on installer user creation
pw: no such user 'installer'
2022-09-30 09:07:37 +02:00
Franco Fichtner
c626b96117 src: style sweep 2022-09-29 15:37:37 +02:00