Skip to main content

Compliance Evaluation

Proxima Console includes a compliance evaluation system that maps healthcheck evidence to structured compliance frameworks, producing per-control verdicts and aggregate compliance scores at the host, environment, and client level. It also supports manual attestations for controls that require human review and compliance exceptions for accepted risk waivers.

Overview

The compliance system sits on top of the healthcheck system and adds a structured compliance layer:

  • Frameworks define collections of compliance controls (e.g. Proxima Best Practices)
  • Controls are individual compliance requirements within a framework (e.g. "SSH access hardened")
  • Control mappings link controls to evidence sources (healthcheck rules)
  • Evaluations are per-control verdicts (pass/fail/unknown) computed from healthcheck results
  • Attestations are human-submitted verdicts for manual or hybrid controls
  • Exceptions are approved risk waivers that override a control's failure status
  • Rollups aggregate evaluations into framework-level scores at host, environment, and client scope

Architecture

Evaluation Flow

  1. Healthcheck run completes -- The healthcheck worker processes scanner results from the agent and stores them in the healthcheck_results table.
  2. Trigger message -- The healthcheck worker publishes a proxima.compliance.evaluate message on the COMPLIANCE NATS JetStream stream containing the host_id, run_id, environment_id, and client_id.
  3. Compliance worker consumes -- The ComplianceConsumerWorker picks up the message using a durable pull consumer (backend-compliance-worker).
  4. Ensure asset -- The worker ensures an asset record exists for the host (the asset layer is a generic identity abstraction for compliance scoping).
  5. Load frameworks -- All enabled frameworks are fetched from the database.
  6. Load evidence -- Healthcheck results for the run and the slug-to-ruleID mapping are loaded. If run_id is nil (e.g. from a manual re-evaluation trigger), the latest run for the host is used.
  7. Check exceptions -- Active exceptions for the host scope are loaded. Any control with an active exception is marked excepted regardless of evidence.
  8. Check attestations -- Active attestations for the host scope are loaded. Manual/hybrid controls with attestations use the attested status.
  9. Evaluate controls -- For each enabled framework, the worker loads controls and their mappings, then evaluates each control against the healthcheck evidence:
    • Excepted controls: status is set to excepted (exception overrides everything).
    • Attested controls: status is taken from the attestation (pass, fail, or warning).
    • Automated controls with mappings: each mapping's source_ref (a healthcheck rule slug) is checked against the results using the mapping's operator (e.g. status_is). If any mapping fails, the control fails.
    • Manual controls with no mappings and no attestation: status is set to pending_manual_review.
    • Automated controls with no mappings: status is set to unknown.
  10. Store evaluations -- Evaluations are upserted in bulk (keyed on control_id + scope_type + scope_id), so re-evaluation overwrites previous results.
  11. Metrics recorded -- The proxima_compliance_evaluations_total counter is incremented per evaluation, labeled by framework and status.

Concepts

Frameworks

A framework is a collection of compliance controls. Frameworks have a source_type of either builtin (shipped with Proxima) or custom (user-defined). Each framework has a slug, name, version, score_thresholds (for pass/warning/fail coloring), and can be enabled or disabled.

Controls

Controls are individual compliance requirements within a framework. Each control has:

FieldDescription
codeHuman-readable identifier (e.g. SEC-SSH-001)
titleShort description (e.g. "SSH access hardened")
categoryGrouping: security, patch_and_vuln, observability, networking, system, docker, backup
severitycritical, high, medium, or low
control_typeautomated (scanner evidence), manual (human attestation), or hybrid (both)
parent_control_idOptional parent for hierarchical controls
enabledCan be toggled on/off

Control Mappings

Mappings connect controls to evidence sources. Each mapping specifies:

  • source_type -- The kind of evidence (e.g. healthcheck_rule)
  • source_ref -- Reference to the evidence item (e.g. a healthcheck rule slug like ssh-root-login-disabled)
  • operator -- Evaluation logic (e.g. status_is)
  • expected_value -- The expected result (e.g. pass)
  • weight -- Relative weight for scoring (default 1.0)

A single control can have multiple mappings. All mappings must pass for the control to pass.

Evaluation Statuses

StatusMeaning
passAll mapped evidence meets expectations
failOne or more mappings failed
warningNon-critical deviation detected
unknownNo evidence found for any mapping
not_applicableControl does not apply to this asset
exceptedControl failure is accepted (risk exception)
pending_manual_reviewManual control awaiting human attestation

Scoring

Framework scores are computed as a ratio between 0 and 1:

score = passed / (passed + failed)

Controls with unknown, not_applicable, excepted, or pending_manual_review status are excluded from the score calculation. The frontend displays scores as percentages (e.g. a score of 0.85 is shown as 85%).

