11729 Commits

Author SHA1 Message Date
Ad Schellevis
c8e607a8a9 Shaper: add statiscs endpoint /api/trafficshaper/service/statistics for https://github.com/opnsense/core/issues/3994 2020-03-21 12:19:16 +01:00
Ad Schellevis
b109234dfa Unbound: minor cleanup in /api/unbound/diagnostics/stats endpoint 2020-03-20 22:50:44 +01:00
Franco Fichtner
fe3a49c2d2 src: fix lint pass 2020-03-21 08:28:21 +01:00
Ad Schellevis
80c8d38d46 plist 2020-03-20 20:00:35 +01:00
Ad Schellevis
fff394c44b Shaper: add wrapper to collect different ipfw stats to be combined in the api controller to build later.
new call `configctl ipfw stats`

There are some assumptions in parsing these stats, ipfw/dummynet man page doesn't seem to provide mich insights on the details delivered by the various "show" commands.

for https://github.com/opnsense/core/issues/3994
2020-03-20 19:57:19 +01:00
Ad Schellevis
f8392c1d47 Shaper: add uuid to shaper rules, for https://github.com/opnsense/core/issues/3994 2020-03-20 19:39:39 +01:00
Ad Schellevis
fc5b8b9173 MVC: init errorMessage to prevent "Error at /usr/local/opnsense/mvc/app/library/OPNsense/Core/Backend.php:91 - Undefined variable: errorMessage (errno=8)" 2020-03-19 12:46:12 +01:00
Franco Fichtner
a73b211d0a mvc: header style in field types 2020-03-19 08:26:09 +01:00
Ad Schellevis
dba70c0ead Gateways: support interface targets (without addresses), but don't pinpoint it on specific drivers. for https://github.com/opnsense/core/pull/3983
Some tunnel interface types, such as Wireguard and Tinc do support sending traffic to the interface without an intermediate host. Since we don't want to add different static checks (and would like to get rid of the ones there for legacy reasons), it's probably better to add an option here.
2020-03-18 11:16:41 +01:00
Ad Schellevis
38c1b66cca Gateways: skip empty gateway_item tags, since &config_read_array('gateways', 'gateway_item') will always create one if gateways is empty (leading to an empty defunct entry in the gateway overview) 2020-03-18 10:20:01 +01:00
Ad Schellevis
67c0d0dcfd filter: diag_logs_filter_summary.php optionally support pid in log line filterlog: vs filterlog[XXX]: 2020-03-17 21:05:08 +01:00
Ad Schellevis
0ec7e1f804 dpinger: system_gateways_edit.php simplify validations, dpinger defaults and choosen settings are being overcomplicated here. should fix https://github.com/opnsense/core/pull/3989 2020-03-17 20:44:53 +01:00
Franco Fichtner
6b9865876a src: PSR12 style sweep 2020-03-18 07:43:01 +01:00
Franco Fichtner
dd4646e596 unbound: spacing 2020-03-18 07:34:08 +01:00
Ad Schellevis
599e17af76 filter/log: new filterlog seems to add pid as well.
old content:
Mar 17 18:19:01 OPNsense filterlog: ,,,,,
new content:
Mar 17 17:11:36 OPNsense filterlog[40511]: ,,,,

Use a regexp to match both in the log parser.
2020-03-17 18:20:18 +01:00
Franco Fichtner
e06e7aecea openvpn: make at least one string sane by moving "." into the string #3987
Scrape markup, it is generally bad style.
2020-03-17 17:42:29 +01:00
Ad Schellevis
1752d96a1f openvpn client: help texts swapped, closes https://github.com/opnsense/core/issues/3987 2020-03-17 17:34:16 +01:00
Franco Fichtner
85f57a38af pkg: fix plist 2020-03-17 16:49:31 +01:00
Ad Schellevis
4ec8d612f4 unbound: add lock to previous 2020-03-17 16:35:27 +01:00
Ad Schellevis
e559644fb7 unbound: wrap unbound startup + preparation into unbound_start.sh and move startup to background configd task 2020-03-17 16:16:49 +01:00
Ad Schellevis
1219969e83 fix previous 2020-03-17 14:03:25 +01:00
Ad Schellevis
0ea36d1a21 syslog: fix cda4e3561f
- sleep() expects an int, use usleep instead to wait 0.1 seconds
- bail if waiting longer than 5 seconds
2020-03-17 13:04:42 +01:00
Ad Schellevis
5dd129c967 OpenVPN: openvpn_port_used() using different logica than it would when doing the actual configuration (local setting). Align logic, closes https://github.com/opnsense/core/issues/3984 2020-03-17 09:58:52 +01:00
Ad Schellevis
41a5f37b4e IDPS: synchronize suricata.yaml with default template https://github.com/OISF/suricata/blob/suricata-5.0.2/suricata.yaml.in
Probably to be included in 20.7. This includes enabling more logging and parsers, our template has been unmodified for quite some time, while the upstream version was improved and better structured.
2020-03-16 18:42:23 +01:00
Franco Fichtner
b5493874b3 firmware: revoke 19.7 fingerprint and fix boot logo 2020-03-16 15:05:29 +01:00
Franco Fichtner
f7a1226b39 pkg: fix plist 2020-03-16 14:16:16 +01:00
Ad Schellevis
6276812309 MVC: logging, fixed with for timestamp column 2020-03-16 13:49:34 +01:00
Ad Schellevis
6b62ed4fe2 IDS: fix obsolete warning in suricata : [ERRCODE: SC_WARN_OPTION_OBSOLETE(233)] - netmap interface em1+ uses obsolete '+' notation. Using '^' instead. 2020-03-16 13:36:22 +01:00
Franco Fichtner
0481c26fe1 pkg: allow using different updater 2020-03-16 07:15:39 +01:00
Franco Fichtner
665c90fd66 config: install fingerprint for 20.7 2020-03-16 07:13:47 +01:00
Ad Schellevis
02e6e00c12 MVC: limit dropdown size to 10 is none specified, larger lists seem to overlap sometimes (data-size attribute in selectpicker) 2020-03-14 05:15:24 +01:00
Ad Schellevis
893f2a4af9 Firewall: prevent gateway protocol mismatch from breaking the ruleset. 2020-03-13 17:55:13 +01:00
Ad Schellevis
cda4e3561f syslog: if /var/run/legacy_log is being created while syslog-ng is booting, it sometimes leads to crashes/dumps of the latter. make sure the socket exists before asking syslog-ng to start 2020-03-13 15:24:00 +01:00
Ad Schellevis
5d99be7c0c fix plist 2020-03-13 15:23:42 +01:00
Franco Fichtner
f09aceecb3 system: set net.pf.request_maxcount default value
While here also migrate the enc filter rules to our new style.
Useful for testing so tunables can be overwritten by users.

