Phase 4: SSO scaffolding, RBAC enforcement, tenant-scoped dashboards, audit logging, K8s deployment

RBAC (api/internal/authz) is live on /query and /dashboards, backed by a
new enterprise/ module (session issuance, audit logging, RBAC storage,
OIDC/SAML protocol wiring) that core never imports -- only calls over
HTTP. Found and fixed a real cross-tenant vulnerability in dashboards
(no tenant_id filtering at all) while writing the threat model doc.

Two things are explicitly NOT done, documented rather than hidden:
tenant isolation for log data itself (/query still shares one ClickHouse
connection and Tantivy index across every tenant -- RBAC controls who
can query, not what a query can see), and human SSO login (protocol
wiring exists, no HTTP handler calls it yet). See
docs/security/threat-model.md and docs/phase-4-runbook.md.

Also adds deploy/ (Go Operator + Helm chart, validated offline only --
no cluster was reachable in this environment).
This commit is contained in:
2026-08-13 22:16:59 -07:00
parent 9435115ab7
commit 3eb0f4c589
116 changed files with 8589 additions and 126 deletions
+66
View File
@@ -0,0 +1,66 @@
<script lang="ts">
import { getAuthFeatures, enterpriseAuthBase, type AuthFeatures } from '$lib/api';
let loading = $state(true);
let features = $state<AuthFeatures>({ sso_configured: false, oidc_enabled: false, saml_enabled: false });
async function load() {
loading = true;
features = await getAuthFeatures();
loading = false;
}
load();
</script>
<main>
<h1>Settings</h1>
<section>
<h2>Core</h2>
<p>Single-tenant deployment settings live here. Nothing configurable yet.</p>
</section>
{#if loading}
<p>Loading…</p>
{:else if features.sso_configured}
<section>
<h2>Single sign-on</h2>
<ul>
{#if features.oidc_enabled}<li>OIDC configured</li>{/if}
{#if features.saml_enabled}<li>SAML configured</li>{/if}
</ul>
<p class="note">
User/role management isn't built yet -- an Admin or Owner will manage tenant members here once
it is.
</p>
</section>
{:else if enterpriseAuthBase}
<section>
<h2>Single sign-on</h2>
<p class="note">enterprise-auth is deployed but no SSO provider is configured yet.</p>
</section>
{/if}
<!-- No section at all when enterpriseAuthBase is unset -- a Phase 0-3-style
single-tenant deployment with no enterprise/ deployed sees a settings
page with core content only, no dead "upgrade to unlock" link. See
/docs/phase-4-rbac-design.md's "Web UI boundary" section. -->
</main>
<style>
main {
font-family: system-ui, sans-serif;
max-width: 960px;
margin: 2rem auto;
padding: 0 1rem;
}
section {
margin-bottom: 1.5rem;
}
h2 {
font-size: 1.1rem;
}
.note {
color: #666;
font-size: 0.85rem;
}
</style>