17536 Commits

Author SHA1 Message Date
Franco Fichtner
41d8cf30c9 src: small audit regarding "pkg" use
Running the grep below lights up a few spots still:

    # git grep 'pkg[^/\[\.a-z'"'"',()_+"]'

Make a few decisions for the future:

* Use "pkg-static" outside the firmware code consistently
  with a full path
* Modify ambiguous code or comments to not be found by the
  grep above
* Firmware uses PKG now if we ever have to pivot to pkg-static
  or when we need to overwise modify the call.

The goal of this excerise was to find all stray package manager
spots that may run their own embedded pkg-update without the
proper environment which should be gone for now.
2024-11-13 11:59:47 +01:00
Franco Fichtner
3849d4cbc5 firmware: use PKG variable for scripting, part 2 2024-11-13 11:43:27 +01:00
Franco Fichtner
2ab6cad193 firmware: use PKG variable for scripting, part 1 2024-11-13 11:34:17 +01:00
Franco Fichtner
70a59f8ad3 firmware: protect details.sh, reboot.sh and query.sh 2024-11-13 11:00:11 +01:00
Franco Fichtner
536166095c test: move opnsense-atf to debug plugin 2024-11-13 08:12:01 +01:00
Ad Schellevis
1ff4c95f11 firmware: when calling one of the predefined commands via our launcher, the environment should be initialized.
While debugging some missing TLS parameters, I noticed the ciphers where different than expected. Digging a bit deeper seemed to indicate env_init() wasn't called on my end.
If SELF should be the command, the intention was likely to pass the parameter instead of the script name (which is always launcher)

cc @fichtner
2024-11-12 18:23:47 +01:00
Franco Fichtner
2ff993ea57 test: improve opnsense-atf to run more pf tests
This needs more restructuring in a plugin perhaps or being
added to os-debug.  Sounds like a useful next step.  :)
2024-11-12 17:03:33 +01:00
Franco Fichtner
c7f9b4b13a test: add a script to run atf-sh based tests 2024-11-12 15:27:08 +01:00
Franco Fichtner
875d31b234 mvc: touchup on ApiMutableServiceControllerBase
If we need to reload only ask once and avoid probing service status
in that case as we do not need it.
2024-11-12 12:28:03 +01:00
Franco Fichtner
8d0ab40c56 mvc: always do stop/start on forced restart
If 'nocheck' is used the service apears running and reload will
do nothing.
2024-11-11 12:32:54 +01:00
Franco Fichtner
c30b46bd27 wireguard: captain obvious left the building 2024-11-11 12:24:31 +01:00
Stephan de Wit
deb097bd67 filter: add 'Action' property to list of retrieved rules 2024-11-11 09:04:23 +01:00
Franco Fichtner
f405b6211a interfaces: refactor a bit more, add a separate log message #7027 2024-11-09 09:56:14 +01:00
Franco Fichtner
a86c7106ed backend: add 'configd environment' to quickly test resulting env
PR: https://forum.opnsense.org/index.php?topic=43474.0
2024-11-08 14:57:41 +01:00
TotalGriffLock
f5c4504a1d Update opnsense-version
Restored pre-2019 default output format
2024-11-08 14:34:32 +01:00
Franco Fichtner
b9b98f12ae interfaces: use Autoconf class to avoid raw ifctl file access 2024-11-08 09:47:47 +01:00
Franco Fichtner
270aac573d interfaces: need the gateway for proper route-to flush #7027 2024-11-07 21:13:37 +01:00
Franco Fichtner
913a5caae3 system: kill the SSL bundles in default locations
Neither OpenSSL base (/etc/ssl) nor ports (/usr/local/openssl) need
the bundle file now that we use the directory trust store.  The downside
is that as soon as the bundle exists OpenSSL library will read both the
directory and the bundle by default defeating the purpose of a single
location and the directory being faster.

