pamv1

module
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2026 License: Apache-2.0

README

pamv1

⚠️ Beta · for learning purposes. This is an educational project built to explore how a Privileged Access Management system works end to end. Beta means feature-complete against its roadmap — every phase through 52g has shipped, every finding of its own security self-audit is closed, and every capability is exercised by tests and deploys as code. It still has not been audited by anyone outside the project and is not production-ready — do not use it to guard real privileged credentials. Use it to learn, experiment and contribute.

🟢 Living document — updated in the same change as the code, without a separate ask (the policy is in the documentation hub).

CI Release Go PostgreSQL

Open-source Privileged Access Management (PAM) in Go. pamv1 keeps privileged credentials in a hardened vault and then puts a broker between the requester and the machine: it authenticates the requester, decrypts the secret just-in-time, injects it into the connection itself, and records everything. The password reaches the target — it never reaches the person (or, now, the AI agent) who asked. On top sits an unapologetically AS/400 / IBM 5250 green-screen console, because touching a PAM should feel serious.

The one idea. Trust the chokepoint, not the requester. Every privileged action — a human SSH session, a Windows command, an AI agent's tool call — flows through one audited control plane that holds the secret and hands back only the result. Take away the credential from the requester and most of the attack surface goes with it.

pamv1 AS/400 / 5250 green-screen main menu
The management console — an AS/400 / IBM 5250 green-screen, keyboard-first (the mouse is optional).

Built phase by phase with a single rule: every phase is functional end to end — it runs, passes tests, and deploys as Infrastructure-as-Code. The roadmap runs 0–62 and every phase has shipped, and the current tagged, cosign-signed release is v0.11.0 (2026-08-07; the first was v0.10.0 on 2026-07-28). What that adds up to: JIT session brokering for SSH, PostgreSQL, WinRM and in-portal RDP; RBAC + custom profiles with AD/Entra/OIDC login and TOTP MFA; break-glass with M-of-N quorum unseal; safes and dependent-account propagation; Zero Standing Privilege via ephemeral SSH certificates; supervised sessions (live watch, command control, in-session step-up, a cluster-wide kill switch); an AI-agent access broker (policy over the tool and its arguments, JIT server-side execution, a verifiable audit chain, MCP transport, SPIFFE identity); access governance (certification campaigns, an ITSM gate, N-of-M approvals, vendor contract grants); privileged threat analytics and an identity blast-radius / CIEM engine; OT adaptation and NIS2 tooling; and the full 5250 console, keyboard-first. It is a beta, educational codebase — feature-complete against its roadmap and self-audited, but unaudited by outsiders: read it, run it, learn from it, and don't trust it with real secrets.

🔎 Live overview: interactive project page — what works, architecture and roadmap at a glance  ·  📖 Léelo en español →

Documentation

📚 Documentation hub — living docs with reading paths by audience (new / operator / admin / developer / auditor / OT). Start there, or jump to:

Architecture

Requesters — human or machine — never touch the data zone or the targets directly. The control plane brokers everything; the vault is the only thing that can turn ciphertext back into a usable secret, and only for the length of a dial.

flowchart TB
    subgraph REQ[" Requesters · untrusted "]
        direction LR
        OPS["Operator / Admin<br/>portal · ssh · REST"]
        AGENT["AI agent<br/>key / SPIFFE SVID"]
        AUD["Auditor<br/>reads the trail"]
    end

    subgraph CP[" pamv1 control plane · trusted "]
        direction LR
        API["Portal + REST API<br/>authn · RBAC · audit"]
        PROXY["Session proxy<br/>JIT injection · recording"]
        BROKER["Agent broker<br/>policy · JIT · MCP"]
        VAULT["Vault<br/>AES-256-GCM envelope"]
    end

    DB[("PostgreSQL<br/>hardened · encrypted")]

    subgraph TGT[" Targets · IT / OT "]
        direction LR
        LNX["Linux<br/>SSH"]
        WIN["Windows<br/>WinRM · RDP"]
    end

    OPS --> API
    OPS --> PROXY
    AGENT --> BROKER
    AUD --> API
    API --> VAULT
    PROXY --> VAULT
    BROKER --> VAULT
    VAULT --> DB
    API --> DB
    PROXY --> LNX
    PROXY --> WIN
    BROKER --> LNX
    BROKER --> WIN

How just-in-time injection works

Four moves, one guarantee: the requester is authenticated but never learns the target's credential. The secret exists in plaintext only inside the control plane, only after every authorization gate has passed, and only for the upstream dial.

sequenceDiagram
    autonumber
    actor Op as Operator
    participant PX as pamv1 proxy
    participant V as Vault
    participant T as Target (SSH)
    participant A as Audit

    Op->>PX: ssh root@web-01@pam-host<br/>(password = PAM key)
    PX->>PX: authenticate · RBAC · grants · approval
    PX->>V: fetch + decrypt credential (JIT)
    V-->>PX: plaintext secret (in memory only)
    PX->>T: dial + authenticate upstream
    PX->>A: session.start + recording hash
    T-->>Op: brokered, recorded I/O
    Note over Op,T: the operator never sees the secret
    PX->>A: session.end (on close)

The AI-agent broker makes the same move for a tool call: policy decides allow / deny / require-approval on the tool and its arguments, an approved call runs server-side with a JIT credential, and the agent receives only the result.

What works today

Phases 0–55, grouped by area. Every capability is exercised by tests and deploys as code.

Identity & access
  • Role-based access control + custom profiles — four built-in roles (admin, user, auditor, approver) plus custom permission profiles: name any capability set (read_inventory, manage_credentials, connect, reveal_secret, read_audit, approve, …) and assign it to a user like a role. A single role/profile→capability matrix is enforced by both the REST API and the SSH proxy; admins mint per-user access tokens (stored only as SHA-256); every denial is audited under the real username.
  • AD, Entra ID & OIDC single sign-on — sign in with an AD username + password over LDAPS, with Microsoft Entra ID, or via OIDC Authorization Code + PKCE SSO (the IdP does the login and its MFA; pamv1 validates the ID token's RS256 signature against the IdP's JWKS). Directory groups / app roles map to the roles, and login issues a short-lived session token that works in the portal and the proxy. Sources compose; local tokens and break-glass remain the emergency path.
  • TOTP multi-factor auth — self-service enrollment (RFC 6238, any authenticator app); the secret is stored vault-encrypted and login requires the 6-digit code once enrolled. Single-use recovery codes and an optional require-MFA-for-all policy (with enrollment-only first sign-in).
  • Safes (delegated-access containers) — group targets into a named safe with its own members; a member may connect to every target in the safe (an authorization path alongside per-target grants), and a can_manage member is a delegated safe administrator. Placing a target in a safe restricts it to the safe's members. POST /api/safes, /api/safes/{id}/members, PUT /api/targets/{id}/safe.
