SaltDns.Encrypted.Registry (Salt v1.0.0)

Every database column that holds a value encrypted by SaltDns.Vault.

SaltDns.Release.rotate_vault/0 re-encrypts exactly these columns, so a retired vault key can be dropped only when all of them were rewritten. Every encrypted column is a field of type SaltDns.Encrypted.Binary (the type knows its context), listed as {schema, field}.

A test (SaltDns.Encrypted.RegistryTest) enforces it three ways: every Encrypted.Binary schema field must be listed here; every other :binary schema field must be named in plain_binaries/0 (hashes and the like); and no module under lib/ may call SaltDns.Vault.encrypt/2 or SaltDns.Crypto.encrypt except the encryption layer itself. So a secret cannot be encrypted by hand in a column that rotation would miss, and a new encrypted column is one line below.

Summary

Functions

The encrypted columns.

:binary columns that are deliberately not encrypted (hashes).

The Encrypted.Binary fields found by scanning the application's schemas.

The plain :binary fields found by scanning the application's schemas.

Types

entry()

@type entry() :: {module(), atom()}

Functions

fields()

@spec fields() :: [entry()]

The encrypted columns.

plain_binaries()

@spec plain_binaries() :: [{module(), atom()}]

:binary columns that are deliberately not encrypted (hashes).

scan()

@spec scan() :: [{module(), atom()}]

The Encrypted.Binary fields found by scanning the application's schemas.

scan_binaries()

@spec scan_binaries() :: [{module(), atom()}]

The plain :binary fields found by scanning the application's schemas.