16131 Commits

Author SHA1 Message Date
Ad Schellevis
bb4cddda35 Firewall: Aliases - read before write in update_tables.py (minor stylefix) 2023-12-08 08:43:14 +01:00
Ad Schellevis
935c64295b Firewall: Aliases - read before write in update_tables.py.
Although in theory we should also be able to determine a change by looking at the alias and it siblings, it needs more parameters and is likely more difficult to read.
This commit should address the concerns of https://github.com/opnsense/core/pull/7057 by wrapping "read an alias content file" into a static method called "read_alias_file" and use it to determine change in both the resolv() {keeping track of this alias without siblings} and the one in update_tables.py {which is flushed to pf}
2023-12-07 17:45:44 +01:00
Franco Fichtner
52f3939106 firewall: preg_replace() nibbles away our non-catpure group; closes #7060 2023-12-07 13:22:58 +01:00
Franco Fichtner
39c1b358d1 firmware: change the changelog to always run through launcher.sh
Add -u option for this reason as we cannot afford to abort when
otherwise locked and here it also doesn't matter.  We could also
wait for the lock but this seems more beneficial and we can pick
up the correct environment as well, see 5c064a57090.
2023-12-07 10:17:16 +01:00
Franco Fichtner
5c064a5709 firmware: disallow TLS 1.0 and 1.1 on business mirror
On the mirror we control prevent the use of "legacy" TLS versions
to allow for better security.  This could be carried over to other
servers but since we don't controll most community servers this
could have negtive impact on availability depending on their config.