PR: https://github.com/opnsense/core/issues/3969
2020-03-13 14:28:53 +01:00
Ad Schellevis
116511910d sshd: add HostKeyAlgorithms for https://github.com/opnsense/core/issues/3975 2020-03-13 09:54:59 +01:00
Ad Schellevis
e738e3ca05
ifgroups: simplify group maintenance for https://github.com/opnsense/core/issues/3780 (#3977)
It doesn't really seem to make sense to try to link groups on different places, if they're only usable for pf which is always reloaded when new interfaces are connected.
The new ifgroup_setup() synchonizes attached interfaces for all configured groups, only rename and delete are still being served from the management pages (to avoid dropping static groups like openvpn).
2020-03-13 08:24:37 +01:00
Ad Schellevis
858116e0fc Merge branch 'cdeconinck-master' 2020-03-12 15:08:38 +01:00
Ad Schellevis
d7983fd99f whitespace / consistency for https://github.com/opnsense/core/pull/3976 2020-03-12 15:07:53 +01:00
cedric.deconinck@nerim.com
82cdd740ee Allow concurrent add and delete request with alias_util API
Currently the API has a strange behavior when we try to add or delete in parallel several addresses in the same alias
For example, while we want to delete multiple address  (1 request = 1 address) all the request returns a 200 OK {"status": "done »}, but some address stay in the alias content
The same logic apply for the alias_utils/add endpoint

This behavior can be reproduced with this python script
import os
import subprocess

addr_list = ["10.1.0.0", "10.1.0.1", "10.1.0.2", "10.1.0.3", "10.1.0.4",
             "10.1.0.5", "10.1.0.6", "10.1.0.7", "10.1.0.8", "10.1.0.9", "10.1.0.10"]

secret = ""
key = ""
host = ""
existing_alias = ""

for addr in addr_list:
    subprocess.Popen(
        ["curl   --header \"Content-Type: application/json\"   --basic   --user \"" + secret + ":" + key + "\"   --request POST  --data  '{\"address\":\"" + addr + "\"}' http://" + host + "/api/firewall/alias_util/add/" + existing_alias], shell=True, stdin=None, stdout=None, stderr=None, close_fds=True)

With this fix, adding and removing addresses works correctly in parallel
2020-03-12 14:25:45 +01:00
Ad Schellevis
5df590cd13 SSH: optional KexAlgorithms, Ciphers and MACs to harden security. closes https://github.com/opnsense/core/issues/3975 2020-03-12 13:47:56 +01:00
Ad Schellevis
005f7744f4 usermanager: add (i) button to display endpoints, eases debugging 2020-03-11 15:20:04 +01:00
Ad Schellevis
0e2751d2d1 rc.linkup: filter_configure() needs to be called after stop/start devd action to assure default gateway switching actual has the change to do something
04d4f50cca/src/etc/inc/filter.inc (L291-L307)

for https://github.com/opnsense/core/issues/3961
2020-03-10 15:08:43 +01:00
Ad Schellevis
535c85101a MVC, config: fix previous 2020-03-10 10:50:33 +01:00
Ad Schellevis
fc60d04cd6 MVC, config: fix getBackupFilename(), floats aren't really safe to use of we only want to split the number part. 2020-03-10 10:47:14 +01:00
vnxme
faf71c7e70
Fix nsComment inconsistency in OpenSSL config (#3955)
Read more about the Netscape extensions status: 

https://www.openssl.org/docs/man1.0.2/man5/x509v3_config.html
2020-03-10 09:48:53 +01:00
Ad Schellevis
8f3c89642c MVC, config: add method to find backup filename (or false if not found)
needed for  https://github.com/opnsense/plugins/issues/1720
2020-03-09 18:41:26 +01:00
Ad Schellevis
5b7268bb17 MVC, config: expose backupCount() which returns the number of backups to keep.
might be needed for https://github.com/opnsense/plugins/issues/1720
2020-03-09 16:06:30 +01:00
Ad Schellevis
01fb3a4f44 MVC / config: synchronize backup timestamps with revisions.
A minor change, previously we requested microtime() twice which always lead to a small difference in revision and backup. If we sync these two timestamps, it's easier to find the previous sitation updated.time matches /conf/backup/config-[updated.time].xml
2020-03-09 15:16:22 +01:00
Ad Schellevis
211fd8dfb3 firewall: for automatic rules, floatind means either all interfaces (empty) or more than one selected. for https://github.com/opnsense/plugins/issues/1720 2020-03-09 15:13:02 +01:00