Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 30 additions & 2 deletions SDD-Keylime-Monitoring-Tool.md
Original file line number Diff line number Diff line change
Expand Up @@ -1131,6 +1131,8 @@ Re-render with new data

#### 3.5.3 Authentication Flow

Users MAY browse the dashboard with the read-only Viewer role without authenticating when anonymous viewer mode is enabled (`anonymous_viewer = true`, SR-001); the flow below starts when the user signs in or triggers a privileged action.

```text
1. User navigates to /login
2. Login page presents OIDC login (or demo login)
Expand All @@ -1149,6 +1151,30 @@ Re-render with new data

**Trace:** SRS SR-001, SR-002, SR-010, SR-011

**OIDC Role Mapping (Bootstrap):**

Until IdP group-to-role provisioning is configured, step 7 above uses a bootstrap claim-to-role mapping:

```text
authenticated + MFA claim -> Admin
authenticated, no MFA -> Viewer (read-only fallback, SR-002)
unauthenticated (anonymous_viewer=true) -> Viewer (read-only, SR-001)
Operator -> reserved; no bootstrap mapping assigns it
```

* **MFA is verified at login, not deferred.** The backend MUST check the MFA claim (e.g., `amr`, `acr`, or a configurable custom claim) in the ID token before granting Admin (SR-002). A user whose token lacks the claim is not rejected: the session is granted the lowest applicable role (Viewer), preserving read-only access until the user re-authenticates with MFA. Role upgrade always requires a fresh IdP authentication; tokens are never upgraded in-session.
* **Anonymous viewer access is configuration-gated.** `anonymous_viewer = true | false` (default: `true` for internal deployments). When enabled, any request that reaches the backend is granted the read-only Viewer role without a session -- network reachability is the trust boundary. Deployments exposed beyond a trusted network MUST set `anonymous_viewer = false`, which restores authentication on every request. Privileged (Operator/Admin) capabilities always require an authenticated session regardless of this setting (SR-001).
* **Company users are Admin by default.** Any user who completes the OIDC flow against the configured corporate IdP realm with MFA receives Admin. No per-user role administration is required during bootstrap.
* **The mapping is configuration-gated.** `role_mapping = "bootstrap" | "groups"` (default: `bootstrap`), so the later switch to IdP group-based assignment is a configuration change, not a code change.
* **Bootstrap mode is time-boxed.** It MUST be replaced by group-based mapping before exposure beyond the corporate realm, and the threat model MUST record the admin-by-default posture as an accepted, time-boxed risk.
* **Operator remains in the RBAC model** (SR-003, section 3.6.2) and in code; only its assignment is deferred.
* **Audit actor.** With sessions in place, the audit log records the authenticated identity (`sub` / email claim) as the actor of every mutating action.

**Trace:** SRS SR-001, SR-002, SR-003

<!-- CHANGED: Added bootstrap OIDC role mapping to 3.5.3 -- Admin by default for MFA-authenticated company users, Viewer fallback when the MFA claim is missing, Operator deferred, mapping gated by configuration -->
<!-- CHANGED: Added anonymous viewer mode to 3.5.3 -- unauthenticated requests receive the read-only Viewer role when anonymous_viewer is enabled; the strict SR-001 posture applies when it is disabled -->

**Cockpit Authentication Flow (Alternative):**

```text
Expand Down Expand Up @@ -1500,7 +1526,8 @@ Maximum 5 parallel concurrent log fetches to the Verifier API, enforced via Toki
| Concern | Design Element | SRS Trace |
|---------|---------------|-----------|
| Authentication | OIDC flow with IdP, short-lived JWT (15 min) | SR-001, SR-010 |
| MFA | Required for Admin role via IdP policy | SR-002 |
| Anonymous viewer | `anonymous_viewer` config gate; unauthenticated requests confined to read-only Viewer; MUST be disabled for deployments exposed beyond a trusted network | SR-001 |
| MFA | Required for Admin role via IdP policy; missing MFA claim at login demotes to Viewer (bootstrap role mapping, 3.5.3) | SR-002 |
| Authorization (backend) | RBAC middleware checks `Role` in JWT claims | SR-003 |
| Authorization (frontend) | `canWrite()` / `isAdmin()` conditionally render controls | SR-003, SR-021 |
| Transport: Browser-API | TLS 1.3 minimum | SR-008 |
Expand Down Expand Up @@ -1630,7 +1657,8 @@ Maximum 5 parallel concurrent log fetches to the Verifier API, enforced via Toki

| SRS Req | SDD Section | Design Element |
|---------|-------------|----------------|
| SR-001 | 3.5.3 | OIDC authentication flow |
| SR-001 | 3.5.3 | OIDC authentication flow; config-gated anonymous Viewer access |
| SR-002 | 3.5.3, 5.1 | MFA claim verified before Admin is granted; Viewer fallback via bootstrap role mapping |
| SR-003 | 3.6.2, 5.1 | Three-tier RBAC: Viewer, Operator, Admin |
| SR-004 | 3.1.2 | mTLS with rustls for Keylime APIs |
| SR-005 | 3.8.1 | `MtlsConfig.key`: HSM/Vault URI |
Expand Down
39 changes: 31 additions & 8 deletions SRS-Keylime-Monitoring-Tool.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ The System transforms Keylime from a CLI-driven security tool into a visual oper

| Req ID | Description | RFC Level | Traceability Source |
|--------|-------------|-----------|---------------------|
| SR-001 | OIDC/SAML identity provider authentication | MUST | Dashboard Authentication - User Identity |
| SR-001 | OIDC/SAML authentication for privileged operations; config-gated anonymous Viewer | MUST | Dashboard Authentication - User Identity |
| SR-002 | MFA mandatory for Admin role | MUST | Dashboard Authentication - User Identity |
| SR-003 | Three-tier RBAC (Viewer, Operator, Admin) | MUST | Dashboard RBAC - Role Definitions |
| SR-004 | mTLS for all Keylime API communication | MUST | Threat Model - Trust Boundaries |
Expand Down Expand Up @@ -3806,32 +3806,51 @@ Feature: cockpit-bridge as Mandatory Proxy

