1703 Commits

Author SHA1 Message Date
Franco Fichtner
b0fdeae6d2 Revert "firmware: when calling one of the predefined commands via our launcher, the environment should be initialized."
This reverts commit 1ff4c95f115028cd3786f249ef77500767c904bf.

Intended side effect so that the launcher will have access to the vars
published by config.sh -- when the launcher starts the actual script
the script itself will source the config.sh again causing the env_init()
to be called for all participating COMMANDS.  This ensures the env_init()
call is locked by default.
2024-11-13 16:06:31 +01:00
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
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
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
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
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
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
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
Stephan de Wit
87687b7c39 firewall: account for uuid in other rule parsing areas (2c4c5cf09b) 2024-10-24 08:35:24 +02:00
Ad Schellevis
2c4c5cf09b Firewall: Automation: Filter - use uuid as rule labels to ease tracking. 2024-10-23 15:41:27 +02:00
Franco Fichtner
4219e86305 reporting: squelch a RRD warning 2024-10-23 09:32:50 +02:00
Franco Fichtner
bc2c878ec9 firmware: better naming for firmware crls; closes #7995 2024-10-22 14:30:44 +02:00
Franco Fichtner
30b8bfedbf firmware: for CRL verify to work need to explicitly set trust store 2024-10-22 13:14:48 +02:00
Franco Fichtner
c1d8bf6277 firmware: add a newline to CRLs just in case 2024-10-22 13:13:51 +02:00
Franco Fichtner
100c4870f4 system: fix hashval from capture 2024-10-22 12:56:34 +02:00
Franco Fichtner
a5504ee744 firmware: missing HOSTS too #7995 2024-10-22 09:15:38 +02:00
Franco Fichtner
ddd78295b5 firmware: typo in previous #7995 2024-10-22 09:13:49 +02:00
Franco Fichtner
b7e7df8a1b firmware: use the trust store for CRL verification #7995 2024-10-22 09:10:12 +02:00
Franco Fichtner
3b09bc73f8 system: sync certctl to FreeBSD 14.1 base code 2024-10-22 08:27:10 +02:00
Franco Fichtner
8e41be2ebe src: styke sweep 2024-10-21 19:46:49 +02:00
Monviech
3a7cd41868
vpn: ipsec: Add swanctl.conf download button to settings.volt view (#7972)
* vpn: ipsec: Add swanctl.conf download button to settings.volt view. Bootstrap dialogue warns user about sensitive file contents. Error scenarios like missing file or API errors are handled gracefully with error messages.

* Update src/opnsense/mvc/app/views/OPNsense/IPsec/settings.volt

Co-authored-by: Franco Fichtner <franco@lastsummer.de>

* vpn: ipsec: make plist-fix

---------

Co-authored-by: Franco Fichtner <franco@lastsummer.de>
2024-10-21 14:55:41 +02:00
Franco Fichtner
786bc2cf05 firmware: improve the health check a bit
Allow for an extra argument as sometimes we just want one
component.  There's no way to access this easily but it makes
sense for testing.

Squelch the CRL warnings in the rquery as we want to parse
it correctly anyway intead of reading error messages.

Add version annotation to core check.
2024-10-21 12:11:04 +02:00
Franco Fichtner
50a6cc86ba firmware: guard rm with -f to avoid spurious errors 2024-10-21 12:11:04 +02:00
Ad Schellevis
e78e243919 system: CRL/cert subject hash mismatch in certctl.py, closes https://github.com/opnsense/core/issues/7993
Since pyOpenSSL doesn't support generating hashses for CRL's, we calculated one with the functions available in the libraries.
Unfortunately X509Name doesn't seem to support duplicate attributes, causing mismatches on our end.

This commit replaces the previous logic with a direct call to openssl, although it's slower, it will deliver the expected outcome.
2024-10-21 11:52:17 +02:00
Stephan de Wit
77036e161c firewall: cleanup previous 2024-10-18 15:49:51 +02:00
Stephan de Wit
c6a828f46e firewall: embed event count into throttled live log (https://github.com/opnsense/core/issues/7975) 2024-10-18 15:37:12 +02:00
Stephan de Wit
2e50dc12de firewall: throttle live logging (https://github.com/opnsense/core/issues/7975) 2024-10-18 10:43:18 +02:00
Ad Schellevis
70df0a15f7 firmware: fix timeout in update-crl-fetch.py 2024-10-17 20:05:13 +02:00
Ad Schellevis
372c9c9806 firmware: move debug exception messages to regular message flow for clarity (https://forum.opnsense.org/index.php?topic=43474) 2024-10-17 19:43:18 +02:00
Franco Fichtner
b72c6087a6 system: untrusted directory changed in FreeBSD 14 2024-10-16 14:48:10 +02:00
Ad Schellevis
c345e01de2 VPN: OpenVPN: Instances - support case insensitive strictusercn matching for instances, closes https://github.com/opnsense/core/pull/7862 2024-10-11 19:49:26 +02:00
Franco Fichtner
c26e9ee6f1 firmware: move CRL verification to config.sh
We still have to deal with output issues/errors but that's
for later.
2024-10-10 09:31:15 +02:00
Franco Fichtner
c42def9fa3 firmware: clean up code duplication using config.sh
Also provide an env_init() call for internal launcher commands
to set up relevant things.We do this to move the special libfetch
handling into the locked spot underneath the launcher.sh invoke.
2024-10-10 09:19:42 +02:00
Franco Fichtner
73bc8b6d12 firmware: refine edge case 2024-10-10 08:38:21 +02:00
Franco Fichtner
ffec0034b9 firmware: fix a typo 2024-10-10 08:33:21 +02:00
Ad Schellevis
d172f15ceb System/Trust - minor compat fix in certctl.py 2024-10-09 13:40:43 +02:00
Stephan de Wit
04f9e5cfc2
OpenVPN: Instances: add Require Client Provisioning option (#7956) 2024-10-09 10:46:43 +02:00
Franco Fichtner
a890e5f6e2 firmware: add other pkg mirrors to CRL check and connectivity audit 2024-10-09 10:28:52 +02:00
Franco Fichtner
d3a655f76b firmware: add CRL validation for business mirror 2024-10-08 14:39:04 +02:00
Ad Schellevis
bf6ce7a34c System: Trust - add crl bundle collector for updates 2024-10-08 13:43:23 +02:00
Franco Fichtner
954fc82f24 firmware: collect TLS hostnames to check
We will reuse this for CRL verification in a bit.
2024-10-08 13:35:47 +02:00
Franco Fichtner
a383331f57 system: improve context of changed/modified message in certctl.py 2024-10-08 08:41:20 +02:00
Ad Schellevis
9a33aeb07e system/trust - link location could be a file or link, but when it exists, it should be removed. fixes:
Scanning /usr/share/certs/trusted for certificates...
Scanning /usr/local/share/certs for certificates...
Traceback (most recent call last):
  File "/usr/local/opnsense/scripts/system/certctl.py", line 195, in <module>
    cmds[sys.argv[1]]()
  File "/usr/local/opnsense/scripts/system/certctl.py", line 152, in cmd_rehash
    os.symlink(src_filename, dst_filename)
FileExistsError: [Errno 17] File exists:
2024-10-07 19:47:25 +02:00