36 Commits

Author SHA1 Message Date
Franco Fichtner
a8c82ea748 firmware: requirements grew unfortunately 2019-07-02 10:09:38 +02:00
Franco Fichtner
6018681623 dhcpd: more conversion, only services_dhcpd_configure() left 2019-04-29 08:05:15 +02:00
Franco Fichtner
ba0c82dd54 dhcpd: naming convention, plugins_configure() use 2019-04-29 07:49:26 +02:00
Franco Fichtner
04d4f50cca interfaces: separate dhcpd from services.inc 2019-04-28 15:07:10 +02:00
Franco Fichtner
8d0072e775 system: only use rrd where needed 2019-04-23 17:18:53 +02:00
Franco Fichtner
f3b5c0e8f7 system: hide dpinger configuration inside new plugins_configure() call
Some back and forth between explicit and implicit requires while here.
The code is helplessly glued together and no plugin facility to get
data from a function call currently exists.
2019-04-21 19:04:15 +02:00
Michael Steenbeek
5689dc8048 Port reboot and shutdown pages to MVC (#3133) 2019-01-15 09:25:52 +01:00
Michael Steenbeek
dbd1729595 Remove unreachable, unnecessary statements 2019-01-03 14:58:19 +01:00
Michael Steenbeek
d27cc83642 Change foreach loops that don't use values to use array_keys() 2018-12-18 14:37:11 +01:00
Michael Steenbeek
afcae6226a Clean up incorrect/unused variable assignments 2018-11-29 17:29:58 +01:00
Franco Fichtner
9634dc64fc shell: make banner foreach a little more straight-forward 2018-11-13 11:19:45 +01:00
Franco Fichtner
01846ab2bb shell: use new network functions in banner 2018-11-12 14:58:23 +01:00
Franco Fichtner
6172beb8f4 src: useless globals 2018-11-12 14:44:44 +01:00
Franco Fichtner
05d1283508 dhcp: flip arguments for services_dhcpd_configure
Stop radvd in setport while there.
2018-10-31 15:07:53 +01:00
Franco Fichtner
a7dbe83957 version: improved crypto flavour reading
product_flavour is embedded in the release package but the
package itself does not insist on a particular flavour other
than having knowledge about the flavour the package was
built for originally.  This is ok and direct crypto deps
seem to have failed to produce reliable upgrade / sidegrade
results in recent tests anyway.

Long story short: find out the real crypto flavour installed
from the OpenSSL binary or fall back to the metadata if said
binary cannot be found.
2018-09-26 20:30:45 +02:00
Franco Fichtner
1fb52bace2 shell: obvious replacement for OPENSSL_VERSION_TEXT 2018-09-22 09:29:38 +02:00
Franco Fichtner
90296833f9 firmware: firmware-product, src/opnsense/version/opnsense, etc.
Now that we have metadata injection at build time read it instead
of its auxiliary files.  Allow live-mount to snoop the metadata and
afterwards we can start to marry the version and firmware-product
file.

Last puzzle piece will be a tool called "opnsense-version" to read
the JSON metadata and return it in a piecemeal fashion of a part
of the system requires that info, especially from the shell.
2018-09-16 20:38:15 +02:00
Franco Fichtner
574bd308be src: remove trailing dot workaround by removing trailing dots 2018-09-16 11:44:13 +02:00
Franco Fichtner
82d57c022c shell: mark iteration variable unused 2018-09-15 10:33:09 +02:00
Franco Fichtner
baa43590d7 src: remove get_configured_interface_with_descr()'s $withdisabled 2018-09-11 22:16:31 +02:00
Franco Fichtner
a35b40a4a7 src: remove unused $only_opt 2018-09-11 21:52:34 +02:00
Franco Fichtner
b8a651a931 shell: omit ":" from SSL fingerprint, asymmetry bugs me 2018-08-05 18:16:43 +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
45bd265180 shell: print(f) to echo where possible
Spotted by: @fabianfrz
2018-07-06 21:01:29 +00: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
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
3a518cf680 src: style sweep et al 2018-06-17 18:45:51 +00:00
Franco Fichtner
ebbb917b9d rc: small tweak on previous 2018-06-13 16:05:51 +02:00
Franco Fichtner
b77b3a5782 interfaces: flip arguments of interface_configure() 2018-05-22 08:42:52 +02:00
Franco Fichtner
eb1e3966e5 interfaces: never reload from batch reconfigure; remove side effect form track6 2018-05-22 08:32:02 +02:00
Franco Fichtner
32aad857a8 interfaces: unwind inverted call stack, interfaces_configure() can do less 2018-05-22 07:37:02 +02:00
Franco Fichtner
66bd3db022 rc: fix syntax 2018-05-22 07:23:02 +02:00
Franco Fichtner
3c38c26440 rc: reload filter as well in previous 2018-05-22 07:12:27 +02:00
Franco Fichtner
046eaa80d1 rc: missing local reload spot 2018-05-21 18:45:52 +02:00
Franco Fichtner
272a5b8b41 rc: rc.initital is now opnsense-shell 2018-05-19 15:23:36 +02:00