604 Commits

Author SHA1 Message Date
Ad Schellevis
4b4572c159 fix plist 2022-11-02 14:50:39 +01:00
Ad Schellevis
f573082418
Virtual IP MVC/API conversion (#6105) (#6109)
Refactor status page, replace menu registration and add ACL
2022-10-29 14:22:45 +02:00
Ad Schellevis
7d4597efe5
Virtual IP MVC/API conversion (#6105)
closes #5984 refactors legacy pages, includes the following:

o remove type field as this seems to be redundant and confusing
o input form additions (show hide related fields)
o add button for carp type to select first unused vhid
o implement configure action, caching removed addresses in /tmp/delete_vip_{$uuid}.todo files (by the controller)
o add mode filter to search action and complete with relevant fields for our grid
o fix warning in interfaces.inc (interface_proxyarp_configure()), array creation issue
o add validation for addresses used in port forwards and outbound nat rules. previous version tried to rename forwards, we choose to be consistent when it comes to edit/delete.
o change ACL to use the new endpoints, remove "show only" ACL. we can always consider putting it back later, but the experience of only able to reach the grid likely won't be practical.
o remove old firewall_virtual_ip*.php files
2022-10-26 16:42:46 +02:00
Franco Fichtner
2643985eb0 unbound: start dnsbl script earlier to stay clear of carp/cron 2022-10-21 08:58:31 +02:00
Stephan de Wit
d14ffae466
unbound: rework DNSBL implementation to python module (#6083)
Replaces the current blocklist implementation to use python instead of relying on unbound-control. The latter had the drawback of a very long execution time to administrate the local-data entries both locally and in Unbound. The memory footprint was also considerably larger due to unbound internals, while the python module keeps it all in memory in a simple dictionary - reducing the total amount of memory consumption by more than a factor of 10. A drawback is a potential decrease in performance of ~15%, although most setups shouldn't be affected by this as most hardware which is capable of running this should be scaled towards its intended use.

The option of returning NXDOMAIN has also been added (fixes #6027), which in this implementation is a lot easier than what we would have to do if local-data were to be used.
2022-10-14 17:02:23 +02:00
Franco Fichtner
f70b71ce12 ipsec: style sweep 2022-10-10 20:23:26 +02:00
Ad Schellevis
0adf843ff6
VPN / IPsec - migrate ipsec.conf to swanctl.conf (#6076)
* VPN/IPsec - work in progress refactoring ipsec.conf to swanctl.conf for https://github.com/opnsense/core/issues/5636

Wrap the following blocks in functions:

o generation of strongswan.conf
o write and cleanup IPsec's CA database
o write certificates used by IPsec
o write RSA Key Pairs
o construct ipsec.secrets for swanctl, combining different sources, phase1 PSK's, certificates, keypairs
o replace VPN: IPsec: Lease Status with new mvc version that uses swanctl underneath

Remap ipsec.conf to swanctl.conf attributes using https://wiki.strongswan.org/projects/strongswan/wiki/Fromipsecconf

Remove lifetime defaults from phase 1 and 2 so new connections will use Strongswan's defaults and move the option in phase above Margintime/Rekeyfuzz as these combined are being migrated (see margintime in Fromipsecconf doc).

Restructure used path directives so we can use the default structure as descried in https://docs.strongswan.org/docs/5.9/swanctl/swanctlDir.html and installed via ports.

IPsec status overview needs a small fix as well (passthrough network seems to be returned by vici, but doesn't contain a class (which crashes list_status.py).)

While here, also remove some php warnings.
2022-10-10 19:52:36 +02:00
Ad Schellevis
9448b0cacc IPSec: move user PSK and legacy PSK items to new PSK mvc module. closes https://github.com/opnsense/core/issues/4614
There is some overlap in https://github.com/opnsense/core/issues/5636 as this cleans-up ipsec.conf further.
2022-10-02 19:49:21 +02:00
Stephan de Wit
346cc08c99
Unbound: addition to advanced rework (#6053)
Small addition to https://github.com/opnsense/core/pull/6050:

- Move private/insecure domains to advanced as its intended use has a larger scope than DNSBLs only. Fixes https://github.com/opnsense/core/issues/5256
- Extends the migration to also include these domains.
- leftover cleanup of legacy settings in migration.
- Adds the `serve-expired-reply-ttl`, `serve-expired-ttl`, `serve-expired-ttl-reset`, `serve-expired-client-timeout` options. These options are hidden until the `serve-expired` checkbox is checked, and indented to signify a relationship.
- Removes all dropdowns and instead provides numeric fields to input raw values for more control and less "guessing" of what is acceptable.
- Removes default settings to prevent mismatches with upstream in the future. It's probably best to refer to the Unbound documentation in our own documentation.
- Previously, `rrset-cache-size` and `outgoing-range` were implicitly set. These are now input fields. The migration code will take care of legacy setting assumptions.

Fixes https://github.com/opnsense/core/issues/5978
Fixes https://github.com/opnsense/core/issues/5795
2022-09-30 17:08:34 +02:00
Franco Fichtner
65be7fb0a8 system: remove legacy syslog file 2022-09-28 14:47:49 +02:00
Stephan de Wit
33a253a748 unbound: finish up unbound/advanced MVC conversion 2022-09-27 14:34:02 +02:00
Stephan de Wit
d2b18299b4 unbound: advanced page MVC migration prep 2022-09-27 14:34:02 +02:00
Franco Fichtner
08e39cb0df src: style sweep 2022-09-01 12:41:26 +02:00
Stephan de Wit
cc6efa4a16
Reporting / Traffic: Upgrade chart.js to v3.9.1 and improve UX (#6000)
* Reporting / Traffic: Bump chart.js version and improve UX
2022-09-01 10:21:15 +02:00
Ad Schellevis
d0ea4449b2 plist 2022-08-30 17:36:14 +02:00
Franco Fichtner
7601e9cab3 pkg: fix plist 2022-08-28 20:51:12 +02:00
Ad Schellevis
92910cb4e8 fix plist 2022-08-28 15:47:13 +02:00
Ad Schellevis
f78e8fa229 fix plist 2022-08-27 21:53:01 +02:00
Franco Fichtner
e6ef454fa8 interfaces: signal address flush through rc.newwanip #5933 2022-08-15 12:14:48 +02:00
Franco Fichtner
e688d3b6fa firmware: revoke 22.1 fingerprint 2022-08-08 11:17:38 +02:00
Franco Fichtner
cf88dbbdd7 pkg: fix plist 2022-07-31 20:46:39 +02:00
Franco Fichtner
83524325fc pkg: fix plist 2022-07-28 10:03:42 +02:00
Stephan de Wit
f8650c76aa
System Status: replace old notices system with a global one (#5875)
* MVC / System status: first draft for backend implementation

* fix copyright

* fix permissions

* MVC / System Status: modify backend implementation and setup front-end

* MVC / System Status: minor cleanup, ACL check and fix reporting in production mode

* MVC / System Status: copy status sytem to legacy as well, remove the notices system, finish up front-end work

* MVC / System Status: remove useless constructor

* fix plist

* System Status: shorten previous

* System Status: add ACL check

* System Status: also remove legacy part

* System Status: also clean up on legacy page

* System Status: ACL check on dismiss action as well

* System Status: add readonly privilege check to dismiss action

* System Status: do not trust input

* System Status: address security concerns

* add default return

* System Status: move js code to separate script and make sure a logLocation is always provided

* System Status: clean up callout in both legacy page and volt template

After dismissing a message and closing the dialog, the old message was still bound to the dialog instance. re-registering the onclick callback solves this.

* System Status: adjust log location and kick off status system on alias errors

* System Status: let's hold off on throwing notifications for aliases for now

* System Status: add ACL entry for the dismiss API call, adjust to new deployment situation

Without the ACL entry, /api/core/system/dismissStatus calls are rejected for non-root users even when they should have rights to dismiss.

Also do a minor consistency improvement and also adjust to the new situation of production & development deployment types. We need to account for the possibility of 'deployment' being empty in the configuration, therefore a direct check of the 'development' type seems most fitting as this is unlikely to change or be subjected to any additions.

* System Status: also error out when unable to write new rules

* System Status: account for users without permissions

* System Status: name collision in FirmwareController

* System Status: replace old notices system with a global one (https://github.com/opnsense/core/pull/5875)

Review feedback / modifications in this commit:

o filter.inc

-- remove wedged message, when locked during parallel reloads it likely doesn't help to disable/enable
-- flush message to error trigger file

o SystemStatus.php
-- str_contains --> strpos; eases testing on OPNsense 22.1.x as str_contains is php 8 only

o Status collectors
-- simplify logic and propagate messages received from status file

o CrashReporterStatus
- the existence of a /tmp/PHP_errors.log  file should be enough to know some process signaled the crash reporter
- remove shell exec

o FirewallStatus
-- as only /tmp/rules.error remains, remove loop to read for non existing files

o opnsense_status.js
-- add opn-status-group class to container and point css modifications in that single direction to prevent other objects from being affected by our status popup modifications
-- windows file endings replaced (^M)

o css:
keep menu_messages container to ease migration for theme developers

NOTE : ** get_crash_report() could likely be simplified as well

* filter: change to mwexec, redirection is implied

* System Status: handle potential undefined array key

seems to be a one-off error: Exception: Error at /usr/local/opnsense/mvc/app/controllers/OPNsense/Core/Api/SystemController.php:90 - Undefined array key 0 (errno=2) in /usr/local/opnsense/mvc/app/controllers/OPNsense/Base/ApiControllerBase.php:159

Co-authored-by: Ad Schellevis <ad@opnsense.org>
2022-07-28 09:50:06 +02:00
Franco Fichtner
39283ebf7c interfaces: ifctl experiment is complete #5862
Since "nameserver.sh" was a working title for when we just wanted
to make sense of the nameserver registration mess going on this
no longer fully applies for good reasons.

Change the name to ifctl.sh for leaving syntax parsing in place
and leave the symlink in sbin/ directory.  The same works nicely
for configctl.
2022-07-26 19:57:25 +02:00
Maurice Walker
d582435b4b interfaces: add support for SLAAC WAN interfaces w/o DHCPv6 #5862; closes #5883
New script to be invoked by rtsold when Router Advertisements with
RDNSS / DNSSL information are received. Uses ifctl to create the
/tmp/$if_routerv6 file and creates the /tmp/$if_defaultgwv6 file
directly. Fixes the issue that these files don't get created when
the M and O flags in RAs are not set. Also, passes RDNSS / DNSSL
info from RAs to ifctl.
2022-07-22 09:20:12 +02:00
Franco Fichtner
0aa48bc3d7 pkg: fix plist 2022-07-21 21:02:42 +02:00
Franco Fichtner
856574bbef dhcp: use a simple periodic update for now; closes #5876
Gets rid of package dependency which for dhcpleases6 simply
listens on the DHCPD lease file and runs the prefix.php command
unconditionally.

For now emulate this by issuing the command every 60 seconds
which can be adjusted later if someone complains, but seeing
how many bugs this script has had vs. how many people noticed
it (basically none) I doult this will have much impact overall.
2022-07-20 11:37:18 +02:00
Josh Soref
efb4eb3f8f firewall: fix "statistics" spelling in function and file name 2022-07-18 17:03:54 +02:00
Franco Fichtner
b9a6661f99 webgui: not required 2022-07-18 16:36:15 +02:00
kulikov-a
af0c9e18a2 webgui: handle php 500 when display_errors is off
Revert previous here.  Debug mode is "raw" error display
mode and non-debug forwards to crash reporter.

Crash reporter itself could be broken, but mostly because
the system / include chain is broken.  Until PHP offers
a reliable way to intercept parse error 500 we will have
to live with this unless it causes other side effects.
2022-07-18 13:32:31 +02:00
Franco Fichtner
b7de99e08b dnsmasq: add dnsmasq watcher; closes #5119 2022-07-15 12:16:36 +02:00
Franco Fichtner
d7ade48769 system: move script to proper location 2022-07-15 10:29:13 +02:00
Franco Fichtner
f44dbecd79 dnsmasq: roll this back a bit #5119 2022-07-15 10:26:54 +02:00
Franco Fichtner
b1c7f44102 dnsmasq: make room for dhcpleases obsoletion #5119 2022-07-15 10:08:38 +02:00
Franco Fichtner
d586a9d317 ipsec: style and plist 2022-07-12 08:08:23 +02:00
Ad Schellevis
ae62e15d07 fix plist 2022-07-07 18:51:21 +02:00
Franco Fichtner
057fe2e7d2 pkg: fix plist 2022-07-06 20:28:27 +02:00
Ad Schellevis
becf4e9342 VPN: IPsec: Status Overview - cleanup, remove vici library in favour of port package 2022-07-05 11:11:53 +02:00
Franco Fichtner
b6167bfd90 system: move add_user script out of shell scripts
Shell scripts are for opnsense-shell.
2022-07-05 08:54:45 +02:00
Franco Fichtner
82d78ebe2b pkg: fix plist 2022-07-01 14:03:25 +02:00
Franco Fichtner
57a565b6f0 pkg: fix plist 2022-06-30 11:24:35 +02:00
Franco Fichtner
05373f150e pkg: fix plist 2022-06-30 07:57:40 +02:00
Franco Fichtner
7eadf5f447 openvpn: hardcode the RFC 7919 DH parameter #4722
This allows us to remove all DH handling remnants.  If people
want to use a separate content they will have to let us know,
but it seems unlikely.  The only impact seems to be a security
bump from 2k to 4k default.
2022-06-29 20:04:07 +02:00
Ad Schellevis
f0e9cb1625 plist 2022-06-05 15:58:22 +02:00
Franco Fichtner
4173fbca0e mvc: clean up previous 2022-05-11 12:43:03 +02:00
Franco Fichtner
e8b5717b03 pkg: fix plist 2022-05-09 16:47:36 +02:00
Franco Fichtner
f59b133b01 dhcp: fix plist and add .php suffix for clarity
(it's easier to syntax check scripts with a file suffix)
2022-05-06 08:50:19 +02:00
Franco Fichtner
948235bc1d mvc: style sweep et al 2022-04-20 10:13:46 +02:00
Franco Fichtner
a9da63d2cd pkg: fix plist 2022-04-19 08:02:16 +02:00
Franco Fichtner
94ad563566 pkg: fix plist 2022-04-11 16:39:36 +02:00