5687 Commits

Author SHA1 Message Date
Ad Schellevis
e7e7e57dc1 Firewall: Settings: Advanced / syncookies - make stateless loopback rule conditional as a temporary solution and add a clear note about the state requirement. closes https://github.com/opnsense/core/issues/8008 2024-10-23 20:19:25 +02:00
Franco Fichtner
3d34e7e54e firmware: restart cron on updates
Specifically to deal with new RRD situation but it looks like an
old oversight not to reload here anyway.
2024-10-21 09:50:52 +02:00
Ad Schellevis
ab0fc39a40 interfaces - parse part of sfp module information in legacy_interfaces_details(), adds 'module temperature' and 'lane X' information as well.
`ifconfig` passes the information from `sfp.c` [1], which is has a fixed structure we can parse on our end.

[1] 6fbe7e4dd1/sbin/ifconfig/sfp.c (L75-L76)
2024-10-20 17:29:32 +02:00
Ad Schellevis
cca972c05b interfaces - parse part of sfp module information in legacy_interfaces_details(), closes https://github.com/opnsense/core/pull/7986
`ifconfig` passes the information from `sfp.c` [1], which is has a fixed structure we can parse on our end.

[1] 6fbe7e4dd1/sbin/ifconfig/sfp.c (L75-L76)
2024-10-19 10:02:01 +02:00
Ad Schellevis
2fb7965934
System: Settings: Administration - add RekeyLimit with a limited set of choices. In some regulated environments the openssh defaults are not acceptable, in which case we might need to offer some choices. (#7970)
Since RekeyLimit specifies both data and time and we don't want to overcomplicate things, it might be best to just offer some (pre validated) options.
2024-10-14 14:22:29 +02:00
Ad Schellevis
7e60e9f014 System: Access - Restructure ACL privilege handling so we can simplify storage for https://github.com/opnsense/core/issues/7904
Currently both users and groups store multiple <priv/> tags within the same container, but if we want to use MVC structures, we need to move to a single container to hold the access roles for them.
Our common seperator is a comma (,) which is not used in acl tags as these are not valid within xml tags anyway, by supporting both the future storage privA,privB and the current one we can feed this change easily in a future minor release without having to move all new mvc code already.

After this change, a config.xml may contain (combinations of):

   <priv>page-X</priv>
   <priv>page-Y</priv>

   <priv>page-X,page-Y</priv>
2024-10-13 16:19:27 +02:00
Stephan de Wit
b9b2a10ba2 plugins: invert volatile check 2024-10-02 15:26:15 +02:00
Franco Fichtner
ce1fae3913 interfaces: go full circle on newwanip even handler
The use of plugins_argument_map() makes it fully backwards
compatible now although external callers need to cope with
the new reality of handling arrays (maps) going forward with
25.1 to avoid having two events one of which slows down the
processing.
2024-10-01 08:15:27 +02:00
Franco Fichtner
f4e13c2a6a interfaces: refactor previous slightly 2024-10-01 07:41:15 +02:00
Monviech
f8d0ca5e1c
vxlan: fix interface being busy when vxlanlocal or vxlanremote is changed (#7872)
* vxlan: fix interface being busy when vxlanlocal or vxlanremote is changed.
2024-09-30 17:19:52 +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
1d8e5fec36 plugins: improve the pattern handling in devices
Always bootstrap (an impossible) pattern to match devices.  On the
console end try the implied method now.
2024-09-30 07:46:21 +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
Franco Fichtner
8684443b65 plugins: enforce defaults on devices 2024-09-24 12:40:11 +02:00
Franco Fichtner
123eed8963 openvpn: squelch a PHP warning 2024-09-24 08:38:34 +02:00
Franco Fichtner
23bf1ee05d interfaces: update the style of the newwanip calls 2024-09-24 07:43:00 +02:00
Ad Schellevis
bd037cc655 logging: remove closelog() from auth_log(), in some cases this seems to silence successive lines from the feed for some reason and closelog() doesn't seem needed anyway 2024-09-23 10:57:41 +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
Franco Fichtner
5fe06a19ba unbound: port to plugins_interface_map() 2024-09-18 11:57:05 +02:00
Franco Fichtner
388281afaa openvpn: port to plugins_argument_map() 2024-09-18 11:51:02 +02:00
Franco Fichtner
9ad018f580 ipsec: port to plugins_interface_map()
There was a typo here, too.  But it also wasn't fully tested
yet and not in 24.7.x yet.
2024-09-18 11:36:48 +02:00
Franco Fichtner
6e1be9df8a openssh: port to plugins_argument_map() 2024-09-18 11:32:18 +02:00
Franco Fichtner
9d154beea2 system: port web GUI to plugins_argument_map() 2024-09-18 08:54:44 +02:00
Franco Fichtner
2c718a54f7 dhcrelay: refactor for plugins_argument_map() use
Shift names around a bit more to make it clearer why we sometimes
handle IDs and other times interfaces and how they relate to each
other.
2024-09-18 08:47:26 +02:00
Franco Fichtner
01e3d9eccc dhcrelay: *_interfaces() is reserved and should not be used here 2024-09-17 08:26:00 +02:00
Franco Fichtner
842075ca06 interfaces: move legacy RFC2136 to plugin hook
We can't remove it now and we can't widen the call since local
and newwanip_map are mostly the same, but also different.

Use the selector trick to just invoke what we need and lose the
configd error.

PR: https://www.reddit.com/r/opnsense/comments/1fi5mw3/rfc2136_errors_in_audit_log/
2024-09-16 16:49:13 +02:00
Stephan de Wit
630d380728 system: typo in previous 2024-09-16 10:36:54 +02:00
Franco Fichtner
05739a0898 system: improve previous and widen its use 2024-09-16 10:13:16 +02:00
Stephan de Wit
4f6b9ec726
system: make dpinger_configure_do map aware (#7867) 2024-09-16 10:01:53 +02:00
Franco Fichtner
0176a47c36 interfaces: refactor a bit for PPP 2024-09-16 08:50:43 +02:00
Franco Fichtner
af62c482e2 interfaces: add 'spoofmac' device option and enforce it
PR: https://forum.opnsense.org/index.php?topic=42798.0
2024-09-14 13:37:17 +02:00
Franco Fichtner
fc0466fa88 interfaces: put back arcane gateway definition as it seems to work for some
PR: https://forum.opnsense.org/index.php?topic=42803.0
2024-09-13 10:18:05 +02:00
Franco Fichtner
0d951209e5 interfaces: 6RD/6to4 route creation should be limited to IPv6 2024-09-12 22:15:07 +02:00
Franco Fichtner
a85bd197c2 system: make system_routing_configure() deal with interface maps 2024-09-12 22:13:26 +02:00
Franco Fichtner
bb9353dba9 plugins: add plugins_argument_map() helper
This helper parses "mapped" arguments for batch reloads of e.g.
interfaces or devices or items related to that (like gateway
names).  The rules are simple:

o If the mapped argument is null reload in full (return true)
o If the mapped argument is an array handle it under later conditionals (return true)
o If the mapped argument is of an unsupported type do nothing (return false)
o If the mapped argument is not null but empty do nothing (return false)
o If the argument is a string convert it to an array, splitting the string
  by comma (return true)
o Modify the $map argument to be either null or a non-empty array to normalize
  the passed map (also for backwards-compatible reasons of newwanip_map
  and vpn_map intermediate steps).
2024-09-12 22:06:41 +02:00
Franco Fichtner
a610cf8ed2 plugins: make an important note 2024-09-12 10:09:33 +02:00
Franco Fichtner
3dd3c9fe6f interfaces: annotate future plans 2024-09-12 09:49:56 +02:00
Franco Fichtner
e8212a6116 src: more whitespace 2024-09-11 06:55:15 +02:00
Franco Fichtner
76f84fdf67 src: style and stuff 2024-09-10 21:43:38 +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
Franco Fichtner
2c2a2dbcc2 system: remove unused $bootup flag in dpinger_configure_do() 2024-09-09 09:52:49 +02:00
Franco Fichtner
87b8999d99 network time: reduce diff with previous, change to query property 2024-09-03 12:48:57 +02:00
doktornotor
7f0871c21f
Enable restrict noquery by default for ntpd (#7830)
See #7832
2024-09-03 10:59:18 +02:00
Franco Fichtner
3476d11a0a reporting: scrub rrd.inc use 2024-09-02 21:27:26 +02:00
Franco Fichtner
89a97ddb28 system: remove rrd_create_gateway_quality(), it's gone? ;) 2024-09-02 21:15:59 +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
54ccb747cd system: handle stale "pfsyncinterfaces" and improve workflow
PR: https://forum.opnsense.org/index.php?topic=42549.0
2024-09-02 12:03:24 +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
0e2812220d interfaces: drop the unmapped events from newwanip scripts 2024-09-02 09:17:29 +02:00
Franco Fichtner
f24d93b8ea openvpn: forgot to switch to mapped event 2024-09-02 09:16:50 +02:00