diff --git a/README.md b/README.md index be54721..f0ee508 100644 --- a/README.md +++ b/README.md @@ -144,6 +144,7 @@ must have the type shown below; an unknown section or setting is an error. | `pki` | `s2s_name` | string | `VPN Router Site-to-Site CA` | Common name of the site-to-site issuing CA | | `pki` | `issuing_cas` | object | | The general-purpose issuing CAs, each a name and `{name, templates, acme}` (see Certificates) | | `pki` | `templates` | object | | Certificate templates, each a name and the options it changes or defines (see Certificates) | +| `pki` | `root_key_warning` | boolean | `true` | `vpn-router-ca status` and `/ca` warn while the root key is on the router; `false` silences that warning | | `metrics` | `enabled` | boolean | `true` | The metrics service: collection, history and `/metrics` | | `metrics` | `listen` | string | `internal` | The interfaces `/metrics` is served on: `internal`, `external` or `both` | | `metrics` | `port` | integer | `9464` | TCP port of `/metrics` | @@ -506,7 +507,8 @@ expired. ### Offline root -Keeping the root key off the router is recommended, not required. Export it, encrypted with a +Keeping the root key off the router is recommended, not required; while it is on the router, +`vpn-router-ca status` says so, unless `pki.root_key_warning` is `false`. Export it, encrypted with a passphrase read from the first line of standard input, keep the file in a safe place, and remove the key from the router: diff --git a/debian-package/debian/changelog b/debian-package/debian/changelog index f7be595..84bf00a 100644 --- a/debian-package/debian/changelog +++ b/debian-package/debian/changelog @@ -1,3 +1,12 @@ +vpn-router (0.21.2-1) unstable; urgency=medium + + fix: pki.root_key_warning silences the warning of vpn-router-ca status and /ca about the root key on the router. + + * pki.root_key_warning, true by default, set to false silences the + warning that the root key is on the router. + + -- Slawomir Koszewski Sat, 31 Oct 2026 10:00:00 +0100 + vpn-router (0.21.1-1) unstable; urgency=medium fix: vpn-router-ca status and /ca warn about a CRL the router signs only once vpn-router-pki.timer has not renewed it in time. diff --git a/debian-package/src/usr/lib/vpn-router/vpnrouter.py b/debian-package/src/usr/lib/vpn-router/vpnrouter.py index 29d18ec..b827bb1 100644 --- a/debian-package/src/usr/lib/vpn-router/vpnrouter.py +++ b/debian-package/src/usr/lib/vpn-router/vpnrouter.py @@ -55,7 +55,8 @@ SCHEMA = { 'https': {'enabled': True, 'email': '', 'web_port': 7444, 'manager_port': 7443, 'caddy_source': 'ubuntu'}, 'pki': {'root_name': 'VPN Router Root CA', 'root_days': 7300, 'ca_days': 3650, 'key': 'rsa-4096', 'crl_days': 7, 'root_crl_days': 180, 'publish': ['http'], 'p2s_name': 'VPN Router P2S CA', - 's2s_name': 'VPN Router Site-to-Site CA', 'issuing_cas': {}, 'templates': {}}, + 's2s_name': 'VPN Router Site-to-Site CA', 'issuing_cas': {}, 'templates': {}, + 'root_key_warning': True}, 'metrics': {'enabled': True, 'listen': 'internal', 'port': 9464, 'https_port': 9465, 'service_account': 'metrics', 'otlp_endpoint': '', 'otlp_username': '', 'otlp_password': '', 'keep_details': '24 hours', 'keep_hourly': '1 month', 'keep_daily': '3 months', diff --git a/debian-package/src/usr/lib/vpn-router/vpnrouter_pki.py b/debian-package/src/usr/lib/vpn-router/vpnrouter_pki.py index 855d6cb..a845868 100644 --- a/debian-package/src/usr/lib/vpn-router/vpnrouter_pki.py +++ b/debian-package/src/usr/lib/vpn-router/vpnrouter_pki.py @@ -931,7 +931,8 @@ def acme_url(cfg, name): def status(cfg): - """The root, the issuing CAs, the retired CAs and the warnings, as /ca and vpn-router-ca status show them.""" + """The root, the issuing CAs, the retired CAs and the warnings, as /ca and vpn-router-ca status show them; the root + key on the router is a warning while pki.root_key_warning is true.""" moment = now() soon = moment + datetime.timedelta(days=WARN_DAYS) state = read_state() @@ -956,7 +957,7 @@ def status(cfg): root = {'subject': common_name(root_cert), 'expires': iso(utc(root_cert, 'not_valid_after')), 'key': key, 'crl_next_update': crl_of('root') if key or (ROOT_DIR / 'crl.pem').is_file() else None, 'crl_source': state['root_crl']} - if key: + if key and cfg['pki']['root_key_warning']: warnings.append('the root key is on the router; export it with vpn-router-ca root export-key and remove it ' 'with vpn-router-ca root remove-key to keep the root offline') elif not (ROOT_DIR / 'crl.pem').is_file(): diff --git a/debian-package/src/usr/share/doc/vpn-router/vpn-router.json.example b/debian-package/src/usr/share/doc/vpn-router/vpn-router.json.example index 799c001..ba3f3c3 100644 --- a/debian-package/src/usr/share/doc/vpn-router/vpn-router.json.example +++ b/debian-package/src/usr/share/doc/vpn-router/vpn-router.json.example @@ -91,7 +91,8 @@ "server": { "days": 397 } - } + }, + "root_key_warning": true }, "metrics": { "enabled": true,