Studio PIKVM

This document details the network architecture, perimeter/host firewall projections, Authentik Single Sign-On (SSO) integration, mutual TLS (mTLS), Nginx reverse proxy configuration for the Studio PiKVM device, and the complete technical specification for the Studio Control Gateway (scontrol.drheck.dev).


1. Network & DNS Architecture

Clean separation between administrative direct terminal access and Authentik-gated browser access is maintained across dedicated DNS records and network flows:

Hostname Target IPs Purpose Protection Mechanism
studio-kvm-ssh.drheck.dev 10.0.0.7
fd77:7777:5010:0:e65f:1ff:fee4:8911
Direct hardware & SSH administration SSH Key Authentication (id_ultra / id_scontrol)
studio-kvm-web.drheck.dev 10.0.0.100
fd77:7777:5010:0:1337:f1ac:d00d:aaaa
Authentik-protected browser Web UI Authentik SSO + ForwardAuth + mTLS
scontrol.drheck.dev 10.0.0.100
fd77:7777:5010:0:1337:f1ac:d00d:aaaa
Studio One-Touch Orchestration Gateway Authentik SSO ForwardAuth (Group studio)
bmo95.drheck.dev 10.0.0.6
fd77:7777:5010:0:a236:9fff:fe29:bc72
Studio Recording PC Subnet Isolation & SSH Key Auth

2. Security Projections & Layered Defense

Layer 1: Outbound Gateway Isolation on Host ul (nftables)

Unprivileged SSH users logged into host ul are blocked by the kernel from directly connecting to PiKVM web ports (TCP 80/443) or Studio Control backend (TCP 8000). Only Nginx worker processes (http, UID 33), rootless Podman containers (docker-data, UID 1100, so scontrol can query the PiKVM ATX API), and administrative users (root, UID 0; akadmin, UID 1101) are permitted outbound connections:

Rules in /etc/nftables.conf (chain output):

# Studio PiKVM (Direct KVM Access Protection — permits root 0, nginx 33, docker-data 1100, akadmin 1101)
ip daddr 10.0.0.7 tcp dport { 80, 443 } meta skuid != { 0, 33, 1100, 1101 } reject with tcp reset comment "Block direct local access to Studio PiKVM IPv4"
ip6 daddr fd77:7777:5010:0:e65f:1ff:fee4:8911 tcp dport { 80, 443 } meta skuid != { 0, 33, 1100, 1101 } reject with icmpx admin-prohibited comment "Block direct local access to Studio PiKVM IPv6"

# Studio Control Gateway Isolation
ip6 daddr fd77:7777:5010:0:1337:f1ac:d00d:5c01 tcp dport 8000 meta skuid != { 0, 33, 1101 } reject with icmpx admin-prohibited comment "Block direct access to Studio Control backend"

Layer 2: Pre-Shared Proxy Secret Header (X-Proxy-Secret)

Layer 3: Mutual TLS (mTLS) Client Certificate

Layer 4: Inbound Host Firewall on PiKVM (studio-kvm-ssh)

On PiKVM itself, firewall rules reject all incoming HTTP/HTTPS connections unless sourced from host ul:

iptables -A INPUT -p tcp -m multiport --dports 80,443 -s 10.0.0.100 -j ACCEPT
iptables -A INPUT -p tcp -m multiport --dports 80,443 -j DROP

ip6tables -A INPUT -p tcp -m multiport --dports 80,443 -s fd77:7777:5010:0:1337:f1ac:d00d:aaaa -j ACCEPT
ip6tables -A INPUT -p tcp -m multiport --dports 80,443 -j DROP

3. Authentik SSO Configuration


4. Studio Control Gateway (scontrol.drheck.dev)

4.1 Architecture & Implementation

4.2 Building & Restarting

# Build image in rootless Podman store and restart Quadlet service
(cd /data/docker/scontrol && sudo -u docker-data HOME=/home/docker-data XDG_RUNTIME_DIR=/run/user/1100 podman build -t localhost/scontrol:latest /data/docker/scontrol)
sudo systemctl --user -M docker-data@ restart scontrol.service

4.3 Orchestration Execution Pipeline (/api/stream/on)

  1. RF Power Outlets (YARD Stick One on PiKVM):
    • Connects to studio-kvm-ssh.drheck.dev via SSH using id_scontrol.
    • Runs sudo /home/luke/git/studio_yardstick/bin/studio-power all on to power Moroccan Lamp (mrc), Recording Rack (rack), Studio Computer (computer), Subwoofer (sub), Main PA Speakers (pa), TV Monitor (tv), and Neewer LED Lights (neewer).
  2. Motherboard ATX Power Ignition:
    • Queries PiKVM ATX state via GET https://studio-kvm-ssh.drheck.dev/api/atx.
    • If power rail is off, triggers POST https://studio-kvm-ssh.drheck.dev/api/atx/click?button=power and polls for rail confirmation.
  3. Studio Computer Boot Verification (bmo95.drheck.dev):
    • Probes DNS hostname bmo95.drheck.dev with a 100-second boot timeout.
  4. Soundcards & Audio Readiness:
    • Audits 4x Echo AudioFire 12 interfaces (hw:AudioFire12,0 through hw:AudioFire12_3,0) and Emagic Unitor8 USB MIDI interface.
    • Confirms jackd, zita-a2j, zita-j2a, a2jmidid, and ardour.service DAW readiness.

4.4 Strict Error Gating & Real-Time SSE Console


Revision #2
Created 2026-08-25 02:21:09 UTC by admin
Updated 2026-10-20 03:46:24 UTC by luKe