Each framework has configurable score_thresholds that determine the visual indicator:

ThresholdDefaultColor
good0.8Green
warning0.5Amber
Below warningRed

Manual Attestations

Manual attestations allow authorized users to provide human verdicts for manual or hybrid controls -- controls that cannot be fully evaluated through automated evidence (e.g. "Backup restore tested").

Each attestation records:

FieldDescription
control_idThe control being attested
scope_typeScope level: asset, environment, or client
scope_idThe specific host, environment, or client UUID
statusVerdict: pass, fail, or warning
attested_byUser ID of the attester
attested_atTimestamp of the attestation
expires_atOptional expiry date (attestation becomes stale after this)
noteFree-text justification or evidence description

Lifecycle:

  1. User creates an attestation via the API or UI for a specific control + scope
  2. On the next compliance evaluation, the attested status overrides pending_manual_review
  3. Creating, updating, or deleting an attestation automatically triggers re-evaluation
  4. If expires_at is set and passes, the attestation is no longer considered active

Compliance Exceptions

Exceptions are approved risk waivers that accept a control's failure. When an exception is active for a control, the evaluation status is overridden to excepted, and the control is excluded from the pass/fail score calculation.

Each exception records:

FieldDescription
control_idThe control being excepted
scope_typeScope level: asset, environment, or client
scope_idThe specific host, environment, or client UUID
reasonBusiness justification for accepting the risk
approved_byUser ID of the approver
approved_atTimestamp of approval
expires_atOptional expiry date
statusactive, expired, or revoked

Lifecycle:

  1. User creates an exception with a justification
  2. On the next compliance evaluation, the control status becomes excepted
  3. Creating, updating, or deleting an exception automatically triggers re-evaluation
  4. An exception expiry worker periodically checks for overdue exceptions and marks them expired
  5. Expired exceptions no longer override the control status -- the control reverts to its evidence-based verdict on the next evaluation

Re-evaluation Triggers

Compliance evaluations are triggered in three ways:

  1. Automatic -- When a healthcheck run completes, the healthcheck worker publishes a proxima.compliance.evaluate message. This is the primary trigger.
  2. Manual -- Users can trigger a re-evaluation via POST /api/v1/hosts/{hostID}/compliance/evaluate. This returns 202 Accepted and publishes the same NATS message with run_id set to nil (the worker uses the latest available run).
  3. Side-effect -- Creating, updating, or deleting an attestation or exception for an asset-scoped control automatically publishes a re-evaluation trigger for the affected host.

Proxima Best Practices Framework

The proxima-best-practices framework is a builtin framework shipped with Proxima Console. It contains 26 controls across 7 categories, covering practical infrastructure security and operational baselines.

Controls by Category

CategoryCountControls
Security8SSH hardened, firewall enabled, audit tooling, file permissions, authentication hardened, kernel hardened, certificates valid, security updates
Patch & Vulnerability2No critical CVEs, no high CVEs
Observability3Monitoring active, logging configured, time sync configured
Networking3Minimal open ports, DNS configured, Docker network isolated
System4Disk usage healthy, kernel up to date, tmp mount separated, swap configured
Docker3Security baseline (no root/privileged/host network), operational baseline (resource limits/healthchecks/logging), version current
Backup3Backup service running, recent backups exist, restore tested (manual)

Control Reference

CodeTitleSeverityTypeEvidence
SEC-SSH-001SSH access hardenedcriticalautomatedssh-root-login-disabled, ssh-max-auth-tries, ssh-password-auth-disabled
SEC-FW-001Firewall enabledhighautomatedfirewall-enabled
SEC-AUDIT-001Audit tooling installedhighautomatedauditd-running
SEC-PERMS-001Sensitive file permissionshighautomatedfilesystem-permissions, no-suid-dangerous
SEC-AUTH-001Authentication hardenedhighautomatedno-empty-passwords, fail2ban-running
SEC-SYSCTL-001Kernel hardenedmediumautomatedsysctl-hardened, core-dumps-disabled, ip-forwarding-disabled
SEC-CERT-001Certificates validhighautomatedcertificates-valid
SEC-UPDATE-001Security updates appliedcriticalautomatedupdates-available
VULN-CRIT-001No critical CVEscriticalautomatedtrivy-no-critical-cves
VULN-HIGH-001No high CVEshighautomatedtrivy-no-high-cves
OBS-MON-001Monitoring activehighautomatedmonitoring-agent-running
OBS-LOG-001Logging configuredmediumautomatedlog-rotation-configured
OBS-NTP-001Time sync configuredmediumautomatedntp-synchronized
NET-PORTS-001Minimal open portsmediumautomatedopen-ports-minimal
NET-DNS-001DNS configuredmediumautomateddns-configured
NET-DOCKER-001Docker network isolatedmediumautomateddocker-network-isolated
SYS-DISK-001Disk usage healthyhighautomateddisk-usage-healthy
SYS-KERNEL-001Kernel up to datemediumautomatedkernel-up-to-date
SYS-TMP-001Tmp mount separatedlowautomatedtmp-mount-separate
SYS-SWAP-001Swap configuredlowautomatedswap-enabled
DOC-SEC-001Docker security baselinehighautomateddocker-no-root-containers, docker-no-privileged, docker-no-host-network
DOC-OPS-001Docker operational baselinemediumautomateddocker-resource-limits, docker-healthchecks, docker-logging-configured
DOC-VER-001Docker version currentmediumautomateddocker-version-current
BKP-SVC-001Backup service runninghighautomatedbackup-service-running
BKP-RECENT-001Recent backups existcriticalautomateddb-backup-recent
BKP-RESTORE-001Restore testedcriticalmanual(manual attestation)

