CRD Reference
Reference for the ZenLock custom resource, plus a note on the two resources zen-lock manages internally.
Overview
zen-lock manages three CRDs:
| CRD | Kind | Purpose |
|---|---|---|
zenlocks.security.zen-mesh.io | ZenLock | Encrypted secret storage |
zenlockcustodies.security.zen-mesh.io | ZenLockCustody | Signing key custody (Zen Trust) |
noncebuckets.security.zen-mesh.io | NonceBucket | Replay attack prevention |
API Version: security.zen-mesh.io/v1beta1
Short names: zenlock, zl
ZenLock
The primary CRD for storing encrypted secrets. Contains only ciphertext — the API server and etcd never see plaintext.
Schema
apiVersion: security.zen-mesh.io/v1beta1
kind: ZenLock
metadata:
name: <string> # Required; unique in namespace
namespace: <string> # Required
labels: <map>
annotations: <map>
spec:
algorithm: age # Required; currently only "age" supported
encryptedData: # Required; map of key -> base64 ciphertext
<key>: <value>
allowedSubjects: # Optional; ServiceAccounts allowed to receive this secret
- kind: ServiceAccount # Required; only ServiceAccount in v1beta1
name: <string> # Required
namespace: <string> # Optional; defaults to ZenLock namespace
status:
phase: Ready|Error # Current state
lastRotation: <time> # Last key rotation timestamp
conditions: # Detailed conditions
- type: <string>
status: True|False|Unknown
reason: <string>
message: <string>
lastTransitionTime: <time>
rotation: # Key rotation state
phase: idle|rotating|deprecated
activeKeyId: <string>
previousKeyId: <string>
rotatedAt: <time>
deprecatedAt: <time>
graceHits: <integer>
reencrypted: <integer>
pending: <integer>
safeToDeprecate: <boolean>
Fields Reference
spec
| Field | Type | Required | Description |
|---|---|---|---|
spec.algorithm | string | Yes | Encryption algorithm. Currently only age is supported. |
spec.encryptedData | map[string]string | Yes | Map of secret keys to base64-encoded age ciphertext. |
spec.allowedSubjects | []SubjectReference | No | List of ServiceAccounts authorized to receive this secret. Empty = deny all. |
spec.allowedSubjects[]
| Field | Type | Required | Description |
|---|---|---|---|
kind | string | Yes | Must be ServiceAccount. |
name | string | Yes | Name of the ServiceAccount. |
namespace | string | No | Namespace of the ServiceAccount. Defaults to the ZenLock's namespace. |
status
| Field | Type | Description |
|---|---|---|
status.phase | string | Ready or Error. |
status.lastRotation | time | Last key rotation timestamp. |
status.conditions[] | []ZenLockCondition | Detailed state conditions. |
status.rotation | RotationStatus | Current rotation state (see Key Rotation). |
Example
apiVersion: security.zen-mesh.io/v1beta1
kind: ZenLock
metadata:
name: db-credentials
namespace: production
spec:
algorithm: age
encryptedData:
username: YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXoxMjM=
password: cGFzc3dvcmQxMjM0NTY3ODkwYWJjZGVmZ2g=
allowedSubjects:
- kind: ServiceAccount
name: my-app
namespace: production
status:
phase: Ready
Short Names
kubectl get zenlock <name>
kubectl get zl <name>
Internal Resources
ZenLockCustody and NonceBucket are created and managed by zen-lock itself — for signing-key custody and for replay protection. They are listed here so that operators recognize them in a cluster. They are not part of the public interface: do not create, edit or delete them by hand, and do not build on their fields.
Short Names
# Get all ZenLocks
kubectl get zenlocks
kubectl get zl
API Discovery
# List all zen-lock CRDs
kubectl get crd | grep security.zen-mesh.io
# Describe a CRD
kubectl describe crd zenlocks.security.zen-mesh.io