Sessions & the JIT proxy
  • Session proxy with JIT injection — operators connect through an SSH gateway; the proxy authenticates them, pulls the credential from the vault, decrypts it only at connection time (and only after every authorization gate passes), injects it into the upstream session and records everything. Proven end to end by an integration test where the upstream accepts only the vaulted password the client never possessed. Upstream host keys can be pinned (PAM_SSH_KNOWN_HOSTS); a jump-host/bastion path and read-only observer sessions are supported.
  • Windows targets (WinRM + RDP) — run commands on Windows hosts via POST /api/targets/{id}/winrm (basic or NTLM) or an interactive WinRM loop through the proxy, or broker a full RDP desktop through Apache Guacamole (GET /api/targets/{id}/rdp WebSocket tunnel, cert-verified by default). The in-portal viewer is built in — open Work with Targets → option 7 and the desktop renders on a canvas (the portal vendors the Guacamole JS client; guacd itself ships in the deploys). Either way the credential is injected just-in-time (AD-joined accounts work), sessions are audited, and the operator never sees the secret. The session clipboard is gated by PAM_RDP_CLIPBOARD (allow/readonly/deny, tightenable per target — strictest wins) and drive redirection is always disabled — so an RDP session can't be used as an unaudited copy-out/paste-in or file channel — and PAM_RDP_CLIPBOARD_AUDIT records what actually crossed it (direction, type, size, SHA-256; content only under an explicit opt-in, since a privileged clipboard often holds a just-copied password).
  • Database session proxy (SQL Server) — the TDS sibling of the PostgreSQL broker (PAM_MSSQL_ADDR, e.g. :1433): point sqlcmd at pamv1 with -U '<dbcred>@<target>' and your PAM key as the password. Same authorization gates, the vaulted SQL login injected into the client's own LOGIN7 just-in-time, every statement audited — including the ones drivers send through sp_executesql, which a procedure-name-only parser would miss — plus recording, live monitoring, step-up and cluster-wide kill. The TDS codec is hand-rolled (no new dependency) and its tests are pinned to spec-derived byte literals; TLS is available on both legs but is not the default: the operator leg is encrypted only when PAM_TLS_CERT/PAM_TLS_KEY are set — until then the PAM key travels as the TDS password in cleartext — and PAM_REQUIRE_DB_CLIENT_TLS makes that fail closed. Proven end to end by a fake upstream that accepts only the vaulted secret — interop against a real SQL Server is not yet verified.
  • VNC desktops — brokered through the same Guacamole path as RDP and rendered in the portal (Work with Targets → option 7): the vaulted VNC password is injected server-side, the session is audited and recorded, and the clipboard obeys the same gate (PAM_RDP_CLIPBOARD, tightenable per target) while VNC's SFTP file channel is forced off. Worth knowing what VNC itself is: plaintext RFB, no server authentication, and a password DES-truncated to 8 characters — which is precisely the argument for brokering it rather than exposing it (see PROTOCOLS-AND-CRYPTO §3.5).
  • Database session proxy (PostgreSQL) — point psql at pamv1 (PAM_DB_ADDR, e.g. :5433) with user=<dbcred>@<target> and your PAM key as the password; the proxy runs the same authorization gates as the SSH proxy, injects the vaulted DB credential just-in-time (upstream auth via cleartext / MD5 / SCRAM-SHA-256), and brokers the wire protocol — auditing every SQL statement (db.query) and recording the session. The operator never learns the database password. Proven end to end by a fake upstream that accepts only the vaulted secret.
  • Session recording — every session (stdout and stderr, or each SQL statement) captured in asciicast v2, hashed with SHA-256 into a tamper-evident chain, and the hash written to the audit trail. Recording failures are audited, and PAM_REQUIRE_RECORDING refuses an unrecordable session outright — on the SSH, WinRM and PostgreSQL proxies and, since Phase 52c, on the in-portal RDP viewer and the REST WinRM endpoint, checked before anything reaches the target.
  • Supervised sessions (live monitoring + command control) — a supervisor can watch an SSH, PostgreSQL or WinRM session live — and the agent broker's ssh_exec/winrm_exec runs — over GET /api/sessions/{id}/stream (Server-Sent Events, CapReadAudit); the stream ends the moment the session does, so a quiet pane means a quiet session, not a dead one. In an HA deployment both the session listing and the watch are cluster-wide (Phase 55): the request can land on any replica, and the hosting replica relays a watched session's output over the store — only while someone is actually watching. A regex denylist (PAM_COMMAND_DENY_FILE) blocks a dangerous command before it reaches the target on the exec, WinRM and SQL paths — refused and audited (command.blocked). A deny file that yields no usable patterns is fatal at startup rather than a silently disabled control, so an unmounted ConfigMap fails loudly. Interactive SSH shells use read-only observer mode instead.
  • In-session step-up — where command control is a hard block, PAM_DB_STEPUP_FILE marks statements that pause for a live supervisor decision instead of killing the session: the statement waits (audited, visible on the live monitor), an approver allows or refuses it from the console, and the session survives either way.
  • Cluster-wide kill switch — a kill issued on any replica terminates the session wherever it is hosted (published over Postgres LISTEN/NOTIFY), so the kill switch, the revoke cascade, the vendor sweeper and the analytics auto-response all work in HA. Every brokered execution — the REST WinRM endpoint and the agent broker's exec tools included — is a registered, killable, capped session, not just the interactive proxies.
  • SFTP file-transfer control — SFTP rides an SSH subsystem carrying a binary protocol that command control never saw. The proxy now parses that stream to audit every file operation (sftp.open/sftp.modify), and PAM_SSH_SFTP sets the policy: allow (forward + audit), readonly (refuse uploads, deletes and renames with a synthesized permission-denied — the target is never contacted; downloads still work), or deny (refuse the subsystem entirely). PAM_SSH_SFTP_DENY_FILE adds the other dimension — a regex denylist over paths (the same engine as command control), refused in every mode including downloads and on both sides of a rename (the classic packet and the OpenSSH SSH_FXP_EXTENDED operations a modern client actually sends — posix-rename, hardlink, lsetstat), because a path you deny that can still be fetched is not denied at all. And with PAM_SSH_SFTP_CAPTURE, the content itself is recorded (Phase 59): every transferred file leaves a chunk-log artifact beside the session recordings — sealed under the vault KEK, SHA-256 hash-chained, attributed in the audit trail, and replayable from the console as the reconstructed bytes; a per-file cap refuses (not merely stops recording) anything larger, and an unparsable stream fails closed while capture is on. Closes an otherwise unaudited file-exfiltration path. Proven end to end by a real SFTP client + server exchanging genuine packets through the proxy.
Vault & credential lifecycle
  • Hardened vault (envelope encryption) — each secret is sealed with a per-secret AES-256-GCM data key that is wrapped by a pluggable Key Encryption Key (KEK): a local key for dev/test, or in production HashiCorp Vault Transit, AWS KMS, or an on-prem HSM via PKCS#11 (pkcs11-tagged build) — the root key never leaves the KMS/HSM. Additional Authenticated Data binds each ciphertext to its owning target (a copied token fails to decrypt); versioned v2: tokens enable online KEK rotation.

  • Target inventory & credentials API — Linux/Windows machines with ssh/winrm/rdp endpoints; credentials are vaulted, listed (never returning secret material), revealed on demand (audited), and deleted. The JSON model cannot serialize the ciphertext (json:"-").

  • Credential lifecycle (rotation · reconciliation · checkout · discovery) — POST /api/credentials/{id}/rotate generates a strong secret, sets it on the target (SSH chpasswd / WinRM net user / fresh ssh_key), and re-vaults it — the new password is never shown. /reconcile verifies the vaulted secret still authenticates and flags out-of-sync drift (?remediate=true heals it). Checkout/check-in grants an exclusive time-boxed lease and rotates the secret on return. Discovery (/api/discovery/scan) probes hosts for SSH/WinRM/RDP ports and can auto-onboard targets. A background worker rotates aged secrets and reconciles on a schedule; secrets can be rotated the moment a proxied session ends. Dependent accounts — declare a credential's consumers (Windows Services / Scheduled Tasks / IIS App Pools) and rotation updates each over WinRM, so rotating a service account doesn't break production.

  • Zero Standing Privilege & operator certificates — an ssh_ca credential stores no secret at all: the proxy mints a short-lived SSH certificate just-in-time per session. Operators can also prove possession of their own key and receive a short-lived certificate scoped to one principal and source address, revocable by serial through a published KRL. The host and CA keys are held in shared custody (vault-encrypted in the database, claimed atomically), so scaling past one replica no longer hands operators a different host key per pod.