A quick sweep shows that all main functions check.sh, update.sh and
upgrade.sh use the launcher so that works as intended even from the
console.  Another audit is required for other firmware scripts and
situations where e.g. opnsense-update is called manually.  Ideally
all should go to launcher.sh or somehow be able to access the
required environment.
2023-12-07 09:51:11 +01:00
Franco Fichtner
3001316441 mvc: style sweep 2023-12-07 09:25:22 +01:00
Ad Schellevis
6bd5746e3f core / add configdStream action to ApiControllerBase and use it in our log viewer (https://github.com/opnsense/core/issues/6680). Sreaming might be practical in more cases, in which case it helps to isolate the functionality in our base class. 2023-12-06 11:49:54 +01:00
Ad Schellevis
f1024ebc06 crashreporter - safeguard /tmp/PHP_errors.log file before usage. 2023-12-04 18:28:07 +01:00
Ad Schellevis
bbf4bdb733 legacy/head.inc - cleanse system_get_language_code() 2023-12-04 17:47:32 +01:00
Ad Schellevis
0e3d660e18 Firewall: Aliases - read before write in alias resolve to spare unneeded diskwrites. (for https://github.com/opnsense/core/issues/6596)
Try to only save current alias content and md5 checksum when changed, but do update the md5 file modification date to ensore proper ttl handling.
2023-12-03 14:45:09 +01:00
Stephan de Wit
d73f4f7be4 MVC: flatten complex array structures for better search functionality
implode() dies when provided with arrays in arrays (on development),
so this is a good opportunity to extend the behavior a bit.

The consequence of this commit is that information that is not displayed
in a bootgrid, but still passed in as part of the dataset is also
searchable. This isn't a bad thing, but controllers still have
the option of constraining the amount of fields that should be
searched, as showcased here in interfacesInfoAction().
2023-11-30 16:45:17 +01:00
Franco Fichtner
f9a745f472 openvpn: evil newline 2023-11-30 14:06:17 +01:00
Franco Fichtner
2dad1a3690 openvpn: cope with display and fix copy+paste errors 2023-11-30 14:03:58 +01:00
cs-1
8e18956cc4
Add IPv6 to OpenVPN widget and status page (#7044) 2023-11-30 13:39:29 +01:00
Ad Schellevis
f2427d6173 core / log views - fix regression in selectpicker. closes https://github.com/opnsense/core/issues/7045
It looks like calling 'toggle' instantly after creation looses the contens of the actual select. This commit adds a timeout and keeps track if picker was already created or not.
2023-11-30 09:13:15 +01:00
Ad Schellevis
d662097d1d Dashboard : Reporting - OpenVPN server instances missing. closes https://github.com/opnsense/core/issues/7038 2023-11-30 08:41:52 +01:00
Ad Schellevis
041cf134f6 system - remote backup / add an optional random delay before executing remote backups, 3600 seconds max when executed automatically in the nighly run. ref https://github.com/opnsense/plugins/pull/3689 2023-11-29 18:05:58 +01:00
Ad Schellevis
bcc067cb7c configd - constraint user actions to members of the wheel group.
It's a bit of an experiment, but likely low risk due to the amount of callers.
These are being used by our login sequence as our usual suspects all run as root, this shouldn't cause any interference.

requires 86c1087dd6 to function.
2023-11-29 17:46:37 +01:00
Ad Schellevis
b5d0ab2d91 plist-fix 2023-11-29 17:36:05 +01:00
Ad Schellevis
86c1087dd6 configd - implement optional trustmodel and add extended logging, closes https://github.com/opnsense/core/issues/6647
Use socket.LOCAL_PEERCRED to fetch the callers credentials so we are able to log system (shell) users calling our configuration engine.
Messages are send to our Audit log using severity informational (action succeeded) or error (not allowed or unknown action), this needs a small change in our syslog template to exclude the audit messages (included in this commit).

While here, also add a general overwrite for settings that should apply for all actions, as this would ease applying future default restrictions for all actions.
Action defaults can be set in configd.conf using the following construct:

[action_defaults]
allowed_groups = wheel

To require group membership, the `allowed_groups` option is added to the action, when set, the connected user should be a member to at least one of the mentioned groups. For example, to require wheel membership for a call "echo", the configuration might look like this:

[echo]
command:echo
parameters:%s
type:script_output
allowed_groups = wheel

Finally, remove the simulation mode for the configd service as this is less useful nowadays.
2023-11-29 17:34:36 +01:00
Franco Fichtner
829ae3dd9a system: try not to taint the root shell
If someone strips root of the admin privilege don't try
to pry away the root shell as well.  None of this really
works well in practice.
2023-11-29 12:31:02 +01:00
Franco Fichtner
a0581ae0f6 system: prevent activating shell for non-admins
Our policy has always been that shell access should not
not be granted to untrusted users.  Apparently this is
also a way to wedge in security reports stemming from
this misconfiguration while glossing over this point and
focusing on something else found in the file system.

If you need access for a user just give them full admin
privileges and that's fixed. For everyone else no longer
render the shell and add a warning in the user edit page.
2023-11-29 12:16:53 +01:00
Franco Fichtner
7245d294ac firewall: annotate a special edge case 2023-11-29 11:40:04 +01:00
Franco Fichtner
6e938bd0c7 firewall: add an ifconfig.debug file
We seem to be missing some context regarding rule generation
so as a first step try to provide a matching ifconfig set with
the rules to diff in order to make debugging easier.

PR: https://forum.opnsense.org/index.php?topic=37248.0
2023-11-29 10:11:01 +01:00
Franco Fichtner
4d50a8e062 wireguard: reload filter if we modified a device
PR: https://forum.opnsense.org/index.php?topic=37248.0
2023-11-29 10:08:04 +01:00
Franco Fichtner
99a1f2ac9d interfaces: guard this like interface_configure()
We shouldn't flush what appears to be tunnel interfaces and
the VIPs are handled separately anyway.
2023-11-28 12:02:17 +01:00
Franco Fichtner
435e69719e
interfaces: refactor interface_bring_down() into interface_reset() and interface_suspend() #6852 (#7040)
Separate use cases to allow for clean non-removal of static addressing
(including CARP VIPs) for use in rc.linkup et al.  While interface_bring_down()
is more or less only being extended with $suspend the journey of this code
change was long and winding. Therefore remove the old ambiguous function
and introduce the new interface_reset() and interface_suspend() variant to
make more sense of the caller's requirements.

interfaces.php is a special case depending on interface enable state so we
pass the $suspend request down to interface_reset() to avoid an if-else
dance.
2023-11-28 11:51:15 +01:00
Franco Fichtner
7e95b9d133 mvc: style sweep 2023-11-27 16:26:59 +01:00
Stephan de Wit
5da37a7fac
interfaces: revamp overview page (#7019)
This commit omits some of the link-specific information such as ppp uptime, disconnect/release mechanism, as well as wireless and bridge information. Since there is more of this type of information available than was originally being handled by get_interfaces_info(), perhaps it makes more sense to extend the backend script with the relevant bits in time.
2023-11-27 15:52:04 +01:00
Franco Fichtner
e90571fe6b mvc: style sweep 2023-11-27 08:38:59 +01:00
Ad Schellevis
ef1d1552bf auth - improve config revision auditability, closes https://github.com/opnsense/core/issues/7033
This commit contains the following changes to improve revision visibility.

* add username and api token for external (non-gui) callers.
* offer the ability to merge revision information into configuration saves. (getRevisionContext / setRevisionContext)
* merge session attributes starting with xrevision_ into a revision item, for example. xrevision_impersonated_by would be recorded as impersonated_by
* add "impersonated_by" to audit log when specified (for future use)
* remove revision attributes before adding, this prevents attributes sticking around.
2023-11-26 18:37:40 +01:00
Ad Schellevis
7f6ac2ae6c KEA DHCP - add xmlrpc sync for https://github.com/opnsense/core/issues/6971 2023-11-26 11:01:32 +01:00
Maurice Walker
e1682cc306 openssh: include IPv6 link-local interface addresses
I tested this, a link-local ListenAddress works fine.
2023-11-25 21:31:03 +01:00
Maurice Walker
9ef93c1b78 webgui: include IPv6 link-local interface addresses
Link-local works, lighttpd supports this since at least 1.4.41.
2023-11-25 21:31:03 +01:00
Stephan de Wit
74a9f11b9a web proxy: typo 2023-11-23 15:24:45 +01:00
Franco Fichtner
9ea0f7d6ef web proxy: prep for #7030
The plugin package is "os-squid" fitting better into the naming
conventions.  With "DNS" and "DHCP" following a similar naming
convention start stuffing "Squid" before menu name and descriptive
labels so users can find it using any desireable key word and
the documentation doesn't have to change (much).
2023-11-23 13:36:29 +01:00
Franco Fichtner
c404e662fa web proxy: not less code but better strucuture
Find out which directory we want and keep it in an array.
Use the first one that exists and ignore the others.  This
allows us to do a late fallback into "en" language on top
which wasn't handled gracefully before.
2023-11-23 13:26:47 +01:00
Ad Schellevis
cee33f5393 Firewall log - prevent memory exhaustion using the new streaming functions. closes https://github.com/opnsense/core/issues/6680 2023-11-22 21:56:50 +01:00
Ad Schellevis
28b99101d4 MVC : Backend - split configdRun() in order to return a resource which the controller can stream with minimal memory consumption.
To be used in combination with 42fd27df77
2023-11-22 21:56:50 +01:00
Franco Fichtner
9e26e00eac src: style sweep 2023-11-22 21:26:10 +01:00
Ad Schellevis
af46866998 VPN: IPsec: Connections - remote authentication. Add support for radis class groups, fix missing mapping in 928d2f8299 for https://github.com/opnsense/core/issues/3295 2023-11-22 18:39:50 +01:00
Ad Schellevis
1dab8ca715 Services / DHCP - rename DHCP to ISC DHCP 2023-11-22 18:28:50 +01:00
Ad Schellevis
42fd27df77 configd - support streaming output using the "stream_output" handler.
This commit adds the connection to the action.execute() method which offers the ability to flush data back to the client instantly without having to wait for the call to end. As the existing types are only slighly modified, the impact of this change should be rather low. To demonstrate the streaming capability, also adjust configctl to flush output when received.

Example usage:

[find]
command:find / ; xxx
parameters:
type:stream_output
message:test stream output
2023-11-22 18:15:13 +01:00
Franco Fichtner
99fcbaf933 system: one more that is annoying 2023-11-22 14:33:48 +01:00
Franco Fichtner
ac0dc0ff89 firewall: fix bootstrap-select update fallout
data-width="auto" use is probably still broken in a few places
but better fix these per user report.
2023-11-22 14:30:32 +01:00
Ad Schellevis
928d2f8299 VPN: IPsec: Connections - remote authentication. Add support for radius class groups. closes https://github.com/opnsense/core/pull/6826
Add groups attribute to remote auth, to avoid random input hook the names to our local account management and require the user to create a local group first, which is similar to other areas of our system. We don't have to store the membership in this case in our local user db.

Only enable "class_group" attribute when there is at least one enabled connection using these groups.
2023-11-22 14:00:00 +01:00
Franco Fichtner
020cac564b interfaces: fix slectpicker sizing 2023-11-22 12:17:52 +01:00
Ad Schellevis
286ed62e6e VPN: IPsec: Connections - add aes256-sha256 without PFS to the list, closes https://github.com/opnsense/core/issues/6928 2023-11-22 11:40:15 +01:00
Franco Fichtner
9d818e51e6 system: refactor get_single_sysctl() while here #6969 2023-11-22 09:59:25 +01:00
Franco Fichtner
ace7740da0 openvpn: multi-line text in XML has clear disadvantages
... for the translations embedding all kinds of weird whitespace
pattern that cause syntax errors in gettext compile worst case.
2023-11-22 09:36:40 +01:00