Kest LogoKest
Get Started
Concepts/DESIGN

KestEntry: The Non-Fungible Audit Schema

design
Ref: KST-audit_entry

Every KestEntry is a self-contained, cryptographically signed audit record. Unlike traditional log lines — which are mutable text that can be silently altered — Kest entries are non-fungible: tamper-evident, non-repudiable, and permanently linked to their predecessors.

This article walks through the KestEntry schema field by field, explaining why each field exists and what compliance guarantee it provides.

The KestEntry Schema (Spec §4.1)

json
{
  "schema_version": "0.3.0",
  "runtime": {
    "name": "kest-python",
    "version": "0.3.0"
  },
  "entry_id":       "019746a2-3c4f-7da1-8b5f-2a1c3d4e5f67",
  "operation":      "process_payment",
  "classification": "system",
  "trust_score":    40,
  "parent_ids":     ["a1b2c3d4e5f6..."],
  "added_taints":   ["user_input"],
  "removed_taints": [],
  "taints":         ["user_input"],
  "labels": {
    "principal":          "spiffe://kest.internal/workload/payment-svc",
    "kest.identity":      "{\"user\":\"alice\",\"agent\":\"web-app\",\"task\":\"checkout\"}",
    "kest.resource_attr": "{\"amount\":150,\"currency\":\"USD\"}",
    "trace_id":           "4bf92f3577b34da6a3ce929d0e0e4736"
  },
  "policy_context": {
    "enterprise_policies": ["baseline-auth"],
    "platform_policies":   ["payments-pci"],
    "app_policies":        [],
    "function_policies":   ["kest/allow_trusted"],
    "deviations": []
  },
  "environment":  {},
  "otel_context":  {},
  "metadata":      null,
  "content_hash":  "e3b0c44298fc1c14...",
  "input_hash":    "7f83b1657ff1fc53...",
  "timestamp_ms":  1712150400000
}

Field-by-Field Reference

Versioning & Runtime

FieldPurposeCompliance Value
schema_versionSchema version of this entry format (F-AE-05)Enables forward-compatible parsing by audit tools as the spec evolves
runtime.nameWhich Kest library produced this entry (F-AE-06)Cross-language diagnostics — identifies if an interop bug is language-specific
runtime.versionSemantic version of the libraryMatches entries to known library releases for vulnerability tracing

Identity & Ordering

FieldPurposeCompliance Value
entry_idUUID v7 — time-ordered, globally unique (F-AE-04)Natural chronological ordering without secondary sorting. RFC 9562 guarantees uniqueness
operationName of the protected function (F-AE-07)Maps audit entries to specific business operations for access reviews
timestamp_msEpoch milliseconds at entry creation (F-AE-12)Approximate forensic timing. Not used for ordering — cryptographic hash chain supersedes (Spec §11.5)

Cryptographic Linkage

FieldPurposeCompliance Value
parent_idsSHA-256 hash of the preceding JWS string, or ["0"] for root (F-AE-08)Creates the Merkle chain — tamper-evident ordering
content_hashSHA-256 of the function's return valueProves what the function produced
input_hashSHA-256 of the function's input argumentsProves what the function received

Trust & Taints

FieldPurposeCompliance Value
trust_scoreInteger 0–100 (F-AE-09)Quantified risk level — feeds into CARTA-based policy decisions
added_taintsNew taint labels at this node (F-TT-02)Traces where risk was introduced
removed_taintsTaints cleared at this node (F-TT-03)Auditable sanitization — proves a node declared itself as a sanitizer
taintsCumulative taint set: (parent ∪ added) − removed (F-AE-10)Full risk profile visible to policy engines and auditors

Labels

FieldPurposeCompliance Value
labels.principalThe workload_id from the IdentityProvider (F-AE-11)Who signed this entry — non-repudiable identity
labels.trace_idOTel trace ID (F-AE-11)Correlates audit entries with distributed traces
labels.kest.identityJSON: {user, agent, task} (F-IC-04)Fine-grained identity context for ABAC policies
labels.kest.resource_attrJSON: resource attributes (F-IC-04)ABAC resource attributes (e.g., document ID, sensitivity level)

Policy Context

FieldPurposeCompliance Value
policy_context.enterprise_policiesEnterprise baseline policies evaluated (F-AE-13)Proves enterprise-level compliance was enforced
policy_context.platform_policiesPlatform-scoped policies evaluatedProves platform governance was applied
policy_context.function_policiesFunction-level policies evaluatedProves the specific access control was checked
policy_context.deviationsActive policy deviations at this invocation (F-PE-12)Cryptographic proof of any compliance exemptions

The deviations array is always present — an empty array [] means "no deviations were active." If the field is absent entirely, it indicates potential tampering (the signed payload is incomplete).

Why Non-Fungible?

Traditional logs:

plaintext
2024-03-15 10:23:45 INFO payment processed for user alice amount=150

This log line can be:

  • ✗ Modified after the fact (change "alice" to "bob")
  • ✗ Deleted silently
  • ✗ Fabricated by a compromised service
  • ✗ Reordered to hide a sequence of events

A KestEntry cannot be any of these things because:

  • ✓ It is signed by the workload's private key (JWS/EdDSA)
  • ✓ It is hash-linked to its predecessor (SHA-256 parent_ids)
  • ✓ Its payload is canonicalized (RFC 8785) for deterministic verification
  • ✓ Modification of any entry breaks every subsequent hash in the chain

Compliance Mappings

StandardKestEntry Mechanism
NIST SP 800-207 Tenet 6Policy evaluated before execution; decision recorded in policy_context
SOC 2 CC7.2Tamper-evident audit trail via Merkle-linked JWS
PCI-DSS v4.0 Req. 10Cryptographically signed, non-fungible access logs
GDPR Art. 30kest.identity and kest.resource_attr provide processing activity records

For how entries are chained into a Passport, see Lineage Over Assertion. For the full schema constraints, see Spec §4.1.