17621 Commits

Author SHA1 Message Date
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
Franco Fichtner
d4378f00b3 firmware: opnsense-update -Q now installs the tests set
Since the test set follows the kernel it would be better to just
support it in opnsense-update which is done.  "qyua" can use this
to bootstrap and we do not have to worry about fetch env for this
optional component as it cannot be installed from the GUI or console
menu.
2024-11-22 08:12:08 +01:00
Franco Fichtner
f8e8969a96 firmware: add minimal tests set implementation 2024-11-21 10:47:52 +01:00
Franco Fichtner
72018838d0 src: style sweep 2024-11-21 09:21:29 +01:00
Franco Fichtner
6603fb72ed firmware: hide PIPEFILE, LOCKFILE; some minor tweaks 2024-11-21 09:13:28 +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
ae97263e46 system: fix TOTP regression 2024-11-20 13:05:16 +01:00
Franco Fichtner
f36aacf08f firmware: use REQUEST to print a TLS/CRL usage hint
Also create output_text and output_cmd to allow for neater
firmware scripts with less duplication and use it in the
connectivity audit.
2024-11-20 11:14:04 +01:00
Ad Schellevis
fd236e0be5 System: Access: Servers - [https://github.com/opnsense/core/issues/8065] fix regression in a7104ab771 2024-11-19 15:04:27 +01:00
Franco Fichtner
74ec5c5f46 src: style sweep 2024-11-19 14:57:50 +01:00
Ad Schellevis
a7104ab771 System: Access: Servers - some logic changes for "Default groups" option https://github.com/opnsense/core/issues/8065
* we expect memberof instead of memberOf in our ldap responses, make sure we lowercase the response at all times
* make $memberof optional when pushing default groups

The scenario's we should support are the following:

1. groups are synchronized via ldap/radius and users are created when they don't exist, which means existing groups will be altered after login to equal "memberOf" + optional default group[s]
2. groups are not synchronized via ldap/radius, but default groups exist, in which case default group[s] will be added when not yet assigned, no groups will be removed
2024-11-19 13:50:19 +01:00
pieewiee
37c9deab89
feat(dhcp): add dhcp-socket-type option to Kea DHCP server (#8069)
* feat(dhcp): add dhcp-socket-type option to Kea DHCP server

This adds the ability to configure the DHCP socket type (UDP/Raw) in the
Kea DHCP server settings through the web UI.

- Added socket type field to model definition
- Added dropdown in general settings form
- Updated config generation to include socket type setting

* changed default value for dhcp_socket_type to raw

* bumped version number for KeaDhcpv4.xml
2024-11-19 12:05:29 +01:00
Ad Schellevis
e70cd0c611 System: Access: Servers - add "Default groups" option to add standard groups when a radius/ldap user logs in. closes https://github.com/opnsense/core/issues/8065 (fix ldap connector, remove read properties requirement) 2024-11-19 08:48:10 +01:00
Franco Fichtner
3a696d257d src: style 2024-11-19 08:11:36 +01:00
Franco Fichtner
f68ff83043 src: whitespace 2024-11-19 08:10:12 +01:00
Franco Fichtner
3cf5160e72 src: whitespace 2024-11-19 08:07:55 +01:00
Franco Fichtner
e6fb8194d0 src: whitespace 2024-11-19 08:06:23 +01:00
doktornotor
4c2619dead
Services: Intrusion Detection : limit stats.log logging(#7857)
* Reduce pointless logging

Mitigates https://github.com/opnsense/core/issues/7101

* Do not compress stats.log on log rotation

This reverts 55ac1715bf done for https://github.com/opnsense/core/issues/4085

Nothing else in OPNsense compresses the logs on rotation, the compression is very much pointless on ZFS with lz4 compression enabled by default, plus sanitizing the stats interval reduces the log size to a sane value, smaller than what was previously achieved by gzip on log rotation.
2024-11-18 21:31:39 +01:00
Ad Schellevis
a94e08ec66 Squashed commit of the following:
commit a59dc4394043aa5fce060426f13d965ab3c6679f
Author: Ad Schellevis <ad@opnsense.org>
Date:   Mon Nov 18 21:16:13 2024 +0100

    Services: Kea DHCP [new]: Leases DHCPv4 - minor cleanups for https://github.com/opnsense/core/pull/8053

commit 9986eca14c4ee72675bedc31953cefe60a6659cd
Merge: d23170c05 8d0ab40c5
Author: cpalv <13182421+cpalv@users.noreply.github.com>
Date:   Mon Nov 11 23:46:43 2024 -0600

    Merge branch 'opnsense:master' into mac-db

commit d23170c05f3d511000d8302dd2403c0761d757ac
Author: eddie <13182421+cpalv@users.noreply.github.com>
Date:   Mon Nov 11 23:45:16 2024 -0600

    Add MAC formatter, removed unclosed table row tag

    macformatter will include the hardware manufacturer info (if it exists) in the same table cell as MAC address

    removed unclosed 'tr' tag.  linked 'hwaddr' column to macformatter.  adjusted spacing

commit 04e7cf40ee809b3afdcc203d27cd3ed9cd9ff128
Author: eddie <13182421+cpalv@users.noreply.github.com>
Date:   Mon Nov 11 23:39:30 2024 -0600

    add MAC manufacturer info to dhcp lease record
2024-11-18 21:17:39 +01:00
Franco Fichtner
db8005b186 system: ignore monitor status on boot 2024-11-18 16:42:52 +01:00
Ad Schellevis
e40596e16e System: Access: Servers - add "Default groups" option to add standard groups when a radius/ldap user logs in. closes https://github.com/opnsense/core/issues/8065 2024-11-16 20:36:56 +01:00
Franco Fichtner
5f533d4573 src: scrub 2024-11-14 11:48:05 +01:00
Ad Schellevis
89ef336bd9 Trust: flush openssl.cnf to /etc/ssl/openssl.cnf as well (redux) 2024-11-14 11:45:33 +01:00
Franco Fichtner
9c08cd9abd src: style change 2024-11-14 11:42:11 +01:00
Franco Fichtner
d46b8e5766 firmware: debug output 2024-11-14 11:39:26 +01:00
Franco Fichtner
6efafb6d1b firmware: we write /etc/ssl/openssl.cnf now 2024-11-14 11:25:51 +01:00
Ad Schellevis
3f6cec92c4 Trust: flush openssl.cnf to /etc/ssl/openssl.cnf as well 2024-11-14 11:12:21 +01:00
Franco Fichtner
0d067d973a firmware: force CRL check on development deployment 2024-11-14 10:40:25 +01:00
Franco Fichtner
b24dbb8904 firmware: remove unused 2024-11-14 10:37:19 +01:00
Franco Fichtner
8a1965e094 firmware: move bogons fetch to firmware scripts
Be done with the retry and use the launcher.sh -r argument for
the cron-based execution.  Leave the backend commands where they
are.

Since the file had no copyright header looking at the old code
it looks like Bill and Scott worked on the file first in 2005.
Not really concerned with consecutive history here for lack of
creating a copyright header for so long.
2024-11-14 10:36:17 +01:00
Franco Fichtner
4d7f2616dd firmware: generalise the output handling
This also moves the initial output to the start of the script
again which clears and seeds the output file so the GUI picks
up the right operation immediately.  This was a problem during
CRL setup which may delay the execution too much.

Make the output_done() and output_reboot() both never return
which simplifies the code a bit.

There is more potential for improved output handling but for
the time being this should suffice to fix the current glitches.
2024-11-14 09:58:01 +01:00
Franco Fichtner
1a5e4b6922 firmware: changelogs did not take env 2024-11-13 16:23:56 +01:00
Franco Fichtner
567296b476 firmware: seems to make sense 2024-11-13 16:23:00 +01:00
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
Monviech
3b54ba517f
routing/gateways: Fix ipv4 and ipv6 validation not being displayed in the gateway form (#8060) 2024-11-13 14:54:11 +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
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