Audit, break-glass & alerting
  • Audit trail — an append-only record of every sensitive action, with actor attribution, plus a tamper-evident export (GET /api/audit/export, JSON/CSV + SHA-256 digest) for incident reporting.
  • Operational logs — structured slog to stdout, one line per HTTP request and per proxy session, tagged by service (server/api/proxy/store); JSON for a SIEM or text for humans (PAM_LOG_LEVEL, PAM_LOG_FORMAT). Separate from the audit trail; secrets are never logged.
  • Tamper-evident audit chain — set PAM_AUDIT_HMAC_KEY and every audit event is HMAC-linked to the previous one, so an edit, a reorder or a deletion is detectable (GET /api/audit/verify); an ed25519-signed head checkpoint (/api/audit/head), archived out-of-band, also catches tail truncation, which a chain alone cannot.
  • Continuous audit→SIEM forwarding — every event streamed to a collector as it is written (PAM_AUDIT_FORWARD_ADDR) in RFC 5424 syslog, ArcSight CEF or IBM QRadar LEEF, over UDP, TCP or TLS with always-on certificate verification — from a durable cursor with spool-and-retry, leader-locked so N replicas produce one stream. Plus a pull-based OCSF export for schema-normalized SIEM ingest.
  • Retention with WORM archiving — aged recordings and audit rows are swept on a schedule, and with PAM_RETENTION_ARCHIVE_DIR set the sweep becomes archive-then-prune: rows are exported as digest-stamped JSON Lines and recordings are moved into a write-once archive, and the delete runs only if the archive succeeded — a broken archive costs disk space, never evidence.
  • Recordings protected at rest — PAM_RECORDING_ENCRYPT seals each recording as chunked AES-256-GCM under a per-recording key wrapped by the same KEK that protects credentials, and PAM_RECORDING_OPAQUE_NAMES strips target and actor from the file name too (the mapping moves into the audit trail, behind the same capability as replay).
  • Break-glass (v2) — a sealed emergency key, or M-of-N quorum unseal (Shamir shares split with -split-key; custodians POST shares to reconstruct it). Either way you get a short-lived, auto-expiring admin session, and every break-glass access/unseal is loudly audited and alerted in real time (webhook, syslog or email).
