Operate

Evidence archive

Set up the Object Lock archive, key bucket, master keys, timestamp authority and storage prices for a self-hosted installation.

The evidence archive seals each organisation’s events into hourly, encrypted segments in write-once storage, with Merkle proofs and optional RFC 3161 timestamps. What it records and how to verify it is described in Audit. This page covers the storage and keys a self-hosted installation has to provide.

The archive is optional. Without it, events live only in PostgreSQL for the hot retention window. Once it is configured, every organisation gets a default archive policy: GOVERNANCE-mode Object Lock for 2,555 days (seven years) with encrypted content, pinned to the archive region. Owners can raise retention or switch to COMPLIANCE mode.

Treat enabling the archive as permanent. Once an organisation has a retention policy or sealed segments, removing the archive configuration makes that organisation’s requests fail with 503 evidence reconciliation or storage recovery required.

What you need

ItemVariablePurpose
Archive bucketEVIDENCE_ARCHIVE_BUCKETVersioned bucket with Object Lock. Holds sealed segments.
Key bucketEVIDENCE_KEYS_BUCKETBucket that has never been versioned. Holds wrapped per-subject keys.
RegionEVIDENCE_ARCHIVE_REGIONRegion both buckets are in. Defaults to AWS_REGION.
Key vault master keyEVIDENCE_KEY_VAULT_MASTER_KEYWraps subject keys. Generated in the state directory if unset.
Pack signing seedEVIDENCE_PACK_MASTER_KEYSigns evidence packs. Generated in the state directory if unset.
Timestamp authority (optional)EVIDENCE_TSA_URL, EVIDENCE_TSA_ROOTS_PEMIndependent RFC 3161 timestamps for daily anchors.
Governance role (optional)EVIDENCE_GOVERNANCE_ROLE_ARNSeparate role for owner-approved shortening of GOVERNANCE retention.
Storage prices (optional)EVIDENCE_STORAGE_PRICES_JSONCost estimates on the storage card.

These are separate from the payload bucket (INGEST_ARCHIVE_BUCKET). Never point the archive at the payload bucket, and never use one bucket for both archive and keys; the service refuses to start if the two evidence buckets are the same.

Set up the buckets

Create the archive bucket with Object Lock

Object Lock can only be turned on when a bucket is created. Create the bucket in the region you want records pinned to, with versioning and a default GOVERNANCE retention:

REGION=eu-central-1
ARCHIVE=<archive-bucket>

aws s3api create-bucket --bucket "$ARCHIVE" --region "$REGION" \
  --create-bucket-configuration LocationConstraint="$REGION" \
  --object-lock-enabled-for-bucket
aws s3api put-bucket-versioning --bucket "$ARCHIVE" \
  --versioning-configuration Status=Enabled
aws s3api put-object-lock-configuration --bucket "$ARCHIVE" \
  --object-lock-configuration '{"ObjectLockEnabled":"Enabled","Rule":{"DefaultRetention":{"Mode":"GOVERNANCE","Days":30}}}'
aws s3api put-public-access-block --bucket "$ARCHIVE" \
  --public-access-block-configuration BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=true

For us-east-1, leave out --create-bucket-configuration. Add a bucket policy that denies requests without TLS (aws:SecureTransport false).

Add the lifecycle rules

axonpush never deletes archive objects. Every object it writes carries an axonpush-retention-days tag of 30, 180, 365 or 2555, and the bucket’s lifecycle rules remove versions after their lock ends. Larger objects in the longer tiers move to cheaper storage classes.

