1677 Commits

Author SHA1 Message Date
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
Ad Schellevis
e648aefb76 Firewall: Automation: Filter - add gateway groups to the list, closes https://github.com/opnsense/core/issues/7625 2024-10-05 18:22:30 +02:00
Franco Fichtner
b563c223bf system: closelog() has timing issues
Not sure where this comes from but the concensus is that
closelog() is relatively useless and testing verifies that
it works as expected without it.

Now we just have to make sure that each component using
openlog() will reopen the actual GUI log so that it can
keep logging correctly.
2024-09-30 13:19:26 +02:00
Franco Fichtner
f3a8c28c0e firmware: remove escaped slashes workaround, works since 24.7.5 2024-09-27 10:25:47 +02:00
Ad Schellevis
429b8e38b2 System: Trust - optimize certctl.py to prevent unneeded disk writes and flush certificates to ports openssl location (/usr/local/openssl/certs) 2024-09-25 19:55:02 +02:00
Ad Schellevis
b709232e44 System: Trust: Authorities - finish crl fetch script for installed certificates and hook into form and cron updates.
According to rfc5280 an CRL update should be issued before "next update", but does not seem to define a validity. Various sources seem to indicate updates should be fetched at least every couple of hours, in which case an hourly update sounds reasonable.

To avoid excessive writes, we compare each CRL offered with the last one received before flushing it to disk and keep track of actual changes. When nothing changes, no rehash is neede, which the configd action takes care of.

Distribution points could either be HTTP or LDAP, LDAPS and HTTPS may not be used according to the RFC (CAs SHOULD NOT include URIs that specify https, ldaps, or similar schemes in extensions.)
2024-09-24 20:58:04 +02:00
Ad Schellevis
6f79579537 System: Trust: Authorities - (work in progress) crl fetch script for installed certificates.
The overal structure is there, but needs the final bits and pieces added to it. committing it now as a backup
2024-09-24 18:38:53 +02:00
Franco Fichtner
61e47d7f9a interfaces: fix undefined function error in Monit CARP script
PR: https://www.reddit.com/r/opnsense/comments/1fobode/daily_errors/
2024-09-24 15:01:59 +02:00
iain MacDonnell
2a1ccae959
System/Logging - handle lines with no timestamp (#7889)
Recent feature addition to apply time constraint fails in cases where
a log line does not contain a timestamp, as in the case of multi-line
log entries. This change just moves on when a line contains no
timestamp, as we will eventually find the line that contains the
start of the log entry (and the timestamp).

fixes #7888
2024-09-23 17:54:11 +02:00
Franco Fichtner
89f84780ff interfaces: full-cirle on vpn_map vs. vpn event
We actually only want the vpn_map event in the stable branch
and move to a backwards compatible format for 25.1 but as a
new coalesced (mapped) caller.
2024-09-18 12:10:46 +02:00
Ad Schellevis
922907a931 System: Trust: silence cryptography deprecation warnings 2024-09-13 20:08:53 +02:00
Ad Schellevis
0378c650d4
Add System: Trust: Settings page (#7854)
* System: Trust: Settings - add boilerplate and move existing store_intermediate_certs setting to new module including migration

* System: Trust: Settings - add configuration constraints and glue to flush CRL's to local trust store when requested.

This implements the following options:

* Enable/Disable legacy providers (enabled by default, which is the current default)
* Option to write specific configuration constraints, when enabled, CipherString, Ciphersuites and MinProtocol[DTS] can be configured

One last piece of the puzzle is the "crl" event action, which should deploy to the local trust store as well ehen requested.

* Update src/opnsense/mvc/app/models/OPNsense/Core/Menu/Menu.xml

Co-authored-by: Franco Fichtner <franco@opnsense.org>

* System: Trust: Settings - process review comments https://github.com/opnsense/core/pull/7854

* System: Trust: Settings - flush CRL's when "Store CRL's" is selected

---------

Co-authored-by: Franco Fichtner <franco@opnsense.org>
2024-09-10 21:15:11 +02:00
Ad Schellevis
c4d0dd6154 core / trust - add support for certificate bundles in our certctl.py script.
Since we deploy ca_root_nss in a directory with less priority, we can exclude the certificates already part of the base install.
When ca_root_nss contains a certificate not yet known in base, it will copy the certificate from the bundle in the "hashed" file, which also gurantees our packed bundles contain the same content as openssl would use by default.

While here, also include /usr/share/certs/untrusted, which contains the base blacklisted certs.
2024-09-09 20:14:07 +02:00
Ad Schellevis
ebddde95f4 System: Trust - temporary disable validation of multiple certs in a ca, as discussed in 76228b0a45 (r146422317) with @fichtner 2024-09-09 12:27:05 +02:00
Franco Fichtner
d08069699f openvpn|wireguard: close-on-exec 2024-09-06 08:34:32 +02:00
Ad Schellevis
033402265e core / trust - missed a spot in 76228b0a45 (not removing crl's) 2024-09-05 11:28:19 +02:00
Ad Schellevis
76228b0a45 core / trust - cleanup certctl.py script and move to python cryptography for generic functionality.
This commit adds support for deployment of CRL's, as the original implementation also does (but these files don't exist at our end at the moment).
Secondly it fixes a minor omission where cert files with more than one cert in them where not omitted.
2024-09-04 18:34:17 +02:00
Franco Fichtner
4421914442 system: update comment on temperature stats collection 2024-09-03 20:57:09 +02:00
Franco Fichtner
6f21218193 system: remove RRD temp read from temperature.sh 2024-09-03 14:48:07 +02:00
Franco Fichtner
2dbd793dfe reporting: add executable flag for lint reasons 2024-09-03 08:01:33 +02:00
Franco Fichtner
3476d11a0a reporting: scrub rrd.inc use 2024-09-02 21:27:26 +02:00
Franco Fichtner
fcd54e4549 shell: configuration is static here, no need to restart cron/rrd 2024-09-02 21:10:16 +02:00
Franco Fichtner
ecf987820d reporting: style sweep 2024-09-02 21:06:03 +02:00
Ad Schellevis
895e58ff25
Reporting / rrd - refactor existing code (#7836)
Add RRD package with a simple factory class and a basic construct to define different rrd output types we support.
This package contains the following:

* RRD/Types -- Output definitions, responsible for generating RRD structures and feeding data
* RRD/Stats -- Statistics gathering classes
* Factory -- binds types and statistics together. 

On my end on a simple test this is roughly 40% faster than running /var/db/rrd/updaterrd.sh, which makes caching of metadata (config access) less relevant.

The new script should be able to replace all existing rrd cruft and supports a debug mode to find discrepanties between defined outputs in types and collected data in stats.

```
Usage: updaterrd.php [-h] [-d]
            -d debug mode, output errors to stdout
```
2024-09-02 16:40:47 +02:00
Franco Fichtner
4c07de7e34 interfaces: remove deprecated "vpn" event
Everything has been converted and plugins do not ship with a
"vpn" event.  "newwanip" is similar and the plugins have been
ensured to be moved to the new one in 24.7.3 already.
2024-09-02 09:25:58 +02:00
Franco Fichtner
919fc15fe7 interfaces: rename this correctly, strictly part of pf(sync) 2024-09-01 10:54:46 +02:00
Franco Fichtner
ab3bf029ca interfaces: another cleanup 2024-09-01 10:51:23 +02:00