Frontend UI

Compliance data is displayed at three levels in the Proxima Console frontend:

Host Compliance Tab

Each host detail page includes a Compliance tab that shows:

  • Framework score cards -- One card per framework showing the compliance percentage, pass/fail/unknown counts, and a color-coded indicator based on score_thresholds
  • Controls table -- A sortable, filterable table of all control evaluations for the host, with columns for status, control code, title, category, and severity
  • Expandable rows -- Clicking a control row expands it to show the evaluation reason, evidence summary (key-value pairs from healthcheck results), and any active attestation or exception details
  • Status and category filters -- Dropdown filters above the table to narrow by evaluation status or control category
  • Inline badges -- Controls with active attestations show an "Attested" badge; controls with active exceptions show an "Excepted" badge
  • Row actions -- Each row has a dropdown menu to add/edit attestations or add/revoke exceptions

Environment Compliance Tab

Each environment detail page includes a Compliance tab that shows:

  • Framework score cards -- Aggregated scores across all active hosts in the environment
  • Host comparison table -- Side-by-side compliance scores per host, sortable by score
  • Top failed controls -- A ranked list of controls failing across the most hosts, with fail counts and severity

Client Compliance Tab

Each client detail page includes a Compliance tab that shows:

  • Framework score cards -- Aggregated scores across all active hosts across all environments
  • Top failed controls -- Client-wide view of most common compliance failures
  • Expiring exceptions -- Exceptions expiring within 30 days, with control and host context

Management

The Compliance Settings admin page (/admin/compliance) provides full CRUD management for frameworks, controls, and control mappings. Access requires the compliance:read permission; mutations require compliance:write or compliance:delete.

Admin Page Layout

The page uses a two-panel master-detail layout:

  • Left panel -- Framework list with source type badges (builtin / custom), enabled toggles, and action menus
  • Right panel -- Controls table for the selected framework, with expandable rows showing remediation text and mappings

Frameworks

Frameworks can be custom (user-created) or builtin (shipped with Proxima).

ActionCustomBuiltin
CreateYes--
Edit (name, description, thresholds, enabled)YesYes
DeleteYesNo (403 Forbidden)
Reset to defaults--Yes

Reset to defaults restores a builtin framework's controls to their original seeded state and removes any user-added controls.

Controls

Each control belongs to a framework and defines a compliance requirement.

FieldDescription
codeUnique identifier within the framework (e.g., SEC-1)
titleHuman-readable name
categoryGrouping: security, patch_and_vuln, observability, networking, system, docker, backup
severityImpact level: critical, high, medium, low
control_typeHow evaluated: automated, manual, hybrid
remediationMarkdown guidance for fixing failures (rendered in evaluation detail rows)

Control Mappings

Mappings link a control to evidence sources. All mappings must pass for the control to pass.

FieldDescription
source_typeEvidence source (e.g., healthcheck)
source_refSpecific check reference (e.g., lynis-ssh-1)
operatorComparison operator (e.g., status_is, gte)
expected_valueValue to match against
weightRelative importance (default 1.0)

Permissions

PermissionGrants
compliance:readView frameworks, controls, mappings, and the admin page
compliance:writeCreate and edit frameworks, controls, and mappings
compliance:deleteDelete custom frameworks, controls, and mappings

API Endpoints

Frameworks

MethodPathDescription
GET/api/v1/frameworksList all compliance frameworks
GET/api/v1/frameworks/{id}Get a single framework by ID
POST/api/v1/frameworksCreate custom framework
PUT/api/v1/frameworks/{id}Update framework
DELETE/api/v1/frameworks/{id}Delete custom framework
POST/api/v1/frameworks/{id}/resetReset builtin framework to defaults