Keep the fringe ca_root_nss location /usr/local/etc/ssl since that is
still seeded by the package but controlled and topped up by the user
configured authorities.
2024-11-07 19:38:49 +01:00
Franco Fichtner
a08931c718 system: revert CRLs in bundles, bundles need to die 2024-11-07 19:31:41 +01:00
Franco Fichtner
73e837d7d3 interfaces: state experiment for #7027
PR: https://github.com/opnsense/core/issues/7635#issuecomment-2462066123
2024-11-07 13:20:21 +01:00
Franco Fichtner
671f4d4415 firewall: improve logging message in bogons update
PR: https://forum.opnsense.org/index.php?topic=43881.0
2024-11-07 08:20:32 +01:00
Ad Schellevis
0788dde6d2 System: Access: Groups - in preperation for https://github.com/opnsense/core/issues/7904, add support for comma separated member lists.
If we convert groups to a model, we will switch the nested <member> tags into comma separated fields, e.g.

	<member>1</member>
	<member>12</member>

will convert to:

	<member>1,12</member>

using this commit we support both for areas where these are being read.
2024-11-06 21:47:17 +01:00
Franco Fichtner
60fe414c1e firmware: make the optional CRL functionality obvious
This is not being used yet but is very likely needed to
get this into FreeBSD.
2024-11-05 13:13:51 +01:00
Franco Fichtner
d91c77f633 firmware: stale CRL index if hosts changed 2024-11-05 13:05:19 +01:00
Ad Schellevis
323c094759 System: Trust: Certificates - add user selection in certificate grid. (part of https://github.com/opnsense/core/issues/7904) 2024-11-04 17:46:47 +01:00
Ad Schellevis
b817853383 Authentication: kill some "isset()" conditions in preperation for https://github.com/opnsense/core/issues/7904 2024-11-04 13:27:31 +01:00
Franco Fichtner
160d7c2f50 system: touchup on SSL directories, /usr/local/etc/ssl should be deprecated 2024-11-04 12:23:30 +01:00
Franco Fichtner
f5d6a3a329 system: small issue with previous
It's rebatable how careful we should be reading files from /etc/ssl/certs
but in practice garbage-in-garbage-out is the best approach and just match
a wider variety of files included in the directory.
2024-11-04 12:09:48 +01:00
Franco Fichtner
799909a23a system: bring CRLs into bundles as well 2024-11-04 12:00:11 +01:00
Franco Fichtner
5b6d347c57 system: improve a comment 2024-11-04 11:59:10 +01:00
Franco Fichtner
95c2c2e49b system: garbage collect unused directories in certctl.py
We do not currently use /usr/local/share/certs/untrusted either,
but keep it for future use.  The other directories are not used
by FreeBSD 14 or newer so just remove their use.
2024-11-04 11:48:17 +01:00
Franco Fichtner
7d77f9f134 system: list certificates by subject, not issuer 2024-11-04 11:41:18 +01:00
Franco Fichtner
bf3231ff6b firewall: tweak this help text
No markup, no second paragraph.  This is an inentional design
choice for better or worse so weave it into the existing note.
2024-11-04 11:28:34 +01:00
Franco Fichtner
d3c1dd827b mvc: style sweep 2024-11-04 07:52:51 +01:00
Ad Schellevis
525481c15b mvc:model:JsonKeyValueStoreField - cache configd call for the duration of the session.
After removing the file caches in https://github.com/opnsense/core/issues/7515, we introduced the slight downside of calling configd for every field.
Using this commit, we should only call configd once per session, which prevents each record in a set calling configd.

This should increase overall performance when using these fieldtypes.
2024-11-03 17:49:31 +01:00
Ad Schellevis
4cb1f6d57d Authentication: add a "time-loop" around authentication for failed attempts, closes https://github.com/opnsense/core/issues/8031
This commit adds a wrapper in base for the authenticate() method, which calls the protected _authenticate() method for a timed auth sequence.
When authentication is fully handled elsewhere (LDAP, RADIUS), we trust the provider for proper constraints, for local cases we move our implementations to _authenticate() in this commit.
2024-11-02 15:44:54 +01:00
Franco Fichtner
d67f9b4ab8 system: better sort for previous 2024-10-31 11:49:43 +01:00
Patrick M. Hausen
e02e5410e0
Default checksum offloading for the vtnet(4) driver to disabled (#8007) 2024-10-31 11:51:14 +01:00
Ad Schellevis
8e3b4b7229 Reporting / rrd - fix regression in 895e58ff25, missing rrd target and sysctl collection issue. partially merges https://github.com/opnsense/core/pull/8024 2024-10-31 08:35:54 +01:00
Franco Fichtner
33fcdabdbb src: style sweep 2024-10-29 20:34:37 +01:00
Ad Schellevis
fed2a35269
Firewall - adhere to best practices (#8010)
* Firewall - adhere to best practices (https://www.openbsd.org/faq/pf/filter.html) and skip lo0 from processing. closes https://github.com/opnsense/core/issues/8009
2024-10-29 20:13:46 +01:00
Ad Schellevis
57a7b5d89f Firewall: cleanup automatic rules. (merge part of https://github.com/opnsense/core/pull/8010)
* When ipv6 is disabled, disable all IPv6 rules as well for clarity
* Only add carp rule when at least one carp virtual ip exists.
2024-10-29 20:09:39 +01:00
Ad Schellevis
7561f69e47 firmware: add wrapper class for python to support using platform TLS settings (as far as possible).
Unfortunately python requests/urllib3/ssl ignores platform openssl defaults, but do choose defaults which do not always match expectations.
Below per configuration item (system_default_sect) the current situation:

* CipherString --> supported, using ciphers list
* Ciphersuites --> not supported, but does seem to follow configuration defaults. When python adds support, we likely have to change something.
* SignatureAlgorithms --> not supported, but seem as above
* Groups (Curves) --> partly supported, only one may be offered, we select the first item in the list, knowing that is a bit flaky (see: set_ecdh_curve())
* MinProtocol --> supported
2024-10-29 17:56:33 +01:00
Monviech
2616ace119
firewall: groups: Fix wording of 9425ca7 (#8025) 2024-10-29 17:36:36 +01:00
Ad Schellevis
052eea3253 System: Trust: Settings - add SignatureAlgorithms option and fix minor form glitch
To prevent clients from offering SignatureAlgorithms beyond specific boundaries, offer the option to set the list manually.
Unfortunately we can't seem to query the options via openssl, so we will have to add the ones we know manually to an option group.

[*] https://docs.openssl.org/3.0/man3/SSL_CONF_cmd/#supported-configuration-file-commands
2024-10-29 14:14:05 +01:00
Ad Schellevis
14c3eff319 System: Trust: Settings - add missing MinProtocol in template, missed a spot in https://github.com/opnsense/core/pull/7854 2024-10-28 18:38:59 +01:00
Monviech
9425ca700d
firewall: groups: Enhance validation that group name can not start or end with a digit. (#8022) 2024-10-28 16:39:36 +01:00
Franco Fichtner
528a634930 reporting: isset vs empty on RRD enable
The config.xml.sample also has a <enable/> node and saving RRD by
disabling it produces an empty <rrd/> node in the code so isset()
is still the right thing to do.

PR: https://forum.opnsense.org/index.php?topic=43641.0
2024-10-27 21:06:40 +01:00
Ad Schellevis
51492f629b mvc / locales - isset() vs !empty() to ease migrations (also required for https://github.com/opnsense/core/issues/7904) 2024-10-27 19:17:40 +01:00
Ad Schellevis
f5a754bd4e model - fix LegacyMapper when the mountpoint is not xml's root, found regression when working on https://github.com/opnsense/core/issues/7904
Currently we seemed to dump new entries in /opnsense in all cases, but when these mappers address items deeper in the structure, they should use an xpath expression to get there.
2024-10-27 18:39:31 +01:00