Skip to content

Phase 4: Identity, Certificates, and Access Control

In this phase, we configure centralized authentication and Zero Trust identity enforcement using Keycloak for SSO + MFA and Smallstep CA for certificates (TLS, SSH, and S/MIME).

🔐 Phase 4 – Identity and Certificate Management

Keycloak and Step-CA setup for MFA, RBAC, and issuing TLS/SSH certificates


🧩 Components

Tool Role
Keycloak Identity Provider (SSO, MFA, RBAC)
Smallstep CA Internal Certificate Authority
Tailscale Device-aware overlay VPN

🔐 Keycloak Setup

  1. Create a realm (e.g., cmmc)
  2. Define groups:
  3. admins, users, remote-only, etc.
  4. Enable MFA:
  5. Under authentication flows, add WebAuthn or OTP
  6. Create OIDC clients for:
  7. Mailcow, Nextcloud, Wazuh Dashboard, Caddy

📜 Smallstep CA Setup

  1. Initialize CA:
step ca init
  1. Issue user certificate for S/MIME:
step ca certificate "Alice Example" alice@example.com alice.p12
  1. Issue device certificate:
step ca certificate device1 device1.kell.local device1.crt device1.key
  1. Configure Caddy, Mailcow, and SSH to use certs from CA

🕸 Tailscale Integration

  • Devices join tailnet using identity login
  • Define ACLs in tailscale.com/admin/acls
  • Map access by Keycloak groups or device tags

🔒 Zero Trust Policies to Enforce

  • No service trust without cert
  • Admin access requires MFA + device cert
  • Audit login attempts via Keycloak and Step-CA logs

✅ Output of This Phase

  • Identity provider enforced for all apps
  • Certs issued to users, devices, and internal services
  • ACLs defined to isolate roles and data types

→ Proceed to Phase 5: Client Device Registration