Controls

MethodPathDescription
GET/api/v1/frameworks/{id}/controlsList controls for a framework (paginated, filterable by category, severity, control_type)
GET/api/v1/controls/{id}Get a single control with remediation
POST/api/v1/frameworks/{id}/controlsCreate control in a framework
PUT/api/v1/controls/{id}Update control
DELETE/api/v1/controls/{id}Delete control

Control Mappings

MethodPathDescription
GET/api/v1/controls/{id}/mappingsList mappings for a control
POST/api/v1/controls/{id}/mappingsCreate mapping for a control
GET/api/v1/mappings/{id}Get a single mapping
PUT/api/v1/mappings/{id}Update mapping
DELETE/api/v1/mappings/{id}Delete mapping

Host Compliance

MethodPathDescription
GET/api/v1/hosts/{hostID}/complianceGet compliance posture for a host (per-framework scores)
GET/api/v1/hosts/{hostID}/compliance/evaluationsList compliance evaluations for a host (paginated, filterable by status, framework_id)
POST/api/v1/hosts/{hostID}/compliance/evaluateTrigger compliance re-evaluation for a host (returns 202 Accepted)

Rollups and Insights

MethodPathDescription
GET/api/v1/environments/{envID}/complianceGet compliance rollup for an environment
GET/api/v1/environments/{envID}/compliance/top-failuresTop failing controls in an environment (query: limit, default 10, max 50)
GET/api/v1/clients/{id}/complianceGet compliance rollup for a client
GET/api/v1/clients/{id}/compliance/top-failuresTop failing controls across a client (query: limit, default 10, max 50)
GET/api/v1/clients/{id}/compliance/expiring-exceptionsExceptions expiring within N days (query: days, default 30, max 365)

Attestations

MethodPathDescription
POST/api/v1/attestationsCreate a manual attestation (body: control_id, scope_type, scope_id, status, note, expires_at)
GET/api/v1/attestations?scope_type=&scope_id=List attestations for a scope (filterable by control_id)
PUT/api/v1/attestations/{id}Update an attestation (body: status, note, expires_at)
DELETE/api/v1/attestations/{id}Delete an attestation

Exceptions

MethodPathDescription
POST/api/v1/exceptionsCreate a compliance exception (body: control_id, scope_type, scope_id, reason, expires_at)
GET/api/v1/exceptions?scope_type=&scope_id=List exceptions for a scope (filterable by control_id, status)
PUT/api/v1/exceptions/{id}Update an exception (body: reason, expires_at, status)
DELETE/api/v1/exceptions/{id}Delete an exception

Database Schema

The compliance system adds eight tables:

TablePurpose
assetsGeneric asset identity layer for compliance scoping
frameworksCompliance frameworks (builtin and custom) with score_thresholds
controlsIndividual controls within a framework
control_mappingsMaps controls to evidence sources with evaluation logic
control_evaluationsPer-control verdicts at asset/environment/client scope
control_evidence_linksLinks evaluations to the evidence that produced them
manual_attestationsHuman-submitted verdicts for manual/hybrid controls
exceptionsApproved risk waivers with optional expiry

Key Files

FileDescription
backend/internal/api/compliance_handler.goREST API handler for compliance scores, evaluations, rollups, and re-evaluation trigger
backend/internal/api/compliance_framework_handler.goCRUD handler for compliance framework management
backend/internal/api/compliance_control_handler.goCRUD handler for control and mapping management
backend/internal/api/attestation_handler.goCRUD handler for manual attestations
backend/internal/api/exception_handler.goCRUD handler for compliance exceptions
backend/internal/api/compliance_trigger.goShared helper for publishing compliance re-evaluation messages
backend/internal/worker/compliance.goCompliance evaluation logic (pure + I/O) including attestation/exception integration
backend/internal/worker/compliance_consumer.goNATS JetStream consumer for compliance triggers
backend/internal/worker/exception_expiry.goTicker-based worker that expires overdue exceptions
backend/internal/store/compliance_store.goDatabase operations for frameworks, controls, evaluations, scores
backend/internal/store/attestation_store.goDatabase operations for manual attestations
backend/internal/store/exception_store.goDatabase operations for compliance exceptions
backend/internal/domain/compliance.goDomain types: Framework, Control, ControlMapping, ControlEvaluation, ManualAttestation, Exception
backend/migrations/000029_compliance_foundation.up.sqlSchema + seed data (Proxima Best Practices framework)
backend/migrations/000033_attestations_exceptions.up.sqlSchema for attestations and exceptions
frontend/src/components/compliance/React components: ControlsTable, FrameworkScoreCard, ControlStatusBadge, EvidenceDetail, CompliancePostureSection, etc.