### SR-001: OIDC/SAML Authentication

**Description:** The System MUST authenticate all users via an external OIDC or SAML identity provider. No local username/password authentication MUST be supported. The System MUST support multiple IdP configurations for federated environments.
**Description:** The System MUST authenticate all users who perform privileged operations (Operator or Admin capabilities) via an external OIDC or SAML identity provider. No local username/password authentication MUST be supported. The System MUST support multiple IdP configurations for federated environments. The System MUST support an anonymous viewer mode controlled by the `anonymous_viewer` setting: when enabled, unauthenticated users are granted the read-only Viewer role; when disabled, the System MUST authenticate all users. Privileged operations MUST require authentication regardless of this setting.

**Trace:** Dashboard Authentication - User Identity

```gherkin
Feature: OIDC/SAML Authentication

Scenario: Authenticate via OIDC provider
Given the dashboard is configured with an OIDC identity provider
Scenario: Unauthenticated browsing with anonymous viewer mode enabled
Given the dashboard has anonymous viewer mode enabled
When a user navigates to the dashboard without a session
Then the System MUST grant the user the read-only Viewer role
And the System MUST NOT redirect the user to the identity provider

Scenario: Privileged action requires authentication
Given the dashboard has anonymous viewer mode enabled
When an unauthenticated user attempts an Operator or Admin capability
Then the System MUST return HTTP 401 Unauthorized
And the frontend MUST offer the OIDC login flow

Scenario: Anonymous viewer mode disabled
Given the dashboard has anonymous viewer mode disabled
When a user navigates to the dashboard without a session
Then the System MUST redirect the user to the OIDC provider login page
And upon successful authentication, the user MUST be redirected back with a valid session
And no unauthenticated access to the dashboard MUST be permitted

Scenario: Authenticate via OIDC provider
Given the dashboard is configured with an OIDC identity provider
When a user initiates login and completes authentication at the provider
Then the user MUST be redirected back to the dashboard with a valid session

Scenario: OIDC provider unreachable
Given the OIDC identity provider is unreachable
When a user attempts to log in
Then the System MUST display an error "Authentication service unavailable"
And no unauthenticated access to the dashboard MUST be permitted
And no privileged access to the dashboard MUST be permitted

Scenario: Session token expired
Given the user's session token has expired
When the user attempts any dashboard action
When the user attempts a privileged dashboard action
Then the System MUST redirect the user to re-authenticate via the IdP
And the user MUST be returned to their original page after re-authentication
```

<!-- CHANGED: SR-001 amended to add config-gated anonymous viewer mode -- authentication is mandatory for privileged operations and whenever anonymous viewer mode is disabled; unauthenticated access is confined to the read-only Viewer role -->

> **Cockpit Deployment Note:** In Cockpit deployments, PAM-based system login replaces OIDC/SAML authentication. The OIDC flow described above MUST NOT be used when the plugin runs inside Cockpit. Authentication is handled by Cockpit's PAM login screen before the plugin loads. See SR-030, FR-092.

### SR-002: MFA for Admin Role
Expand Down Expand Up @@ -4494,7 +4513,7 @@ Feature: PAM Authentication in Cockpit Mode

As defined in the source presentation, the implementation follows three phases:

**Phase 1 — Secure Foundation:** Agent fleet list, agent state monitoring, OIDC/SAML authentication, three-tier RBAC, tamper-evident audit log, mTLS to Keylime APIs. *Exit criteria: all API access authenticated, RBAC enforced on every endpoint, audit log captures all actions, mTLS key never on disk in cleartext, threat model reviewed, penetration test passed.*
**Phase 1 — Secure Foundation:** Agent fleet list, agent state monitoring, OIDC/SAML authentication, three-tier RBAC, tamper-evident audit log, mTLS to Keylime APIs. *Exit criteria: all privileged API access authenticated, anonymous access (when enabled) confined to read-only Viewer capabilities (SR-001), RBAC enforced on every endpoint, audit log captures all actions, mTLS key never on disk in cleartext, threat model reviewed, penetration test passed.*

**Phase 2 — Operations:** Attestation analytics, policy management UI, certificate monitoring, alert notifications, push mode (v3 API) support, SIEM integration, WebSocket updates, SSRF-validated webhooks, Prometheus metrics endpoint.

Expand Down Expand Up @@ -4541,8 +4560,12 @@ The design details that realize these requirements -- including component decomp
| IR-021: Cockpit Context View | 3.1.3 | Context View |
| IR-022: Cockpit Plugin Composition | 3.2.4 | Composition View |
| IR-023: Cockpit Bridge Interface Contracts | 3.4.6 | Interface View |
| IR-024: Bootstrap OIDC Role Mapping | 3.5.3 | Interaction View |
| IR-025: Anonymous Viewer Access | 3.5.3 | Interaction View |

<!-- CHANGED: Added IR-020 for background attestation recording -->
<!-- CHANGED: Added IR-021 through IR-023 for Cockpit plugin deployment model -->
<!-- CHANGED: Added IR-024 for bootstrap OIDC role mapping (Admin by default with MFA, Viewer fallback, Operator deferred) -->
<!-- CHANGED: Added IR-025 for config-gated anonymous viewer access (unauthenticated requests receive read-only Viewer) -->

The SDD also includes a full SRS traceability matrix (Section 6) mapping every implemented requirement to its corresponding design element.