14736 Commits

Author SHA1 Message Date
Ad Schellevis
789a151f2d VPN: IPsec: Tunnel Settings - allow search all phase2 entries via an api call. 2022-12-14 17:52:46 +01:00
Franco Fichtner
5169315bf2 firmware: add fingerprint for 23.1 2022-12-14 12:41:38 +01:00
Franco Fichtner
e01c506cc4 system: do the same here
The async case yields to the GUI page rendering so do not
modify it.
2022-12-14 08:57:00 +01:00
Franco Fichtner
b258333ae7 console: stay in script until shutdown is complete 2022-12-14 08:47:29 +01:00
Ad Schellevis
fa1c49e080 VPN/IPsec new MVC module - remove unsupported proposals 2022-12-13 21:51:25 +01:00
Ad Schellevis
e4ebc59a70 VPN/IPsec new MVC module - remove unsupported proposals 2022-12-13 18:14:22 +01:00
Ad Schellevis
8ca676e43b Services: Unbound DNS: Overrides - remove "delete selected" button, not applicable for master/detail grid 2022-12-13 17:39:47 +01:00
Ad Schellevis
540433730b VPN/IPsec new MVC module - add "commonly used" proposals on top, extracted from examples in https://wiki.strongswan.org/projects/strongswan/wiki/CipherSuiteExamples
o add a clear warning about the null cipher only being used for testing
2022-12-13 16:01:10 +01:00
Ad Schellevis
5b03e8cca9 plist 2022-12-13 13:40:24 +01:00
Ad Schellevis
51b346eab7 Tunables - add 90-sysctl script to re-apply tunables in case a module depends on them. 2022-12-13 13:38:49 +01:00
Ad Schellevis
cf840140d8 Firewall: Diagnostics: States - re-add labels removed by https://github.com/opnsense/core/commit/63eeaffe21f7 2022-12-13 11:36:18 +01:00
Franco Fichtner
382bb09312 openvpn: follow d4e637806 in wizard as well 2022-12-13 09:24:42 +01:00
Ad Schellevis
bf6642d9f7 VPN/IPsec add new MVC module - model regression, proposals should be multi-select 2022-12-12 22:16:40 +01:00
Ad Schellevis
926ca9f6d5 VPN/IPsec add new MVC module - when only MVC based module is used, make sure the interface is still enabled. 2022-12-12 21:10:57 +01:00
kulikov-a
fee706bfba
IDS - reload grid after log drop (#6190) 2022-12-12 20:44:51 +01:00
Ad Schellevis
746e7fb128 VPN/IPsec add new MVC module - various regressions and omissions 2022-12-12 18:21:24 +01:00
Ad Schellevis
92e5536ca0 Services: Intrusion Detection: Administration - Alerts: keep grid to prevent widgets being removed. closes https://github.com/opnsense/core/pull/6165 2022-12-12 15:27:36 +01:00
Franco Fichtner
8ae6f43876 ipsec: style sweep 2022-12-12 10:48:38 +01:00
Ad Schellevis
5752bd6eb3
VPN/IPsec add new MVC module (#6187)
Add new component to manage IPsec connections in a similar format as `swanctl.conf` is defined (https://docs.strongswan.org/docs/5.9/swanctl/swanctlConf.html).  As this needs to work in conjunction with the legacy IPsec module, some minor changes are needed to the current state. 

o VPN/IPsec/Pre-Shared Keys - add optional remote identifier (merges in `ipsec.inc`)
o VPN/IPsec/Virtual Tunnel Interfaces - new component to show existing VTI's and add new ones (as these are separate entities)
o VPN/IPsec/Connections [new] - configuration tool to build `swanctl.conf` 
o Integrate MVC generated `swanctl.conf` into `ipsec.inc` (legacy overlays)
o Integrate manually configured VTI's into `ipsec.inc` (`array_merge(ipsec_get_configured_vtis(), (new \OPNsense\IPsec\Swanctl())->getVtiDevices())`)
o fix minor php warning when changing reqid's (`$local|remote_configured` initialisation when `$configured_intf[$intf]` not found)
2022-12-12 10:37:43 +01:00
Ad Schellevis
d25318a483 MVC/Firewall/Util - import functionality of find_smallest_cidr() into MVC so IPsec VTI code can use it as well. 2022-12-11 17:08:43 +01:00
Ad Schellevis
63eeaffe21 Firewall: Diagnostics: States - Performance improvements and better address parsing in search.
As the output of pfctl -vvss can grow quite rapidly, it seemed like a good idea to run this code through a profiler. Some of the hotspots (like parsing addresses) are now cached in memory to prevent over enthusiastic computation, which can save quite some processing time. Pushing down the string join on which the pattern search should match does help prevent to prevent compiling a search string which turns out to be irrelevant later (no filter or ip[+port] filter).

The network (address) search handles (optional) ports as well now, which allows for patterns like `10.0.0.1:80` and `10.0.0.0/24:80`.
2022-12-07 09:40:48 +01:00
kulikov-a
a4b5a815c1 unbound: always use python first 2022-12-05 21:14:51 +01:00
Ad Schellevis
f5cd86b61d Filter / Diagnostics - performance improvement when fetching rule labels.
Since rule labels are directly hooked to the modification time of /tmp/rules.debug, we don't have to recalculate the offsets on every request. This patch saves the labels and the last modification time so we can refresh when changed or non-existent.
2022-12-05 18:41:43 +01:00
Ad Schellevis
f55c828e23 MVC / bootgrid - similar issue as 926a4c8e68 for a couple of MVC components, when POST sends an empty array, we should handle that properly. 2022-12-05 17:56:21 +01:00
Ad Schellevis
ae8e0ce4a4 syslog/lockout handler - better trap ssh messages and improve lockout behaviour.
As the client still might have a state when being kicked-out, we should kill any state the client has while adding it to the alias. Apparantly our ssh messages are only catched partially, so add ".*Authentication error for .*" to the list as well. To ease testing, better detect the location of the timestamp so we can use a construction like this to feed amn existing log:

lockout_handler < /var/log/audit/audit_20221205.log
2022-12-05 14:52:16 +01:00
Ad Schellevis
13ea70af04 unbound: change working directory before check. closes https://github.com/opnsense/core/issues/6171 2022-12-05 11:42:53 +01:00
kulikov-a
623b2643e6
unbound: typo (#6168) 2022-12-05 08:42:38 +01:00
Ad Schellevis
c714f08f92 Services: Web Proxy: Administration - fix broken " Google GSuite restricted" 2022-12-03 12:33:13 +01:00
Stephan de Wit
53dd65709a
unbound: add client activity chart (#6161)
* unbound / overview: add client activity chart, include logarithmic scale on both charts

* unbound: remove tooltip from workaround datapoints

* unbound / overview: also end the x axis properly on log scale

* unbound / overview: prevent queries on non-existing database

* unbound / overview: replace cache hits with blocklist size and update icons

* unbound / overview: refactor rolling API call
2022-12-02 10:57:20 +01:00
kulikov-a
47bbab96dc
MVC - match on multivalued (#6152) 2022-12-02 09:09:02 +01:00
kulikov-a
8e5b0a6c76
tokenize2: unicode content (#6166) 2022-12-02 09:01:35 +01:00
Stephan de Wit
842bcd470a unbound / dnsbl_module: log null client values on AttributeError 2022-11-30 09:06:10 +01:00
Ad Schellevis
b584e1375d MVC - HostnameField and ZoneRootAllowed, make sure we allow @.my.sub.domain as valid input. closes https://github.com/opnsense/core/issues/6155 2022-11-26 09:25:53 +01:00
Ad Schellevis
5586e49d86 VPN: OpenVPN - add daemon name "openvpn_%", closes https://github.com/opnsense/core/issues/6156 2022-11-25 20:36:55 +01:00
Stephan de Wit
36c358ea3b unbound: safeguard usage of DNSSEC 2022-11-25 13:50:53 +01:00
Franco Fichtner
a68700be02 src: style sweep 2022-11-25 12:57:45 +01:00
Stephan de Wit
b20ddbe00f
unbound: add overview dashboard (#6101)
Adds a reporting backend for Unbound as well as a dashboard showing an overview of interesting statistics:

    Total DNS queries (over a maximum period of 7 days)
    Blocked queries
    Cache hits
    local-data hits
    A traffic graph with variable intervals
    top N passed/blocked domains (with associated blocklist)

There are a couple of hardcoded values:

    The underlying database is kept up-to-date for the last 7 days.
    The ring buffer used to decouple unbound from the logging backend has a size of 100000 entries.
    In very busy networks, db commits are done for a max of 4000 entries, which according to testing seems to be a good break-even point for DNS throughput vs. insert performance. Everything below this is flushed to the database every 5 seconds.
    To facilitate the variable interval traffic graph, multiple views with varying detail in time slots are created: 1, 5 and 30 minute buckets. These can easily be extended should different intervals be necessary.
2022-11-25 11:42:38 +01:00
Ad Schellevis
d4e6378061 VPN: OpenVPN: Servers - remove unused "pool_enable" attribute, originally introduced as unused setting in d799787e49 2022-11-24 18:13:14 +01:00
kulikov-a
5cd36a1322
typo (#6153)
consider precedence
2022-11-23 19:20:42 +01:00
Ad Schellevis
d55e5d50b6 VPN: IPsec: Tunnel Settings - add Unique selection so people can easily revert to Strongswan's default (no) if they want.
Not going to backport this, but in 22.7.x unique was called uniqueids and forcefully set to "yes", which according to the documentation (https://wiki.strongswan.org/projects/strongswan/wiki/connsection) is not compatible with a closeaction as this might lead to an avalanche of reconnecting children for the same connection. Although swanctl (https://docs.strongswan.org/docs/5.9/swanctl/swanctlConf.html) doesn't explicitly mention an incompatibility, our defaults are different than the ones being configured nowadays. Adding the option does seem to make sense.
2022-11-23 17:31:03 +01:00
Ad Schellevis
7333aa9c40 MVC / ApiMutableModelControllerBase - minor addition to 47eac7dbf8 preventing upsert when non uuid string is provided. 2022-11-23 11:35:38 +01:00
Franco Fichtner
2d93449f88 interfaces: fix ACL and migrate a few registrations #6151 2022-11-23 10:52:56 +01:00
Franco Fichtner
d4db4023e6 interfaces: use get_interface_list() to identify hardware
Media settings probe is suboptimal for hardware detection and
interfaces_hardware() already uses the function to decide where
to enforce hardware settings.

PR: https://forum.opnsense.org/index.php?topic=30923.0
2022-11-22 16:42:43 +01:00
Ad Schellevis
f291908c7b UI - Javascript (setFormData) - prevent "Uncaught DOMException: Failed to set the 'value' property on 'HTMLInputElement': This input element accepts a filename, which may only be programmatically set to the empty string" when a form contains file inputs 2022-11-21 20:40:30 +01:00
Ad Schellevis
a37303a46c MVC / UIBootgrid - add support for title property on custom commands (used in tooltips) 2022-11-21 16:36:56 +01:00
Franco Fichtner
49f63e8082 firewall: whitespace 2022-11-21 12:49:34 +01:00
Ad Schellevis
6ac82416d7 MVC - minor bugfix in ApiControllerBase->parseJsonBodyData() when $jsonRawBody isn't of array type we should skip merging entries. 2022-11-20 20:05:33 +01:00
Ad Schellevis
47eac7dbf8 MVC/Core - setBase() : Convert setBase() to an upsert operation. if we don't know the uuid, it's ok to create it.
this eases scriptable actions where a single unique entry should be pushed atomically to multiple hosts.

e.g. the below would add/set an alias named api_test_001 :

r = requests.post(
    'https://192.168.1.1/api/firewall/alias/setItem/9a8fc804-0000-0001-99cb-283ca2d04e58',
    verify=False,
    auth=(api_key, api_secret),
    json={'alias':
              {
                  'enabled': '1',
                  'name': 'api_test_001',
                  'type': 'external',
                  'counters': '0',
                  'description': 'api_test_001'
              }
    }
)

print(r.text)
2022-11-16 21:35:01 +01:00
Ad Schellevis
da9c21c550 Firewall: Log Files: Live View - lookup hostnames may result in http 431 ( Request Header Fields Too Large ). Split requests in cycles of 50, closes https://github.com/opnsense/core/issues/6139 2022-11-16 18:14:34 +01:00
Ad Schellevis
e85f1d74b2 Firewall: Diagnostics: Aliases - minor cleanup, sequenced array doesn't need to extract values 2022-11-16 11:11:50 +01:00