Configuration & the management console
  • AS/400 management console — a full role-aware console in green phosphor: Sign On, a numbered main menu, and menu-driven Work with… screens for targets & grants, credentials (reveal/check-out/rotate/reconcile), active sessions (live monitor + kill + a live watch pane), 4-eyes access requests (ticket, N-of-M approvals, scheduled windows), users & profiles, MFA, discovery, reconciliation, audit (filter + CSV export), break-glass, permission profiles, system configuration, effective config + IaC export, application secrets, safes, certification campaigns, risk analytics, session-recording replay, the two human decision points (approve an agent's parked tool call · decide a paused statement), vendors & contract grants, operator SSH certificates, identity blast radius, login sessions and AI-agent keys — numeric options (2=Change, 4=Delete, 5=Display), F-keys, scanlines. Every shipped capability is operable from the console; nothing is curl-only. It is keyboard-first (the mouse is optional): focus lands on each screen's field, Esc goes back, ↑/↓ move between rows. The menu shows only what your role permits.


Menu 15 — Work with application secrets: mint app identities and grant them individual credentials (Tier-4).

  • Hot-swappable configuration — the identity, SSO and operational-policy settings become editable settings persisted in the database and applied live without a restart (secrets vault-encrypted at rest, a rejected change rolled back). A read-only effective-config + backend-health screen and an IaC export (env / Helm / Terraform) round-trip console changes back into code. Bootstrap and networking/TLS deliberately stay environment-only.
The AI-agent access broker

PAM for AI agents — the same chokepoint, extended to autonomous tools. Opt-in via PAM_BROKER_POLICY_FILE.

  • Policy over tool + arguments — a sudoers-style YAML engine decides allow / deny / require-approval on the tool and its arguments (first match wins, implicit deny); an approved call runs server-side with a just-in-time credential and the agent gets only the result. Tools: winrm_exec, ssh_exec, list_targets, list_credentials, rotate_credential, and reveal_credential (shipped default-deny). Agents obey the same target grants and four-eyes gate as humans.
  • Human approval + single-use resume — a require_approval call parks for a human decision (/v1/approvals); on approval it executes and the agent collects the result exactly once with a single-use token.
  • Verifiable audit — every step is a keyed-HMAC hash-chained event (GET /v1/audit/verify, plus an ed25519-signed head checkpoint for truncation detection) kept separate from the general trail. The chain's own keys live under shared custody — generated once, KEK-sealed in the store, converged on by every replica, re-wrapped by -rotate-kek — unless you set them explicitly in the environment, which is also how a signer rotation is driven.
  • MCP transport + SPIFFE identity — the broker speaks MCP (JSON-RPC 2.0 at POST /mcp) at parity with REST, and agents authenticate with a static key or a SPIFFE JWT-SVID (RS256/ES256/EdDSA, trust-domain JWKS) with RFC 8693 delegation chains bounded by a depth cap.
OT / industrial & compliance
  • OT session approval (4-eyes) — gate a target behind an approved access request: a user files it, a different approver approves (self-approval refused), and only then may the user connect — enforced on the SSH proxy, WinRM and RDP, with break-glass as the bypass. Per-target (require_approval) or global (PAM_REQUIRE_APPROVAL), time-boxed for maintenance windows.
  • Third-party vendor access gate — a vendor reaches a target only inside a time-boxed contract grant a customer approved (never the vendor), with live employment attestation; an offboard revokes every grant and cuts live sessions instantly, a sweeper ends sessions the moment the window closes, and per-vendor evidence exports carry a SHA-256 digest.
  • Access certification with real separation of duties — periodic campaigns snapshot who has access to what; a dedicated approver certifies or revokes each item without holding any access-granting capability, and the principal who created a grant cannot certify it themselves (revoking your own grant stays allowed — it only reduces access).
  • Identity blast radius (CIEM) — a read-only AWS IAM effective-permission evaluator over a normalized identity graph: escalation-path traversal, toxic-combination findings, and remediation-as-code that names the earliest edge to cut.
  • OT hardening — per-zone protocol allowlists (PAM_ALLOWED_PROTOCOLS), read-only observer sessions, and an air-gap mode (PAM_OT_AIRGAP) that makes zero outbound calls. See the OT Deployment Guide and the NIS2 Compliance Pack.
Storage & operations
  • PostgreSQL storage via pgx with embedded, versioned migrations; an in-memory store for tests and demos; optional CloudNativePG HA.
  • Observability — a dependency-free Prometheus /metrics endpoint (request counts by status, audit volume, break-glass use, rotations, active-sessions gauge), plus a health/readiness split (/healthz liveness, /readyz checks the database).
  • IaC deployment — Docker (distroless, non-root), docker-compose with hardened Postgres, Kubernetes manifests under the restricted Pod Security Standard, a Helm chart, and a Terraform module. The release pipeline builds by digest with an SBOM, cosign keyless signature and SLSA provenance — see Verifying a release. Current release: v0.11.0 (2026-08-07; first was v0.10.0) — the signed image is public at ghcr.io/morandeirachema/pamv1:0.11.0, which is what every manifest here pins, so the published-artifact paths below work.
  • Encrypted secrets in git — the Kubernetes secret manifest can be sealed with SOPS + age: values are encrypted while kind/metadata stay reviewable, decrypted at deploy time (sops -d | kubectl apply -f -, plaintext never on disk) or natively by Flux / Argo / helm-secrets — so secrets live in the same IaC repo without leaking. See deploy/k8s/sops/.
  • Or source secrets from CyberArk Conjur — as a runtime alternative to SOPS, set PAM_CONJUR_URL and pamv1 fetches its own bootstrap secrets (master key, API key, DB URL, …) from Conjur at startup, authenticating with a host API key or a Kubernetes authn-jwt projected token — so no bootstrap secret lives in Git at all. Both mechanisms ship; SOPS stays the zero-dependency default. See deploy/k8s/conjur/.

Roles, users & profiles

Four built-in roles, enforced identically by the API and the proxy, plus custom profiles:

Role Can Cannot
admin manage targets/credentials/users, reveal secrets, connect, read audit, manage config/profiles —
user connect to targets through the proxy, read the inventory manage, reveal, read audit
auditor read the inventory and the audit trail manage, reveal, connect
approver read inventory + audit, approve access requests manage, reveal, connect

Need something in between? Define a custom profile — a named capability set — and assign it like a role (menu 12, or POST /api/profiles). The four built-ins stay unchanged.

An admin creates a user and receives that user's access token once:

curl -H "X-API-Key: $PAM_API_KEY" -X POST http://localhost:8080/api/users \
  -d '{"username":"alice","role":"user"}'
# → {"id":1,"username":"alice","role":"user","token":"pamt_…"}   (store it now)

The user then presents that token as X-API-Key (portal Sign On) or as the SSH proxy password. The bootstrap PAM_API_KEY is the admin identity; the break-glass key is also admin (audited loudly). For directory-backed sign-in, AD/Entra/OIDC map directory groups to these same roles.

Connect through the proxy (JIT injection)

Once a target and its credential are vaulted, operators reach the target through pamv1 — the secret is decrypted only for the upstream dial and is never shown:

# username selects the target; SSH password is your PAM API key (or per-user token)
ssh -p 2222 web-01@pam-host                 # first credential of target "web-01"
ssh -p 2222 root@web-01@pam-host            # a specific credential (user "root")

The proxy authenticates you, pulls root's password from the vault, injects it into the upstream SSH connection, records the session (asciicast v2) with a SHA-256 in the audit trail, and proxies your I/O. You never see the credential. Recordings go to PAM_RECORDING_DIR; disable the proxy with PAM_SSH_ADDR=off.

Roadmap

Every phase (0–55) has shipped — full per-phase detail in ROADMAP.md:

Phase Theme Status
0 Project foundation ✅ shipped
1 Core: vault, inventory, audit, portal ✅ shipped
2 SSH session proxy with JIT injection ✅ shipped
3 Identity & access control (RBAC, AD/Entra/OIDC, MFA) ✅ shipped
4 Windows targets (WinRM + RDP via Guacamole) ✅ shipped
5 Hardening: database, vault, transport ✅ shipped
6 Break-glass v2 (M-of-N quorum) ✅ shipped
7 Credential lifecycle (rotation, reconciliation) ✅ shipped
8 OT adaptation (4-eyes approvals, air-gap) ✅ shipped
9 NIS2 compliance pack ✅ shipped
10 Scale & operations (metrics, Helm, HA, signed releases) ✅ shipped
11 Full 5250 management console ✅ shipped
12 Configuration subsystem + custom-profile RBAC + hot-swap ✅ shipped
13 AI-agent access broker (policy, JIT tools, verifiable audit, MCP, SPIFFE) ✅ shipped
14 SOPS-encrypted Kubernetes secrets (age; Flux/Argo/helm-secrets) ✅ shipped
15 PostgreSQL database session proxy (JIT injection + query audit) ✅ shipped
16 Live session monitoring (SSE) + command control ✅ shipped
17 Safes (delegated-access containers) + dependent-account propagation ✅ shipped
18 CyberArk Conjur secret sourcing (optional, alongside SOPS) ✅ shipped
19 Access certification / attestation campaigns ✅ shipped
20 ITSM / ticketing gate on access requests ✅ shipped
21 Richer approval workflows (N-of-M, scheduled windows, reason codes) ✅ shipped
22 Zero Standing Privilege (ephemeral short-lived SSH certificates) ✅ shipped
23 Privileged threat analytics (behavioral risk scoring + auto-response) ✅ shipped
24 Application-secrets API (Conjur-style delivery for non-agent apps) ✅ shipped
25 Console parity (safes, campaigns, risk analytics, live session viewer) ✅ shipped
26 Session-recording playback (hash-verified replay) + one-time access ✅ shipped
27 AI-agent broker completion (SoD, signed audit checkpoints, OCSF export, MCP SSE + elicitation) ✅ shipped
28 Operator-issued SSH certificates (JIT certs for humans, KRL revocation) ✅ shipped
29 Third-party vendor access gate (time-boxed contract grants, employment attestation, offboard cascade) ✅ shipped
30 In-session policy + step-up (numeric policy comparators, pause-for-supervisor on the DB proxy) ✅ shipped
31 Identity blast-radius / CIEM engine (AWS IAM effective-permission evaluator + escalation paths) ✅ shipped
32 SFTP file-transfer control + audit (parse the subsystem stream; allow/readonly/deny) ✅ shipped
33 RDP clipboard control (gate the Guacamole clipboard bridge; drive redirection off) ✅ shipped
34 HA session kill-switch (cross-replica kill over Postgres LISTEN/NOTIFY) ✅ shipped
35 Audit→SIEM push forwarding (continuous RFC 5424 syslog / CEF stream) ✅ shipped
36 Retention / pruning (aged recordings + audit rows; integrity-preserving) ✅ shipped
37 Gap-analysis pass (child-resource deletes scoped to their parent; failed bearer credentials throttled + audited on every surface) ✅ shipped
38 Command control on every command path (one shared cmdguard; the REST WinRM endpoint and the broker's exec tools now obey the denylist) ✅ shipped
39 Approver capability on the two decision points (step-up release and certification decisions move to approve) ✅ shipped
40 Every brokered execution is a supervised session (REST WinRM + agent exec tools join the live-session registry) ✅ shipped
41 Session recordings encrypted at rest (chunked AES-256-GCM under the vault KEK; tamper evidence unchanged) ✅ shipped
42 Shared custody of the SSH host and CA keys in HA (atomic claim in the store; replicas converge on one key) ✅ shipped
43 Console: the two human decision points (approve an agent's parked tool call · decide a paused statement) ✅ shipped
44 Editable objects and bounded lists (PUT edit-in-place; every inventory list is a clamped ?limit=&after= cursor) ✅ shipped
45 The remaining console screens (vendors, operator certs, blast radius, login sessions, agent keys, dependents, audit chain) ✅ shipped
46 Per-item four-eyes on certification (grants record their creator; you cannot certify access you granted) ✅ shipped
47 LEEF format + TLS transport for the SIEM forwarder (RFC 5425, always-on certificate verification) ✅ shipped
48 Opaque recording file names (metadata moves from the filename into the audit trail) ✅ shipped
49 Archive to WORM before pruning (digest-stamped export; the delete runs only if the archive succeeded) ✅ shipped
50 Clipboard auditing on the RDP bridge (direction, type, size, digest; content opt-in) ✅ shipped
51 SFTP path policy (regex denylist over paths, refused in every mode and on both sides of a rename) ✅ shipped
52 Close the command-injection findings (credential dependencies; the net user blocklist → allowlist) ✅ shipped
52a Make -rotate-kek whole (re-wraps key custody; sealed recordings documented rather than broken) ✅ shipped
52b The two same-day regressions, and the store-contract gap that hid one ✅ shipped
52c Authorization-gate consistency (six gates that did not match their peers) ✅ shipped
52d Lifetimes, deadlines and fail-open defaults ✅ shipped
52e Audit-trail integrity, archiving, and two concurrency bugs ✅ shipped
52f The archive high-water mark, made robust — found by reviewing 52e ✅ shipped
52g Six more, found by reviewing all of the above — including a test that could not fail ✅ shipped
53 SQL Server (TDS) session proxy (JIT injection + per-statement audit) ✅ shipped
54 VNC connector (guacd-brokered, in-portal viewer, shared gates with RDP) ✅ shipped
55 Cross-replica live monitoring (cluster-wide session listing + SSE watch over an interest-gated store relay) ✅ shipped
56 Cross-replica step-up decisions (cluster-wide pending list, sealed at rest; the decision dispatched to the hosting replica) ✅ shipped
57 RFC 8693 token-exchange minting + remediation as Terraform (the broker issues delegated SVIDs; the CIEM cut renders as HCL) ✅ shipped
58 Safe-scoped policy (a safe carries require_approval + a dual-control floor, strictest-wins at all five gates) ✅ shipped
59 SFTP per-file content recording (sealed, hash-chained chunk-log artifacts; replayable; cap doubles as a size limit) ✅ shipped
59a Close the review of 59 (three capture bypasses, artifact-name containment, lsetstat, audit-field forgery, a reachable panic) ✅ shipped
60 The ticket gate holds at connect time (the change ticket is re-checked when access is used, at all five gates) ✅ shipped
61 A dependent account names the credential that manages it (propagation stops logging in as the account it rotates) ✅ shipped

Since 52g the work has been release and consolidation: v0.10.0 (the first signed, attested release) and v0.11.0 (which brings the pinned image back in step with the tree — 0.10.0 predated the ten fixes from the 2026-07-30 sweep), tests for the one package that had none (cmd/pam-server, the startup wiring), the broker audit keys moved into KEK-sealed shared custody, WinRM sessions joined the live monitor, the RDP clipboard became tightenable per target, watch streams now end with their session, and a max-effort review of that whole wave closed fifteen further findings. Releases are recorded in CHANGELOG.md; the honest remainder lives in ROADMAP.md → What is left.

Coverage vs. commercial PAM (CyberArk, Wallix, …)

pamv1 is an educational, beta project — not a drop-in replacement for CyberArk, Wallix Bastion, BeyondTrust, Delinea, Teleport or StrongDM. On the core session/credential loop it is already at parity — a JIT-injection proxy (SSH/WinRM/RDP), tamper-evident hash-chained recordings, rotation + reconciliation + checkout leases, M-of-N break-glass, RBAC + AD/Entra/OIDC + MFA, and a verifiable audit chain — and its AI-agent access broker (policy over the tool and its arguments, MCP transport, SPIFFE identity) is ahead of most incumbents.

The gaps below are about breadth and governance. Each notes how it fits pamv1's existing chokepoint architecture, and they map to candidate future phases.

Tier 1 — structural / connector gaps
Gap What the leaders do pamv1 today Fit
Safe / vault containers with delegated ownership ✅ shipped (Phase 17) CyberArk's whole authorization model is Safes — credential containers with their own members, workflows & delegated admin; Wallix uses target domains safes group targets with delegated can_manage members; a member reaches every target in the safe (EffectiveTargetGrants) done — per-safe approval workflows are a follow-on
Database session proxy with query-level audit ✅ shipped (Phases 15 + 53: PostgreSQL, SQL Server) Teleport, StrongDM, CyberArk & Wallix broker native Postgres/MySQL/MSSQL/Oracle with per-query audit + JIT injection PostgreSQL and SQL Server brokered (PAM_DB_ADDR, PAM_MSSQL_ADDR): JIT injection, db.query audit per statement, command control that sees through sp_executesql. MySQL/Oracle still to come done for Postgres + SQL Server (Phase 53); the same listener pattern generalizes to the remaining wire protocols
Live monitoring + command control ✅ shipped (Phase 16) CyberArk PSM & Wallix let a supervisor watch a live session, block a dangerous command mid-stream (rm -rf /, DROP TABLE) and terminate it interactively live SSE stream (GET /api/sessions/{id}/stream) + command control (regex denylist blocks exec/WinRM/SQL, command.blocked); interactive kill already existed. SFTP file-transfer control shipped (Phase 32): the proxy parses the SFTP subsystem to audit + optionally block file operations (PAM_SSH_SFTP) done — interactive-shell (PTY) filtering is the remaining follow-on (SFTP and the in-portal RDP viewer have since shipped)
Dependent-account propagation on rotation ✅ shipped (Phase 17) CyberArk CPM updates every consumer of a rotated service account (Windows Services, Scheduled Tasks, IIS App Pools, COM+) rotation now updates declared Windows Services / Scheduled Tasks / IIS App Pools over WinRM with the new secret done — COM+ and a per-consumer management credential are follow-ons
Tier 2 — access-governance depth
  • Access certification / attestation campaigns ✅ shipped (Phase 19) — a campaign snapshots current access (target grants + safe members); a reviewer certifies or revokes each item, and a revoke deletes the underlying grant (POST /api/campaigns). The SOX / ISO 27001 / NIS2 access-review control.
  • ITSM / ticketing gate ✅ shipped (Phase 20) — an access request can require a change/incident ticket, validated by a format regex and/or a webhook the ITSM answers 2xx for a valid ticket (PAM_REQUIRE_TICKET), then stamped into the audit trail.
  • Richer approval workflows ✅ shipped (Phase 21) — multi-tier N-of-M chains (PAM_APPROVALS_REQUIRED), scheduled access windows (not_before/not_after), and mandatory reason codes. (One-time single-use access shipped in Phase 26: a single-use approval is consumed by the first connection it admits, in every gate.)

All three Tier-2 access-governance gaps are now closed.

Tier 3 — where the market is moving
Gap Leaders pamv1 today
Zero Standing Privilege ✅ shipped (Phase 22) — ephemeral short-lived SSH certificates instead of a stored standing secret CyberArk ZSP, Teleport an ssh_ca credential stores no secret; the proxy mints a short-lived cert (PAM_SSH_CA_KEY) signed by the pamv1 CA per session — the account has no standing credential
Privileged threat analytics ✅ shipped (Phase 23) — behavioural risk scoring + automated response CyberArk PTA, Wallix internal/analytics scores the audit trail into explainable per-actor risk (GET /api/analytics/risk); a worker alerts on and can auto-kill a critical actor's sessions
Connector / plugin breadth — network devices (Cisco/Juniper/F5/Palo Alto), database accounts, cloud IAM, VMware/SAP/mainframe CyberArk's core moat SSH (incl. network devices) / WinRM / PostgreSQL / ssh_key rotation — needs real devices/DBs to extend honestly
Cloud CIEM (identity blast-radius) ✅ engine shipped (Phase 31) — effective-permission analysis + escalation-path detection CyberArk, Wallix, Sonrai/Wiz internal/blast is a real AWS IAM effective-permission evaluator + blast-radius traversal, toxic-combination findings and remediation-as-code over a normalized identity graph (POST /api/blast/analyze). The engine is complete and tested; only live cloud ingestion (boto3/Okta/GitHub) needs an account and stays external. (Short-lived cloud-credential brokering — the CIEM-lite mint path — remains the cloud-account-bound part)
Web / SaaS session proxying — record + inject into web admin consoles CyberArk Secure Web Sessions, Wallix SSH/WinRM/RDP only (the heaviest lift; needs a browser + SaaS console)

Three of the five Tier-3 gaps are closed (Zero Standing Privilege, threat analytics, and the cloud-CIEM blast-radius engine); connector breadth and web/SaaS proxying — plus live CIEM ingestion and short-lived cloud-credential brokering — each still require external infrastructure or an account to build and verify honestly, catalogued in docs/EXTERNAL-INFRA-GAPS.md.

Tier 4 — ecosystem
  • Application-secrets API for non-agent apps ✅ shipped (Phase 24) — a Conjur-style path (PAM_APP_SECRETS_ENABLED) where an application retrieves the specific secrets it was explicitly granted with a bearer key (GET /v1/app-secrets/{credential_id}); default-deny, granting needs reveal_secret, every retrieval audited.
  • Remaining (external-infra/account-bound): a Terraform provider for pamv1 objects (a separate module + the Terraform Registry) · Secrets Hub-style sync-out to AWS Secrets Manager / Azure Key Vault (a cloud account) · SSH-key fleet discovery at scale (a real host fleet) · thick-app connection components (auto-login into SSMS / Toad / vSphere via RDP RemoteApp — Windows RemoteApp hosts). See docs/EXTERNAL-INFRA-GAPS.md.
Deliberate non-goal

Endpoint Privilege Management — removing local admin rights and elevating sudo/apps via an endpoint agent (BeyondTrust / Delinea's core) — is a different product category that doesn't fit a vault + proxy chokepoint, and is out of scope by design.

Where it stands, and what's next

Every phase through 62 has shipped and the 2026-07 and 2026-08 security self-audits are closed (docs/SECURITY-GAPS.md). v0.10.0 — the first signed release — met the last of the four beta criteria on 2026-07-28, and v0.11.0 (2026-08-07) brings the pinned image back in step with the tree: 0.10.0 was tagged two days before the 2026-07-30 sweep's fixes landed, so for a week every manifest pinned a build that predated them.

What is left is consolidated in ROADMAP.md → What is left — in-process feature follow-ons: campaign / ticket-gate / config / analytics depth, a per-consumer management credential for dependent-account propagation, a console screen for the Phase 57 token exchange, and richer deploy examples. The larger items that sat there — cross-replica live monitoring (55) and step-up decisions (56), safe-scoped policy (58), and per-file SFTP content recording (59) — have each since shipped as their own phase. Anything needing external infrastructure or a paid account stays honestly catalogued in EXTERNAL-INFRA-GAPS.md rather than being faked.

All four Tier-1 gaps and all three Tier-2 gaps are closed (including one-time access, Phase 26), three of the five Tier-3 gaps (Zero Standing Privilege, privileged threat analytics, and the identity blast-radius / CIEM engine), and the first Tier-4 gap (the application-secrets API). The rest of Tier 3 (connector breadth, live cloud-CIEM ingestion, web proxying) and Tier 4 (Terraform provider, Secrets-Hub sync-out, SSH-key fleet discovery, thick-app components) are the next frontier — each gated on external infrastructure or accounts, catalogued in docs/EXTERNAL-INFRA-GAPS.md.

Quickstart

Run specs (ports, resource requests/limits, Docker/Kubernetes versions, PostgreSQL, storage, sizing) live in docs/REQUIREMENTS.md.

Virtual appliance (VirtualBox / VMware)

The whole thing as one importable VM — Debian 13, PostgreSQL, the binary and the full source tree. Built by deploy/ova/build.sh with QEMU and no root, VirtualBox or Packer required:

cd deploy/ova && ./build.sh          # ~15 min; → ~/.cache/pamv1-ova/*.ova
VBoxManage import ~/.cache/pamv1-ova/pamv1-appliance-13.6.0.ova
VBoxManage modifyvm pamv1-appliance --natpf1 "portal,tcp,127.0.0.1,8080,,8080"
VBoxManage startvm pamv1-appliance --type headless
# → http://127.0.0.1:8080 — the admin key is generated on first boot and
#   printed to the VM console (also /root/pamv1-credentials.txt)

No secret is baked into the image: the vault master key, admin key, database password and SSH host keys are all generated on first boot, so two imports of the same OVA never share a root of trust. See deploy/ova/README.md.

Local demo (no database)
go build ./cmd/pam-server
export PAM_MASTER_KEY=$(./pam-server -genkey)
export PAM_API_KEY=$(openssl rand -hex 24)
export PAM_DATABASE_URL=memory
./pam-server
# → portal at http://localhost:8080 (Sign On with your PAM_API_KEY)
#   SSH proxy on :2222
docker-compose (with hardened PostgreSQL)

The Docker/compose files live under deploy/docker/:

cd deploy/docker
cp .env.example .env      # fill PAM_MASTER_KEY, PAM_API_KEY, POSTGRES_PASSWORD
docker compose up --build
# → http://localhost:8080
Kubernetes

⚠️ One thing to know before you run this: deploy/k8s/postgres-cnpg.yaml declares a CloudNativePG Cluster, so kubectl apply -f deploy/k8s/ fails on an unknown kind unless the CloudNativePG operator is installed first. Install it, or apply the individual manifests you want and bring your own PostgreSQL. (The image the manifests pin, ghcr.io/morandeirachema/pamv1:0.11.0, is published and public.)

kubectl apply -f deploy/k8s/namespace.yaml
kubectl -n pamv1 create secret generic pam-secrets \
  --from-literal=PAM_MASTER_KEY=... \
  --from-literal=PAM_API_KEY=... \
  --from-literal=PAM_BREAK_GLASS_KEY_HASH=... \
  --from-literal=PAM_DATABASE_URL=postgres://...
kubectl apply -f deploy/k8s/

Or with Helm (readiness/metrics wired, configurable replicas, optional ServiceMonitor):

helm install pamv1 deploy/helm/pamv1 \
  --set secret.data.PAM_MASTER_KEY=... \
  --set secret.data.PAM_API_KEY=... \
  --set secret.data.PAM_DATABASE_URL=postgres://...
Terraform (IaC)
cd deploy/terraform
terraform init
terraform apply \
  -var master_key=... -var api_key=... -var database_url=postgres://...

Configuration

The essentials — the full set of PAM_* variables (KEK providers, AD/Entra/OIDC, WinRM/RDP, OT, rotation, alerting, the agent broker) is tabulated in docs/ARCHITECTURE-LOW-LEVEL.md. Identity/SSO/policy keys are additionally editable at runtime from the console (Phase 12); bootstrap and transport keys below stay environment-only.

Variable Required Description
PAM_MASTER_KEY yes Vault master key (32 bytes urlsafe-base64). Generate: pam-server -genkey
PAM_API_KEY yes Admin API key (header X-API-Key, portal Sign On)
PAM_DATABASE_URL yes postgres://… or memory (ephemeral demo)
PAM_BREAK_GLASS_KEY_HASH no Hex SHA-256 of the sealed emergency key; empty disables break-glass
PAM_LISTEN_ADDR no HTTP listen address, default :8080
PAM_SSH_ADDR no SSH proxy address, default :2222; off disables it
PAM_SSH_HOST_KEY no Path to persist the proxy host key (PEM); empty = ephemeral
PAM_SSH_KNOWN_HOSTS no Pin upstream target host keys (known_hosts file); empty = trust-any (logged)
PAM_RECORDING_DIR no Where session recordings are written, default recordings
PAM_REQUIRE_RECORDING no Refuse any session that cannot be recorded — the fail-closed knob; covers every path to a target
PAM_DB_ADDR no PostgreSQL session proxy listen address, default off
PAM_MSSQL_ADDR no SQL Server (TDS) session proxy listen address, default off
PAM_BROKER_POLICY_FILE no YAML agent-broker policy; set to enable the AI-agent broker
Utility flags

pam-server runs as a server by default; five flags make it do one job and exit.

Flag What it does
-genkey Print a fresh vault master key for PAM_MASTER_KEY
-hashkey Read an emergency key on stdin, print its SHA-256 for PAM_BREAK_GLASS_KEY_HASH
-split-key Read an emergency key on stdin, print N Shamir shares
-rotate-kek Re-encrypt every vaulted secret under a new KEK — credentials, MFA enrollments, secret settings and the shared SSH host/CA keys. Works across providers (local ⇄ Vault-Transit ⇄ KMS ⇄ HSM), so it is also how you migrate. Warns if sealed recordings still need the old key
-healthcheck Probe the local /healthz and exit 0 if healthy (what the container HEALTHCHECK uses)

Verifying a release

Once a release exists, every artifact is verifiable — and these are the commands to do it, because a signature nobody can check is decoration.

TAG=v0.11.0                       # the released version
IMAGE=ghcr.io/morandeirachema/pamv1

# 1. The image was built by this repository's release workflow, not by someone else.
cosign verify \
  --certificate-identity-regexp "^https://github.com/morandeirachema/pamv1/.github/workflows/release.yml@refs/tags/" \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com \
  "$IMAGE:${TAG#v}"

# 2. The SBOM attached to it is the one that build produced.
cosign verify-attestation --type spdxjson \
  --certificate-identity-regexp "^https://github.com/morandeirachema/pamv1/.github/workflows/release.yml@refs/tags/" \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com \
  "$IMAGE:${TAG#v}"

# 3. SLSA build provenance.
gh attestation verify "oci://$IMAGE:${TAG#v}" --repo morandeirachema/pamv1

And to confirm what you are actually running:

kubectl -n pamv1 exec deploy/pamv1 -- /pam-server -version   # → pam-server 0.11.0 (<full commit sha>)
curl -s http://pamv1:8080/metrics | grep pam_build_info      # same, for monitoring

Status: v0.11.0 was released on 2026-08-07 and is what every manifest here pins; the first release was v0.10.0 on 2026-07-28 (digest sha256:ab2a5fa5db27fae805f9096dfdf526497ddff4cc3774b33469ab108b98637b39). Each release publishes its cosign signature, SPDX SBOM attestation and SLSA provenance alongside the image in GHCR, and each tag's digest is on its release page — the commands above work against either.

Break-glass procedure

  1. Generate a strong emergency key and hash it — the plaintext is never configured or stored:
    openssl rand -base64 30                       # the emergency key
    echo -n "<that-key>" | ./pam-server -hashkey  # → PAM_BREAK_GLASS_KEY_HASH
    
  2. Seal the plaintext key in an envelope / physical safe (dual control recommended). Configure only the hash.
  3. In an emergency (normal auth path down): use the sealed key as X-API-Key. Access works immediately — and every request is audited as actor break-glass and logged loudly, blinking red in the portal's audit screen.
  4. After the incident: rotate the emergency key (new hash), rotate any revealed credentials, review the audit trail.

For higher assurance, split the emergency key into M-of-N Shamir shares (pam-server -split-key) held by separate custodians who POST their shares to /api/breakglass/unseal; the reconstructed session auto-expires and every unseal is alerted.

Security model & hardening

  • Secrets never leave as data. Ciphertext is decrypted only after every authorization gate passes, held transiently in memory for the upstream dial, and never serialized to a client or written to a log. Credential.SecretEnc is json:"-"; the deliberate reveal paths (human reveal endpoint, agent reveal_credential) are audited and shipped restricted.
  • Encrypted at the application layer, so a DB dump alone is useless without PAM_MASTER_KEY — defense in depth on top of Postgres hardening (scram-sha-256 auth, TLS, pgAudit).
  • Trust the chokepoint. Upstream SSH host keys can be pinned so the proxy won't inject a credential into a spoofed target; the agent broker fails closed (an unavailable audit chain refuses the call); graceful shutdown drains active sessions so recordings and audit events are flushed.
  • Tamper-evidence. Session recordings and the broker audit are hash-chained; the audit export carries a SHA-256 digest and the broker chain an ed25519-signed head checkpoint.
  • Hardened by construction — constant-time key comparison (crypto/subtle), body-size limits, per-agent rate limits, a strict CSP on the portal, a distroless non-root container, read-only root FS and dropped capabilities in K8s.
  • Found a vulnerability? Please open a private security advisory on GitHub rather than a public issue.

OT / industrial environments

pamv1 drops into IEC 62443-oriented architectures: the session proxy lives in the industrial DMZ (Purdue level 3.5) as the only IT→OT path, with air-gap-friendly operation, per-cell protocol allowlists, approval windows and recorded vendor access. Details in the OT Deployment Guide.

NIS2

For entities under Directive (EU) 2022/2555 (NIS2), pamv1 targets the Art. 21 risk-management measures — full mapping in the NIS2 Compliance Pack:

NIS2 Art. 21(2) pamv1
(i) access control & asset management Target inventory, RBAC + custom profiles + per-target grants, 4-eyes approval
(h) cryptography & encryption policies Envelope encryption (AES-256-GCM + pluggable KEK), TLS everywhere
(j) MFA & secured communications TOTP MFA + OIDC/Entra SSO, proxied recorded sessions
(b)(c) incident handling & business continuity Audit trail, break-glass quorum, backup runbook
Art. 23 reporting Tamper-evident audit export (GET /api/audit/export, JSON/CSV + SHA-256) for 24h/72h notifications

Development

go build ./...             # build everything
go test -race ./...        # unit + API + proxy tests (in-memory store) — what CI runs
go vet ./... && gofmt -l . # gofmt must print nothing

CI additionally runs staticcheck, govulncheck and gosec, a live-PostgreSQL store contract, a pkcs11-tagged build against SoftHSM2, a Docker image build, a check that the committed SOPS example really is encrypted, and a check that the code-derived architecture diagrams are current. The architecture low-level doc is the fullest map of the codebase — read it first.

Contributions are welcome — the ROADMAP is the best place to pick something up. Please keep PRs small and covered by tests.

License

Apache-2.0

Directories

Path Synopsis
cmd
archgen command
Command archgen regenerates docs/ARCHITECTURE-DIAGRAMS.md from the source, so the architecture diagrams cannot drift from the code.
Command archgen regenerates docs/ARCHITECTURE-DIAGRAMS.md from the source, so the architecture diagrams cannot drift from the code.
pam-server command
pam-server runs the pamv1 API and portal.
pam-server runs the pamv1 API and portal.
internal
agentid
Package agentid establishes and verifies AI-agent identity for the access broker.
Package agentid establishes and verifies AI-agent identity for the access broker.
alert
Package alert delivers real-time security alerts (e.g.
Package alert delivers real-time security alerts (e.g.
analytics
Package analytics is pamv1's privileged threat-analytics engine: a behavioral risk scorer over the audit trail (the CyberArk PTA / Wallix analytics gap).
Package analytics is pamv1's privileged threat-analytics engine: a behavioral risk scorer over the audit trail (the CyberArk PTA / Wallix analytics gap).
api
Package api exposes the PAM REST API and the embedded portal.
Package api exposes the PAM REST API and the embedded portal.
auditchain
Package auditchain implements the broker's tamper-evident, keyed-HMAC hash-chained audit log.
Package auditchain implements the broker's tamper-evident, keyed-HMAC hash-chained audit log.
auditfwd
Package auditfwd streams the primary audit trail to an external SIEM as it grows.
Package auditfwd streams the primary audit trail to an external SIEM as it grows.
auth
Package auth defines pamv1's identity and role-based access control.
Package auth defines pamv1's identity and role-based access control.
blast
Package blast is a read-only identity blast-radius / CIEM engine (Phase 31, pam-research Solution-04, https://github.com/morandeirachema/pam-research).
Package blast is a read-only identity blast-radius / CIEM engine (Phase 31, pam-research Solution-04, https://github.com/morandeirachema/pam-research).
broker
Package broker is the AI-agent access broker's decision loop, shared by the REST and MCP transports.
Package broker is the AI-agent access broker's decision loop, shared by the REST and MCP transports.
cmdguard
Package cmdguard implements command control: a policy-driven denylist that blocks a dangerous command before it reaches a target.
Package cmdguard implements command control: a policy-driven denylist that blocks a dangerous command before it reaches a target.
config
Package config loads server configuration from PAM_* environment variables.
Package config loads server configuration from PAM_* environment variables.
conjur
Package conjur is an optional runtime source for pamv1's OWN bootstrap secrets (Phase 18).
Package conjur is an optional runtime source for pamv1's OWN bootstrap secrets (Phase 18).
discovery
Package discovery finds candidate targets by probing hosts for the management ports pamv1 can broker (SSH, WinRM, RDP).
Package discovery finds candidate targets by probing hosts for the management ports pamv1 can broker (SSH, WinRM, RDP).
guacd
Package guacd speaks the Apache Guacamole protocol to a guacd daemon so pamv1 can broker RDP (and VNC/SSH) sessions to Windows targets.
Package guacd speaks the Apache Guacamole protocol to a guacd daemon so pamv1 can broker RDP (and VNC/SSH) sessions to Windows targets.
keycustody
Package keycustody gives pamv1's long-lived SSH keys — the proxy host key and the Zero Standing Privilege CA key — a single custodian shared by every replica.
Package keycustody gives pamv1's long-lived SSH keys — the proxy host key and the Zero Standing Privilege CA key — a single custodian shared by every replica.
logging
Package logging configures pamv1's structured operational logs.
Package logging configures pamv1's structured operational logs.
maint
Package maint holds offline maintenance operations for pamv1.
Package maint holds offline maintenance operations for pamv1.
mcp
Package mcp is a minimal, hand-rolled JSON-RPC 2.0 core for pamv1's Model Context Protocol endpoint.
Package mcp is a minimal, hand-rolled JSON-RPC 2.0 core for pamv1's Model Context Protocol endpoint.
metrics
Package metrics exposes a tiny, dependency-free Prometheus text-format collector for pamv1.
Package metrics exposes a tiny, dependency-free Prometheus text-format collector for pamv1.
mfa
Package mfa implements time-based one-time passwords (TOTP, RFC 6238) for multi-factor authentication.
Package mfa implements time-based one-time passwords (TOTP, RFC 6238) for multi-factor authentication.
ocsf
Package ocsf maps pamv1 audit events to the Open Cybersecurity Schema Framework (OCSF) so the trail can be forwarded to a SIEM in a vendor-neutral shape (Phase 27).
Package ocsf maps pamv1 audit events to the Open Cybersecurity Schema Framework (OCSF) so the trail can be forwarded to a SIEM in a vendor-neutral shape (Phase 27).
oidc
Package oidc implements the OpenID Connect Authorization Code flow with PKCE for browser-based login (e.g.
Package oidc implements the OpenID Connect Authorization Code flow with PKCE for browser-based login (e.g.
policy
Package policy is the agent-access-broker decision engine.
Package policy is the agent-access-broker decision engine.
proxy
Package proxy is the pamv1 SSH session gateway.
Package proxy is the pamv1 SSH session gateway.
ratelimit
Package ratelimit provides a small per-key fixed-window rate limiter shared by the API auth endpoints and the SSH/PostgreSQL proxies, so both throttle online guessing with identical, tested logic instead of two near-duplicate copies.
Package ratelimit provides a small per-key fixed-window rate limiter shared by the API auth endpoints and the SSH/PostgreSQL proxies, so both throttle online guessing with identical, tested logic instead of two near-duplicate copies.
recording
Package recording encrypts session recordings at rest.
Package recording encrypts session recordings at rest.
rotate
Package rotate implements the credential-lifecycle connectors: changing a privileged account's secret on the real target (rotation) and checking that a vaulted secret still authenticates (reconciliation).
Package rotate implements the credential-lifecycle connectors: changing a privileged account's secret on the real target (rotation) and checking that a vaulted secret still authenticates (reconciliation).
session
Package session tracks live brokered sessions so operators can see who is connected and terminate a session.
Package session tracks live brokered sessions so operators can see who is connected and terminate a session.
shamir
Package shamir implements Shamir's Secret Sharing over GF(2^8) — the scheme used for pamv1's M-of-N break-glass quorum: the emergency key is split into N shares, and any M of them reconstruct it (fewer reveal nothing).
Package shamir implements Shamir's Secret Sharing over GF(2^8) — the scheme used for pamv1's M-of-N break-glass quorum: the emergency key is split into N shares, and any M of them reconstruct it (fewer reveal nothing).
sshca
Package sshca implements a Zero Standing Privilege (ZSP) SSH certificate authority.
Package sshca implements a Zero Standing Privilege (ZSP) SSH certificate authority.
store
Package store defines the persistence contract for the PAM inventory, vaulted credentials and the audit trail.
Package store defines the persistence contract for the PAM inventory, vaulted credentials and the audit trail.
store/memstore
Package memstore is an in-memory store.Store used by tests and the "memory" demo mode.
Package memstore is an in-memory store.Store used by tests and the "memory" demo mode.
store/pgstore
Package pgstore implements store.Store on PostgreSQL via pgx.
Package pgstore implements store.Store on PostgreSQL via pgx.
store/storetest
Package storetest provides a reusable conformance suite for the store.Store contract.
Package storetest provides a reusable conformance suite for the store.Store contract.
tds
Package tds implements the slice of the Tabular Data Stream protocol — Microsoft SQL Server's wire protocol — that a session broker needs.
Package tds implements the slice of the Tabular Data Stream protocol — Microsoft SQL Server's wire protocol — that a session broker needs.
ticket
Package ticket validates an ITSM change/incident ticket reference before privileged access is granted (Phase 20) — the "no access without an approved change ticket" control.
Package ticket validates an ITSM change/incident ticket reference before privileged access is granted (Phase 20) — the "no access without an approved change ticket" control.
vault
Package vault implements hardened at-rest encryption for secrets using envelope encryption: each secret is sealed with a fresh random data key (AES-256-GCM, random nonce, AAD bound to the owning record), and that data key is wrapped by a Key Encryption Key (KEK).
Package vault implements hardened at-rest encryption for secrets using envelope encryption: each secret is sealed with a fresh random data key (AES-256-GCM, random nonce, AAD bound to the owning record), and that data key is wrapped by a Key Encryption Key (KEK).
vendor
Package vendor validates a third-party vendor's live employment attestation before a contract grant is approved (Phase 29) — the "refuse access if the technician has been offboarded by their own employer" control.
Package vendor validates a third-party vendor's live employment attestation before a contract grant is approved (Phase 29) — the "refuse access if the technician has been offboarded by their own employer" control.
web
Package web embeds the management portal (a single self-contained page).
Package web embeds the management portal (a single self-contained page).
winrm
Package winrm runs commands on Windows targets over WinRM (WS-Management), with the credential injected just-in-time by the caller.
Package winrm runs commands on Windows targets over WinRM (WS-Management), with the credential injected just-in-time by the caller.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL