8403 Commits

Author SHA1 Message Date
Ad Schellevis
76bad0d5cc IPsec, rename option, closes https://github.com/opnsense/core/issues/2531 2018-07-10 18:41:28 +02:00
Ad Schellevis
fada28880b Firewall/alias, fix validations using our new CallbackValidator type, for https://github.com/opnsense/core/issues/1858 2018-07-10 18:01:37 +02:00
Ad Schellevis
970140aa36 MVC/CallbackValidator, minor style cleanup 2018-07-10 16:10:59 +02:00
Ad Schellevis
ba5b127ee8 whitespace 2018-07-10 10:56:50 +02:00
Ad Schellevis
9bde30e6cb cleanup ApiMutableModelControllerBase, remove duplicate code and make sure all validation errors are returned to the client. (in stead of only the first) 2018-07-10 10:52:41 +02:00
Ad Schellevis
829c0a8f39 MVC, add simple callback validator which fits our framework. The standard Phalcon callback can only serve a complete list of known attributes in stead of the actual field pushed to our validator.
This implementation makes sure the callback is called with the actual field value and may return a list of validation errors.

Related to https://github.com/opnsense/core/issues/1858
2018-07-10 10:10:48 +02:00
Ad Schellevis
1b9db2bf7d whitespace 2018-07-10 09:11:30 +02:00
Ad Schellevis
82c869df89 IPSec, add pks+eap-tls scheme for https://github.com/opnsense/core/issues/2531 2018-07-10 09:10:01 +02:00
Ad Schellevis
5b9d4240c3 IPsec, attr.subnet seems to send the wrong networks to the client, align to phase2 entries, for https://github.com/opnsense/core/issues/2531 2018-07-09 22:47:07 +02:00
Fabian Franz
4b1dd4076a fix nextcloud file name format 2018-07-09 19:29:54 +02:00
Daniil Baturin
df338aef9c Add a special case for /31 tunnel networks to the OpenVPN config generator (fixes #2529). (#2530) 2018-07-09 18:30:30 +02:00
Franco Fichtner
0c1e39fdbe rc: cosmetics for account expiry 2018-07-09 08:56:27 +02:00
Ad Schellevis
f2b161e90d Firewall/alias, add migrations (work in progress), for https://github.com/opnsense/core/issues/1858 2018-07-08 20:24:53 +02:00
Ad Schellevis
2108ad2dc7 Firewall/alias, add missing proto field (for geoip), fix external selector. for https://github.com/opnsense/core/issues/1858 2018-07-08 20:24:06 +02:00
Franco Fichtner
c6034f651c interfaces: I don't know why but it makes more sense to me... #2521 2018-07-08 20:10:40 +02:00
Franco Fichtner
bc378402b5 interfaces: retain zapped prefix length calculation #2521 2018-07-08 20:04:25 +02:00
Ad Schellevis
2c206e2950 firewall/alias, drop 'detail' description field.
While working on https://github.com/opnsense/core/issues/1858 we decided to drop the detailed descriptions, since they won't fit into the new mvc version.

The new version will use a tokenizer to add alias entries, which makes it impossible to add labels on top of single items. When detailed descriptions are needed, we have support for alias nesting so single items can have descriptions. The current solution is hard to port, without the need of generating xml tags per item, which in many cases has quite some overhead.

The new alias code will likely enter in a 18.7.x release, since we don't want to drop support in a minor release, we've chosen to do so in the legacy code.

The format issue has been reported before in https://github.com/opnsense/core/issues/1110, for now we stick to using list types into single xml tags, since this is aligned with the other fieldtypes we use, and drop the impractical aligned descriptions.

As discussed with @fichtner
2018-07-08 19:12:16 +02:00
Franco Fichtner
25d9b62829 firewall: remove extraneous line break 2018-07-08 14:53:46 +02:00
Robin Schneider
3f86721ce3 Use openssh_enabled() in src/opnsense/scripts/shell/banner.php
This is only an improvement and unification of
`src/opnsense/scripts/shell/banner.php`.

Using `openssh_enabled()` both times in this file is preferred over one
time using `isset($config['system']['ssh']['enabled'])` and the other
time using `openssh_enabled()`.

Updates: 00f9b21cb78d9f76a8f94e8e62cbcefad65b7d99
Updates: 81e50abd0afba2d58ce487cdad60c7aedf899bbf
Updates: https://github.com/opnsense/core/pull/2481
2018-07-08 13:51:27 +02:00
Franco Fichtner
83f8321bce interfaces: allow /0 to /32 in 6rd #2521 2018-07-08 10:58:38 +00:00
Franco Fichtner
6df682c9dd interfaces: allow 6rd prefix 0 which is prefix 32 ? #2521 2018-07-08 10:35:21 +00:00
Ad Schellevis
ef127ed97c firewall/alias, minor style changes for https://github.com/opnsense/core/issues/1858
* make sure the tokenizer dropdown is hidden after pusing changes back
* show "X out of Y" under region selections
2018-07-08 12:06:11 +02:00
Franco Fichtner
45bd265180 shell: print(f) to echo where possible
Spotted by: @fabianfrz
2018-07-06 21:01:29 +00:00
Franco Fichtner
94293fa8db web proxy: add PAC links to quick search 2018-07-06 20:58:53 +00:00
Franco Fichtner
7835b70c6b web proxy: small review, PAC is too confusing 2018-07-06 22:46:23 +02:00
Franco Fichtner
81e50abd0a shell: when in live mode ssh, also show SSH fingerpints 2018-07-06 20:38:53 +00:00
Franco Fichtner
00f9b21cb7 shell: pretty-print the SHA256 sums for the banner 2018-07-06 20:31:49 +00:00
Franco Fichtner
e5cdce79a1 shell: move banner to top like it used to
Discussed with a number of people over the years.
2018-07-06 20:31:22 +00:00
Robin Schneider
7bf9c376d8 Add openssl x509 -fingerprint -sha256 to "Show certificate info"
Nice thing is that `openssl x509` respects the order of supplied
arguments. It was chosen to print the one line of fingerprint above of
the X509 text dump. `-sha256` is needed because OpenSSL 1.0.2k-freebsd
26 Jan 2017 seems to default to SHA1 currently.

Example of the first line:

```
SHA256 Fingerprint=F0:E6:EB:31:E8:87:AF:52:16:4E:84:05:3B:6C:03:2C:C1:DF:5A:E7:36:F4:32:44:3B:B5:57:63:97:45:C3:77
```

This commit is one piece to make fully trusted bootstrapping easier.
Related to: https://github.com/opnsense/core/issues/2427
URL path of the GUI page involved: /system_certmanager.php
2018-07-06 21:56:43 +02:00
Robin Schneider
d1e90d3cee Print SSH and X.509 fingerprints in console banner without need to login (#2481)
Example output:

```
$ /usr/local/etc/rc.initial.banner

*** test-fw.localdomain: OPNsense 18.1.10 (amd64/OpenSSL) ***

 WAN (vtnet0)    -> v4/DHCP4: 172.30.23.2/24

 SSH: 256 SHA256:fcMIAgT/vZR/TWP0j8AFROTNnudkU1tP9sRhbsIa8vM (ECDSA)
 SSH: 256 SHA256:lDenOc5wy2WU0e6sSz2hR9nEFnMqx5c3u1F/pHxgJlY (ED25519)
 SSH: 2048 SHA256:dsw9srlQHL0hPJlEdR9rL769N30BTZgXG9gXbdZGOkU (RSA)
 HTTPS X.509 cert: SHA256 Fingerprint=F0:E6:EB:31:E8:87:AF:52:16:4E:84:05:3B:6C:03:2C:C1:DF:5A:E7:36:F4:32:44:3B:B5:57:63:97:45:C3:77
```

The list of fingerprints is appended after the interface list because
the interface list might be pretty long and thus would move the
fingerprints out of the screen which we don’t want.

Previously (#2427) I suggested to extract the X.509 certificate from the
xml config but the difficult part for me who is not so familiar with the
implementation of OPNsense is to find the certificate which is actually
used by the local web server. I found that `/var/etc/cert.pem` is used
in the configuration of the local web server and assume that this is the
easier way to implement this in the expectation that the file name does
not change without being also changed in this script and that the file
exists. If it does not exist, OpenSSL would complain with a useful error
message.

This commit is one piece to make fully trusted bootstrapping easier.
Related to: https://github.com/opnsense/core/issues/2427
Tested on: OPNsense 18.1.10-amd64
2018-07-06 21:55:15 +02:00
Franco Fichtner
e8721cd9cc mvc: whitespace and style sweep 2018-07-06 19:48:38 +00:00
Fabian Franz BSc
095c7ae491 Unbound: add WPAD (#2097) 2018-07-06 21:41:24 +02:00
Fabian Franz BSc
8257d1abfa add WPAD to dhcp server (#2088) 2018-07-06 21:38:51 +02:00
Fabian Franz BSc
7386a5fe73 Add PAC support to proxy (#2018) 2018-07-06 21:32:26 +02:00
Ad Schellevis
c2e75d2606 firewall/alias, forgot to select external aliases in legacy_list_aliases() 2018-07-06 16:57:18 +02:00
Franco Fichtner
c0838ddfc0 mvc: multiselect may allow empty option, no need to give blank item too 2018-07-05 12:24:17 +00:00
Frank Brendel
20f41070bc monit: fix UI issues 2018-07-05 13:49:29 +02:00
Franco Fichtner
dc3df43a97 importer: clear DEV after use always 2018-07-04 17:05:14 +02:00
Franco Fichtner
c72b50a7a9 importer: simplify the loop 2018-07-04 16:44:16 +02:00
Franco Fichtner
faa2663e60 importer: it's complicated... 2018-07-04 16:33:50 +02:00
Franco Fichtner
8e57dfd58c installer: minor hiccup in setup 2018-07-04 16:23:35 +02:00
Franco Fichtner
8102296a90 importer: loop as long as mount is not successful 2018-07-04 15:40:32 +02:00
Ad Schellevis
0abd42c06d pull in 533d59f5fd 2018-07-04 14:07:40 +02:00
João Vilaça
68f53ef004 Fix CaptivePortal model documentation (#2510) 2018-07-03 11:57:19 +02:00
Frank Brendel
d30547ac26 monit: run reconfigure after test cleanup 2018-07-03 10:48:53 +02:00
Frank Brendel
677f6a4a19 monit: generate template when disabling monit 2018-07-03 09:34:57 +02:00
Frank Brendel
11903e7478 monit: create template before stopping Monit for ServiceController test 2018-07-03 09:04:46 +02:00
Franco Fichtner
a9159026dc firewall: properly extract first error from pfctl
While here, we no longer need the ALTQ trickery.
2018-07-02 17:25:27 +00:00
Franco Fichtner
bd59d9a5ad unbound: reformat, bump copyright after recent changes 2018-07-02 18:31:04 +02:00
Franco Fichtner
ad6c7384e4 dnsmasq: second part of slurp rework
Align this code with Unbound, slowly ridding ourselves of
get_possible_listen_ips() in the process as well.

PR: https://twitter.com/wget42/status/1009886764155260928
2018-07-02 16:21:02 +00:00