lifecycle.json
{
  "Rules": [
    { "ID": "IncompleteAndExpiredMarkers", "Status": "Enabled", "Filter": { "Prefix": "" },
      "AbortIncompleteMultipartUpload": { "DaysAfterInitiation": 1 },
      "Expiration": { "ExpiredObjectDeleteMarker": true } },
    { "ID": "ExpireTier30", "Status": "Enabled",
      "Filter": { "Tag": { "Key": "axonpush-retention-days", "Value": "30" } },
      "Expiration": { "Days": 31 }, "NoncurrentVersionExpiration": { "NoncurrentDays": 1 } },
    { "ID": "ExpireTier180", "Status": "Enabled",
      "Filter": { "Tag": { "Key": "axonpush-retention-days", "Value": "180" } },
      "Expiration": { "Days": 181 }, "NoncurrentVersionExpiration": { "NoncurrentDays": 1 } },
    { "ID": "TransitionTier180", "Status": "Enabled",
      "Filter": { "And": { "Tags": [{ "Key": "axonpush-retention-days", "Value": "180" }], "ObjectSizeGreaterThan": 131072 } },
      "Transitions": [{ "Days": 30, "StorageClass": "STANDARD_IA" }, { "Days": 90, "StorageClass": "GLACIER_IR" }] },
    { "ID": "ExpireTier365", "Status": "Enabled",
      "Filter": { "Tag": { "Key": "axonpush-retention-days", "Value": "365" } },
      "Expiration": { "Days": 366 }, "NoncurrentVersionExpiration": { "NoncurrentDays": 1 } },
    { "ID": "TransitionTier365", "Status": "Enabled",
      "Filter": { "And": { "Tags": [{ "Key": "axonpush-retention-days", "Value": "365" }], "ObjectSizeGreaterThan": 131072 } },
      "Transitions": [{ "Days": 30, "StorageClass": "STANDARD_IA" }, { "Days": 90, "StorageClass": "GLACIER_IR" }] },
    { "ID": "ExpireTier2555", "Status": "Enabled",
      "Filter": { "Tag": { "Key": "axonpush-retention-days", "Value": "2555" } },
      "Expiration": { "Days": 2556 }, "NoncurrentVersionExpiration": { "NoncurrentDays": 1 } },
    { "ID": "TransitionTier2555", "Status": "Enabled",
      "Filter": { "And": { "Tags": [{ "Key": "axonpush-retention-days", "Value": "2555" }], "ObjectSizeGreaterThan": 131072 } },
      "Transitions": [{ "Days": 30, "StorageClass": "STANDARD_IA" }, { "Days": 90, "StorageClass": "GLACIER_IR" }, { "Days": 365, "StorageClass": "DEEP_ARCHIVE" }] }
  ]
}
aws s3api put-bucket-lifecycle-configuration --bucket "$ARCHIVE" \
  --lifecycle-configuration file://lifecycle.json

Lifecycle expiry never removes a version that is still locked or under a legal hold. Segments that reach Deep Archive are restored by an explicit restore job before they can be read or verified.

Create the key bucket without versioning

KEYS=<keys-bucket>
aws s3api create-bucket --bucket "$KEYS" --region "$REGION" \
  --create-bucket-configuration LocationConstraint="$REGION"
aws s3api put-public-access-block --bucket "$KEYS" \
  --public-access-block-configuration BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=true

Never enable versioning on this bucket, not even briefly. Erasing a subject works by overwriting its key; old versions would keep erased keys recoverable. The service refuses a key bucket whose versioning is enabled or suspended, and once a bucket has been versioned it can never return to the never-versioned state, so you would need a new bucket.

Exclude the key bucket from backups and replication. A copy of it can resurrect keys that were destroyed for erasure.

Grant permissions

Add these statements to the service’s IAM identity. The archive writer gets no s3:DeleteObject and no s3:BypassGovernanceRetention.

