Cratis Chronicle security for non-personal secrets
Cratis Chronicle uses [Encrypted] to protect non-personal operational secrets at rest while keeping them outside the personal-data erasure workflow. Use it for values such as a partner credential or webhook signing secret when they are not personal data.
For personally identifiable information (PII), use [PII] instead. That marker encrypts the value and includes it in Chronicle’s erasure mechanism for the General Data Protection Regulation (GDPR). Chronicle uses a subject identity to select the key for a person’s data. Encryption and erasure solve different problems: a secret needs confidentiality, while personal data may also need to become unreadable when that key is erased.
Without [Encrypted]
Section titled “Without [Encrypted]”Storing an unprotected secret leaves its value readable in the event log. Using [PII] encrypts it, but also ties its lifetime to personal-data erasure. If the secret and a person’s email address are both marked [PII] under the same subject, they share the subject’s key. Erasing that key makes both unreadable, even though the request concerned the person’s data.
With [Encrypted]
Section titled “With [Encrypted]”Mark the non-personal secret [Encrypted] to give it a separate encryption key. Chronicle keeps that key separate even when the secret and a [PII] value belong to the same subject. PII erasure leaves the secret’s key untouched, so the secret can still be decrypted.
The example marks the API key’s concept type, a dedicated type for that value, so events using it carry the encryption marker:
[Encrypted]public record SecurityOverviewPartnerApiKey(string Value) : ConceptAs<string>(Value);
public record SecurityOverviewPartnerIntegrationConfigured(SecurityOverviewPartnerApiKey ApiKey);import io.cratis.fundamentals.concepts.ConceptAsimport io.cratis.chronicle.confidentiality.Encrypted
@Encrypteddata class SecurityOverviewPartnerApiKey(val value: String) : ConceptAs<String> { override fun value(): String = value}
data class SecurityOverviewPartnerIntegrationConfigured(val apiKey: SecurityOverviewPartnerApiKey)import io.cratis.fundamentals.concepts.ConceptAs;import io.cratis.chronicle.confidentiality.Encrypted;
@Encryptedrecord SecurityOverviewPartnerApiKey(String value) implements ConceptAs<String> {}
record SecurityOverviewPartnerIntegrationConfigured(SecurityOverviewPartnerApiKey apiKey) {}defmodule MyApp.Security.SecurityOverviewPartnerApiKey do use Chronicle.Concept, type: :string encrypted()end
defmodule MyApp.Events.SecurityOverviewPartnerIntegrationConfigured do use Chronicle.Events.EventType, id: "security-overview-partner-integration-configured"
defstruct api_key: %MyApp.Security.SecurityOverviewPartnerApiKey{}endimport { encrypted, eventType } from '@cratis/chronicle';import { ConceptAs } from '@cratis/fundamentals';
@encrypted()class SecurityOverviewPartnerApiKey extends ConceptAs<string> { static readonly valueType = String;
constructor(value: string) { super(value); }}
@eventType()class SecurityOverviewPartnerIntegrationConfigured { apiKey: SecurityOverviewPartnerApiKey = new SecurityOverviewPartnerApiKey('');}Choosing between [PII] and [Encrypted]
Section titled “Choosing between [PII] and [Encrypted]”[PII] |
[Encrypted] |
|
|---|---|---|
| Protects | Personal data about a natural person | A non-personal operational secret |
| PII erasure | Deletes the subject’s key | Does not delete the secret’s key; no equivalent erasure operation is exposed |
| Key identity | The compliance subject (or event source id when none is set) | Separate from PII, even for the same subject |
| .NET namespace | Cratis.Chronicle.Compliance.GDPR |
Cratis.Chronicle.ProtectedValues |
Choose one marker per value. Combining them is invalid; .NET reports CHR0053 for directly visible combinations. Follow Encrypting operational secrets to mark a type or property and choose its key scope.
Trust model
Section titled “Trust model”Chronicle trusts every authenticated application with every event store on the same kernel, except the System store, which is reserved. Namespaces separate data, but Chronicle does not check whether a caller may use a given namespace or event store. Your application is responsible for that today.
This matters for:
- A shared kernel that serves applications that do not trust each other.
- Workbench users who have access to a shared kernel.
- Multi-tenant setups where tenants hold their own credentials.
It does not matter when every application that can authenticate to the kernel belongs to the same trust boundary.
On such a kernel, any authenticated application can:
- Append events to any non-System event store.
- Read events from any non-System event store, including releasing protected and encrypted values through compliance.
- Register deployments.
- Create namespaces.
- Set up subscriptions across event stores.
Mitigations available today
Section titled “Mitigations available today”- Run a separate kernel per trust boundary. Applications that must not see each other’s data should not share a kernel.
- Isolate the network. Use network rules and mutual TLS so that only trusted applications can reach the kernel. See Production hosting and TLS. The kernel certificate needs both server and client authentication usages for traffic between nodes; see certificate requirements.
- Enforce the administrator policy for operations. Set
enforceAdministratorPolicyForOperationstotruein theauthenticationconfiguration so that only administrators can run operations on the System store. This protects the System store; it does not restrict access to other event stores. During a rolling deploy, follow Rolling deploy before switching it on. See Authentication.
Per-application event store entitlement is planned.
For how tenants map to namespaces, see Tenancy.
Related topics
Section titled “Related topics”| Topic | Description |
|---|---|
| Encrypting operational secrets | Apply the encryption marker and choose which values share a key |
| Releasing PII and encrypted values | Understand automatic decryption and release values outside that read path |
| Compliance | Handle personal data with [PII] and understand the scope of erasure |