EQTY LabDocs

Configuration

Every environment variable Key Guardian reads.

View as Markdown

Key Guardian reads its configuration from environment variables, and from a .env file in its working directory if there is one. Everything else, such as key slots, Intel Trust Authority and policies, is set in the console and stored in the database.

Required

VariableMeaning
SECRET_KEYSigns session cookies. At least 32 random bytes: openssl rand -hex 32.
ENCRYPTION_KEYThe software key slot, a Fernet key. Unset, Key Guardian writes a key file to its data directory on first start and logs a warning. Always set it in production.

Database

VariableMeaning
DB_TYPEpostgresql, mysql or sqlite.
PG_HOST, PG_PORT, PG_DB, PG_USER, PG_PASSWORDPostgreSQL connection.
MYSQL_HOST, MYSQL_PORT, MYSQL_DB, MYSQL_USER, MYSQL_PASSWORDMySQL connection.
DATABASE_URLInstead of the parts above, for example postgresql://user:pass@host:5432/db or sqlite:////app/web/instance/vcomp.db.

Key Guardian creates and migrates its tables on start-up.

Server

VariableDefaultMeaning
PUBLIC_URLfrom the Host headerExternal base URL, such as https://guardian.example.com. Used for sign-in redirects and Mac enrollment.
SECURE_COOKIESfalseMark the session cookie Secure. Set to true behind HTTPS.
KG_TRUSTED_PROXIESnoneComma-separated proxy addresses or CIDR ranges. For requests from these, rate limits use the client address in X-Forwarded-For. Without it, every client behind the proxy shares one budget.
BIND_ADDR0.0.0.0:80 in the imageListen address.
INSTANCE_PATH/app/web/instanceData directory: SQLite database, generated key file and file store.
FILE_STORE_PATH$INSTANCE_PATH/filesWhere uploaded reference files are kept.
MAX_UPLOAD_BYTES200 MiBLargest file upload.
CAPE_PRIMITIVES/app/cape-primitivesThe policy engine’s building blocks, shipped in the image.
RUST_LOGinfoLog filter.

Each client may make 120 requests a minute, and 10 a minute to sign-in and Mac renewal. Over the limit, Key Guardian answers 429 with Retry-After: 60.

Accounts and sign-in

VariableMeaning
ADMIN_USER_IDSComma-separated account IDs that are administrators. When set, it overrides the administrator setting in the console.
GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRETTurn on Google sign-in, and turn off self-registration. The redirect URI is <PUBLIC_URL>/auth/google/callback.

Key custody credentials

Key slots are set up in the console. Only the credentials to reach them go in the environment. See Key custody.

VariableFor
AZURE_TENANT_ID, AZURE_CLIENT_ID, AZURE_CLIENT_SECRETAzure Key Vault with a service principal.
AZURE_CERT_PATHA certificate instead of AZURE_CLIENT_SECRET.
YUBIHSM_PASSWORDThe YubiHSM 2 authentication key’s password.

With an Azure managed identity or workload identity, you need no Azure variables.

Mac enrollment

VariableDefaultMeaning
KG_MAC_ACME_ORIGINorigin of PUBLIC_URLThe HTTPS origin Macs enroll through, if different.
KG_MAC_CERT_VALID_DAYS90Mac certificate validity, 1 to 36500 days. Never longer than the root key’s.
KG_MAC_WITNESS_MAX_EVIDENCE_DAYS365A Mac whose last Apple attestation is older than this needs a new token.

Development only

VariableMeaning
DEBUG_SKIP_SIGNATURE_VALIDATIONSkip the nonce signature check. Never set it in production: anyone holding a manifest could request its secrets.