5733 Commits

Author SHA1 Message Date
Ad Schellevis
37a32842fd System: Routes: Configuration - add support for rfc5549, missing implementation part for https://github.com/opnsense/core/issues/8157
When specifying different protocols for target network and gateway address, add protocol prefixes to both.
2024-12-30 16:03:59 +01:00
Ad Schellevis
3cbea52267 System: High Availability - XMLRPC Client / replace file_get_contents() with curl implementation, closes https://github.com/opnsense/core/issues/7561
While here, also offer optional peer tls verification as this is/was disabled by default.
In most cases verification isn't very relevant when using a direct attached neighbor, but if someone has infrastructure in between, extra safeguards are now possible.

With this inplace, allow_url_fopen can safely be disabled on our end (which was the primary goal here).
2024-12-24 13:54:59 +01:00
Loganaden Velvindron
e0e7e0b638
Update ICANN Trust Anchor to include the new one which will be active in 2026 (#7852)
Signed-off-by: Jagveer Loky (jagveer@cyberstorm.mu)

Signed-off-by: Jagveer Loky (jagveer@cyberstorm.mu)
2024-12-21 09:25:29 +01:00
Ad Schellevis
514f87adb8 System: Access: Users - remove support for local passwords
Since https://github.com/opnsense/core/issues/998 we support our authenticators for all service types, for backward compatibility reasons we kept default unix authentication available, since this is hardly used anymore, after 8 years it's time to deprecate this option.
2024-12-19 12:59:54 +01:00
Ad Schellevis
7169b29e0b System: Access: Users - allow long usernames for non local users (without a shell account), for https://github.com/opnsense/core/issues/7904
With the new mvc code inplace, it's also a good idea to loosen the constraints for some accounts. One of the mail advantages is that we can now user email addresses as usernames for most services.
2024-12-19 12:07:30 +01:00
Ad Schellevis
6a7352e528 authentication - remove expireaccounts script which has been disfunctional for some time, accounting for expirey is the responsibility of the authenticator.
ref: 252fd04811/src/opnsense/mvc/app/library/OPNsense/Auth/Local.php (L161-L162)
2024-12-19 10:09:26 +01:00
Ad Schellevis
ee269a1991 Services: Kea DHCP: Kea DHCPv4 - align hostname validation with manual host entries (support RFC2181), closes https://github.com/opnsense/core/issues/8128 2024-12-18 09:19:09 +01:00
Franco Fichtner
7f61f1b80a firmware: new fingerprint for 25.1 2024-12-17 11:15:31 +01:00
Franco Fichtner
ec4277c9aa src: style 2024-12-17 08:52:34 +01:00
Franco Fichtner
76076a9431 src: style 2024-12-17 08:49:38 +01:00
Franco Fichtner
a4d047918f src: style 2024-12-17 08:48:32 +01:00
Franco Fichtner
9b0e211213 filter: minor style 2024-12-17 08:46:19 +01:00
Franco Fichtner
ef8ed9cc26 src: style sweep 2024-12-16 08:57:50 +01:00
Ad Schellevis
e190e9c138 System: High Availability: Status - backend code for https://github.com/opnsense/core/issues/7899
This commit wraps our xmlrpc functions via configd and wires them via an api controller.
In the long run we should consider moving to RESTful interfaces, but for now we will keep and cleanup the xmlrpc code.

configd action "system ha services_cached" caches the service list for a couple of seconds to improve searchability via our standard grid functions.
2024-12-15 20:09:09 +01:00
Franco Fichtner
c7036be53c dhcp: allow radvd to use /128 CARP VIP as source
The check is for the subnet use, not the CARP source check in
between.

PR: https://forum.opnsense.org/index.php?topic=44634.0
2024-12-13 15:18:55 +01:00
Ad Schellevis
002b450c40 cleanup - fix some php notices, closes https://github.com/opnsense/core/issues/8125 2024-12-11 16:15:31 +01:00
Ad Schellevis
be8841d9af util:legacy - ignore plugins_interfaces() errors in write_config() when called without sufficient imports (missing libraries in registered plugins).
Scripts like https://github.com/opnsense/core/blob/master/src/etc/rc.expireaccounts will die horribly at the moment when there's actual work to be done (although this example should likely be rmeoved for 25.1 anyway)
2024-12-11 15:54:02 +01:00
Franco Fichtner
f4b9017cd9 unbound: make this workaround permanent
This bundle file is here for general consumption and the time it
has already taken to debug this issue is not justifiable for
pursuing the matter any further.  Other approaches regarding
chroot and directory sharing are likely going to be much more
code which would make another solution more fragile as well.

While here remove a strange directory in the chroot that is not
even used.
2024-12-04 14:44:58 +01:00
Franco Fichtner
9c0b50aa63 system: kill this comment annotating code that does not reall exist anymore 2024-11-25 13:38:52 +01:00
Franco Fichtner
0f5c35940d firewall: remove faulty exclusion
'if' is a device name and can never match.  Possibly defunct since
2008 when 'ip' was used but 'ipaddr' would have been the right key.

The code is long gone on the other end too.

See: https://github.com/pfsense/pfsense/commit/ce24005a17
Also see: https://github.com/pfsense/pfsense/commit/40aa6f207
2024-11-25 13:33:51 +01:00
Franco Fichtner
a0b86b43e2 interfaces: remove PPP edit in interfaces settings #7446
Time to ditch this.  Leave a thin dialog for the ports display
and where to access the actual PPP settings.

page-getserviceproviders now folds into page-interfaces-ppps-edit
and remove only once use functions to edit page as well.
2024-11-25 11:11:11 +01:00
Ad Schellevis
cb6ec88a16 Interfaces: Wireless: Devices - try to remove mac trickery for hostapd for https://github.com/opnsense/core/issues/8079
All of this stuff looks really old, it seems to originate from 864bf77420, which might be an issue that doesn't actually exist anymore..
2024-11-22 08:50:09 +01:00
Ad Schellevis
78cf96c579
System: Access: migrate Users and Groups to MVC/API (#8046)
* 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.

* System: Access: Users - refactor to MVC (https://github.com/opnsense/core/issues/7904)

* add initial boilerplate
* unpack `<priv/>` field on first access
* unpack '<apikeys/>' field on first access and implement key actions into ApiKeyField
* add apikey grid in user management view
* change isset() to !empty() for users disabled flag in backend code
* move user atributes into dialog
* hook PrivField type to \OPNsense\Core\ACL()
* refactor Auth/API to use new User class
* otp seed logic  with simple api call to generate new seeds and some JS glue for the frontend
* uid autonumber field
* language selector using get_locale_list() via configd (cached)
* add StoreB64Field field for authorizedkeys so we can keep the field contents backwards compatible.
* ExpiresField for custom date parsing, supporting previous input formats as well.
* group membership using a volatile custom field type, controller is responisble for persisting the configuration data to avoid entanglement between models
* add button which links to most likely user certs (based on commonname), to avoid all sorts of magic to reflect certs back into the usermanager.
* add getUserPrivs() to model so we can fetch a full list of privs for a user
* show user icons, long this might be less relevant
* add addApiKeyAction() to create a new api key for a user (by name)
* download new api key from user view
* implement hashing when setting a new (or scrabled) password
* use new "auth sync user" event to trigger local user db changes
* in API authenticator keep createKey and dropKey as stubs to the new model implementation
* prevent removal of "system" users (root)
* hook ACL and Menu
* add Group administration using the same logic as users
* cleanup unused
* add System: Access: Privileges to manage and change user and group privileges

* System: Access: Users - refactor to MVC (https://github.com/opnsense/core/issues/7904)

review comments from @Monviech

* "Create and Download API Key for this user" refresh apikeys bootgrid
* "Users" bootgrid, add some columns
* rename "Username" to "Group Name" in group edit
* Disable sorting the bootgrid by "Users" and "Groups" as these are aggregated/formatted columns

* System: Access: Privileges - fix updating groups dropping privileges for https://github.com/opnsense/core/pull/8046

* System: Access: Users - hook group model for https://github.com/opnsense/core/issues/7904

* System: Access: Users - add some safety fences to prevent accidental removal of rights https://github.com/opnsense/core/issues/7904

* Update src/opnsense/service/conf/actions.d/actions_auth.conf

* Update src/opnsense/service/conf/actions.d/actions_auth.conf

* System: Access: Users - remove userDNmap support as it belonged to the import https://github.com/opnsense/core/issues/7904

* System: Access: migrate Users and Groups to MVC/API (https://github.com/opnsense/core/pull/8046), review comments

* System: Access: migrate Users and Groups to MVC/API (https://github.com/opnsense/core/pull/8046)

o align "policy change for %s unlink group" with master (unlink when duplicates exists)

* System: Access: migrate Users and Groups to MVC/API (https://github.com/opnsense/core/pull/8046)

refactor add user event so it utilizes our new model instead of direct config access, while performing the operation, also make sure we lock/unlock the config.xml

* System: Access: migrate Users and Groups to MVC/API (https://github.com/opnsense/core/pull/8046)

replace page-system-groupmanager-addprivs with page-system-usermanager-addprivs

* plist

---------

Co-authored-by: Franco Fichtner <franco@opnsense.org>
2024-11-21 08:50:01 +01:00
Franco Fichtner
db8005b186 system: ignore monitor status on boot 2024-11-18 16:42:52 +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
c30b46bd27 wireguard: captain obvious left the building 2024-11-11 12:24:31 +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
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
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
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
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
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
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
85bde6565c System: Access: Users - change isset() to !empty() for disabled status in preperation for https://github.com/opnsense/core/issues/7904 2024-10-24 19:41:01 +02:00
Ad Schellevis
9e01cc3191 Firewall: Settings: Advanced / syncookies - make lo0 state uncondition again as discussed with @fichtner (https://github.com/opnsense/core/issues/8008) 2024-10-24 11:32:43 +02:00
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