[control] UI socket: with [ui] socket control also serves the API on a 0660 Unix socket and trusts the proof only there; a socket upstream is refused unless it is the admin host on control's own socket; probes under Caddy reach it too

This commit is contained in:
2026-11-10 21:06:56 +01:00
parent 1f5e4a59a0
commit d249bcf9f2
7 changed files with 160 additions and 8 deletions
+14
View File
@@ -195,6 +195,13 @@ impl Config {
}
pub fn check(&self) -> Result<(), ConfigError> {
if let Some(s) = self.ui.as_ref().and_then(|u| u.socket.as_ref())
&& (!s.is_absolute() || s.as_os_str().len() > 100)
{
return Err(ConfigError::Invalid(
"ui.socket must be an absolute path of at most 100 characters".into(),
));
}
if !self.listen.ip().is_loopback() {
return Err(ConfigError::Invalid(format!(
"listen = {} is not a loopback address; ianitor-control only listens on 127.0.0.1 or ::1",
@@ -346,6 +353,13 @@ pub struct UiConfig {
pub proof_credential: Option<String>,
/// The built web UI (served at `/`).
pub static_dir: Option<PathBuf>,
/// A Unix socket (mode 0660; its directory only for the ianitor group) on which control
/// also serves the API for the admin host (G14 option b). With it, the proof signs in only
/// on this socket; over the loopback port, which any local process can reach (or take while
/// control restarts), only API tokens work. The admin host's upstream is then
/// `unix:<this path>`.
#[serde(default)]
pub socket: Option<PathBuf>,
/// Authelia's logout address (e.g. `https://auth.example/logout`), shown as "Sign out".
#[serde(default)]
pub logout_url: Option<String>,