[core] Device certificates: device_certs host field; edge config v3 and Caddy client_authentication with a CA bundle and an allow list, 403 without a certificate
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// Bumped on any incompatible change; edge refuses other versions.
|
||||
pub const EDGE_CONFIG_VERSION: u32 = 2;
|
||||
pub const EDGE_CONFIG_VERSION: u32 = 3;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
@@ -29,6 +29,8 @@ pub struct EdgeConfig {
|
||||
pub access_log: String,
|
||||
pub acme: Option<EdgeAcme>,
|
||||
pub forward_auth: Option<EdgeForwardAuth>,
|
||||
/// Device certificates (mTLS); present when any host has `device_certs`.
|
||||
pub device_certs: Option<EdgeDeviceCerts>,
|
||||
/// Sorted by hostname.
|
||||
pub hosts: Vec<EdgeHost>,
|
||||
}
|
||||
@@ -106,4 +108,17 @@ pub struct EdgeHost {
|
||||
/// Share-link tokens (see `ianitor_core::share`) let visitors in on this host without
|
||||
/// forward-auth. Checked against the key credential and the revocation file.
|
||||
pub share_links: bool,
|
||||
/// Only visitors with an allowed Domi device certificate get in (403 otherwise).
|
||||
pub device_certs: bool,
|
||||
}
|
||||
|
||||
/// Where edge finds what it needs to check device certificates. Both files are written by
|
||||
/// control: the CA bundle (the Domi intermediates that issue device certificates) and the
|
||||
/// allow list (every device certificate that is issued and not revoked, PEM). A certificate
|
||||
/// that chains to the bundle but is not on the list is refused in the handshake.
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct EdgeDeviceCerts {
|
||||
pub ca: String,
|
||||
pub allow: String,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user