ResourceActions
Archive buckets3:ListBucket, s3:GetBucketLocation, s3:GetBucketVersioning, s3:GetBucketObjectLockConfiguration
Archive bucket objects (/*)s3:GetObjectVersion, s3:GetObjectRetention, s3:GetObjectLegalHold, s3:PutObject, s3:PutObjectRetention, s3:PutObjectLegalHold, s3:PutObjectTagging, s3:RestoreObject
Key buckets3:ListBucket, s3:GetBucketLocation, s3:GetBucketVersioning
Key bucket objects (/evidence-keys/v1/*)s3:GetObject, s3:PutObject

If you set EVIDENCE_KMS_KEY to use SSE-KMS, the identity also needs to use that key (kms:GenerateDataKey and kms:Decrypt). axonpush encrypts every record with AES-256-GCM before upload regardless of bucket encryption.

Configure and restart

EVIDENCE_ARCHIVE_BUCKET=<archive-bucket>
EVIDENCE_KEYS_BUCKET=<keys-bucket>
EVIDENCE_ARCHIVE_REGION=eu-central-1

Restart the service. On startup it checks both buckets before serving traffic. If any check fails, the service does not start; see Misconfiguration.

Region pinning

On every start the service compares each bucket’s actual region with EVIDENCE_ARCHIVE_REGION. It uses the region from HeadBucket, falling back to GetBucketLocation, and never assumes a reachable bucket is in the right region. The region is written into each organisation’s retention policy and into the clear metadata and encryption context of every record, so records stay bound to it.

Moving the archive to another region means new buckets and a reviewed migration. Changing EVIDENCE_ARCHIVE_REGION on its own makes startup fail against the existing buckets.

S3-compatible storage

EVIDENCE_S3_ENDPOINT points both evidence buckets at an S3-compatible service using path-style requests. The service must support versioning, Object Lock with GOVERNANCE and COMPLIANCE retention, legal holds, object tagging, conditional writes (If-None-Match and If-Match), version-pinned range reads and either HeadBucket region headers or GetBucketLocation, plus tag-based lifecycle rules.

axonpush tests the archive against RustFS 1.0.4 in a disposable local setup. That covers versioned writes, retention, legal holds and key erasure, but not lifecycle transitions, IAM or production durability. AWS S3 is the tested production target; running the archive on another store means validating those parts yourself.

Master keys

The service keeps two 32-byte seeds in the state directory:

  • evidence-key-vault-master-key wraps every subject key in the key bucket. It is created the first time an evidence bucket is configured.
  • evidence-pack-master-key signs evidence packs. It is always created.

To supply your own instead (for example from a secret manager), set EVIDENCE_KEY_VAULT_MASTER_KEY and EVIDENCE_PACK_MASTER_KEY to 32 random bytes, base64-encoded or as 64 hex characters:

openssl rand -base64 32

Set them before the first start that creates the files. Once a seed is saved, a configured value must match it exactly or the service refuses to start. There is no rotation command.

Back up the state directory. Without the key vault master key, archived content can no longer be decrypted. Without the pack seed, new evidence packs are signed by a different key than earlier ones. Neither can be recovered from the database.

Timestamp authority

A timestamp authority is optional for the default GOVERNANCE archive: segments are still sealed, chained and verifiable, and the daily anchor is skipped with a warning in the logs. It is required for COMPLIANCE-mode policies and for governance shortening.

Set both variables:

EVIDENCE_TSA_URL=https://tsa.example.com/timestamp
EVIDENCE_TSA_ROOTS_PEM='-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----'
  • The URL must be HTTPS. Redirects are refused.
  • EVIDENCE_TSA_ROOTS_PEM is the PEM text itself, not a file path. Make sure your service manager keeps the line breaks.
  • The TSA’s signing certificate must chain to those roots and carry the critical time-stamping extended key usage.

Setting only one of the two, or an http:// URL, stops the service at startup. axonpush checks responses against the roots you configure; it does not claim qualified (eIDAS) status or check revocation online.

Governance shortening

An owner can ask to shorten GOVERNANCE retention on a segment, for example after a contract ends. axonpush first writes a signed and timestamped reason receipt, then uses a separate IAM role to change the retention. It never shortens COMPLIANCE retention and never touches an object under legal hold.

To enable it, create a role the service identity can assume (sts:AssumeRole) with:

ResourceActions
Archive bucket objects (/*)s3:GetObjectVersion, s3:GetObjectRetention, s3:GetObjectLegalHold, s3:PutObjectRetention, s3:BypassGovernanceRetention

and set EVIDENCE_GOVERNANCE_ROLE_ARN to its ARN. Leave it unset to disable shortening entirely. It needs a timestamp authority.

Evidence pack destinations

Evidence packs can be delivered to external systems. Their credentials are operator configuration, never sent in API requests or stored in packs. Provide them as JSON keyed by the secret reference used in the destination:

{
  "grc-prod": { "origin": "https://grc.example.com", "token": "<api-token>" },
  "grc-oauth": {
    "origin": "https://grc-two.example.com",
    "clientId": "<client-id>",
    "clientSecret": "<client-secret>",
    "tokenUrl": "https://grc-two.example.com/oauth/token",
    "scope": "<scopes>"
  }
}

Each entry is used only for its exact origin, and an OAuth tokenUrl must be on that same origin. Use either a static token or OAuth client credentials. For Vanta destinations, tokenUrl defaults to <origin>/oauth/token and scope to Vanta’s read, write and document upload scopes. Put the JSON in EVIDENCE_DESTINATION_SECRETS (at most 64 KiB), or store it in AWS Secrets Manager and set EVIDENCE_DESTINATION_SECRETS_ARN, which is read once at startup. Setting both is an error.

Storage cost estimates

The storage card (GET /audit/storage) counts archived bytes per storage class from segment metadata. It shows costs only if you provide prices; axonpush does not look up provider prices, run S3 Inventory or reproduce your bill.

EVIDENCE_STORAGE_PRICES_JSON='{"currency":"USD","source":"Provider price list, eu-central-1","asOf":"2026-11-01T00:00:00Z","rates":{"STANDARD":0.0245,"STANDARD_IA":0.0135,"GLACIER_IR":0.005,"DEEP_ARCHIVE":0.0018}}'
FieldRule
currencyThree uppercase letters.
sourceWhere the prices came from, up to 500 characters. Shown with the estimate.
asOfRFC 3339 date of the prices. Cannot be in the future.
ratesPrice per GB-month for any of STANDARD, STANDARD_IA, GLACIER_IR, DEEP_ARCHIVE. Classes you leave out show as unknown.

The example values are placeholders; use your provider’s current prices. The JSON is limited to 8 KiB, unknown fields are rejected, and invalid JSON stops the service at startup.

Archived trace cache

When someone opens an archived trace, axonpush decrypts it into a private disk cache so the dashboard can page through it. Entries are encrypted with a key that exists only in process memory, live for 15 minutes and are purged on erasure and expiry.

VariableDefault
ARCHIVE_CACHE_DIR<state>/archive-cache
ARCHIVE_CACHE_MAX_BYTES1073741824 (1 GiB)

Misconfiguration

The service checks the archive configuration on every start and refuses to start rather than run with a weaker archive. The error names the problem:

ErrorFix
regional evidence storage and key authority are not configuredSet both buckets, make them different, and make sure a region resolves.
archive bucket unavailable: object store bucket differs from pinned regionThe archive bucket is in another region than EVIDENCE_ARCHIVE_REGION.
object store bucket differs from pinned regionThe key bucket is in another region.
archive bucket versioning must be enabledEnable versioning on the archive bucket.
archive bucket Object Lock must be enabledObject Lock can only be set at creation. Create a new bucket.
key bucket must never have been versioned; key destruction would retain recoverable versionsCreate a new key bucket that has never had versioning.
evidence master key must encode exactly 32 bytesFix the format of a master key variable.
configured evidence-key-vault-master-key does not match private installation stateThe variable differs from the saved seed. Use the saved value or unset the variable.
evidence timestamp authority requires HTTPS and explicit PEM rootsSet both TSA variables, with an https:// URL and valid PEM.
a separate governance IAM role ARN is requiredEVIDENCE_GOVERNANCE_ROLE_ARN is not an IAM role ARN.
invalid storage price configuration and similarFix EVIDENCE_STORAGE_PRICES_JSON.
configure destination credentials by JSON or secret ARN, not bothRemove one of the two destination variables.

Problems that only show up at runtime, such as a missing permission or an unreachable bucket, surface as failed archive jobs, which the Audit pages and the /audit/jobs API list with a retry action. If the key bucket cannot be reached, requests that check for erasures, including event ingest, fail with 503 until it is back.