Configuration 

Extension configuration 

Configure nr-vault in Admin Tools > Settings > Extension Configuration.

storageAdapter

storageAdapter
Type
string
Default
local
Options
local

Where secrets are stored.

local
Store secrets in the TYPO3 database (default). Secrets are encrypted with envelope encryption before storage.

masterKeyProvider

masterKeyProvider
Type
string
Default
typo3
Options
typo3, file, env

How to retrieve the master encryption key.

typo3
Derive from TYPO3's encryption key. This is the recommended default as it requires no additional configuration and works out of the box.
file
Read from a file on the filesystem.
env
Read from an environment variable.

masterKeySource

masterKeySource
Type
string
Default
NR_VAULT_MASTER_KEY

Source location for the master key. Interpretation depends on the provider:

  • file: Path to the key file (e.g., /secure/path/vault.key).
  • env: Environment variable name (e.g., NR_VAULT_MASTER_KEY).
  • typo3: Not used (key derived from TYPO3's encryption key).

allowCliAccess

allowCliAccess
Type
boolean
Default
false

Allow CLI commands to access secrets without a backend user session.

cliAccessGroups

cliAccessGroups
Type
string
Default
empty

Comma-separated list of backend user group UIDs that CLI can access. Empty means all secrets are accessible when CLI access is enabled.

auditLogRetention

auditLogRetention
Type
integer
Default
365

Number of days to retain audit log entries. Set to 0 for unlimited retention.

preferXChaCha20

preferXChaCha20
Type
boolean
Default
false

Prefer XChaCha20-Poly1305 over AES-256-GCM. XChaCha20 is recommended when hardware AES acceleration is not available.

Master key providers 

TYPO3 provider (default) 

Uses TYPO3's built-in encryption key to derive the master key. This is the recommended default because:

  • Zero configuration: Works immediately after installation.
  • No server access required: Ideal for users without shell access.
  • Unique per installation: Each TYPO3 instance has its own key.
  • Already secured: TYPO3's encryption key is already protected.

The master key is derived from the encryption key using HKDF-SHA256 with a nr-vault-specific context, ensuring it cannot be used to compromise other TYPO3 functionality.

Master key derivation (internal)
// How it works internally
$masterKey = hash_hkdf(
    'sha256',
    $GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'],
    32,
    'nr-vault-master-key'
);
Copied!

File provider 

Store the master key in a file with restrictive permissions:

Create master key file
# Generate a new key
openssl rand -base64 32 > /secure/path/vault-master.key
chmod 0400 /secure/path/vault-master.key
Copied!

Configure in extension settings:

Environment provider 

Store the master key in an environment variable:

Set master key via environment
export NR_VAULT_MASTER_KEY="base64-encoded-key"
Copied!

Configure in extension settings:

This is ideal for containerized deployments where secrets are injected via environment variables.

Access control 

Access to secrets is controlled by:

  1. Ownership: The user who created the secret has full access.
  2. Group membership: Secrets can be shared with backend user groups.
  3. Admin access: Backend administrators have access to all secrets.
  4. CLI access: Configurable via allowCliAccess.

Context-based scoping 

Organize secrets by context for easier management:

  • payment - Payment gateway credentials.
  • email - Email service API keys.
  • api - Third-party API tokens.
  • database - External database credentials.

Contexts are user-defined strings that help organize and filter secrets.

Site configuration integration 

Use the %vault(identifier)% syntax in site configuration files:

config/sites/main/config.yaml
settings:
  payment:
    stripeSecretKey: '%vault(stripe_api_key)%'
  email:
    mailchimpKey: '%vault(mailchimp_key)%'
Copied!

Secrets are resolved when the site configuration is loaded. This keeps sensitive values out of version control while allowing configuration through the standard TYPO3 site settings.

Frontend-accessible secrets 

By default, secrets cannot be resolved in frontend context (TypoScript). To allow a secret to be used in TypoScript:

  1. Create the secret with frontend_accessible metadata.
  2. Use the %vault(identifier)% syntax in TypoScript.
Store frontend-accessible secret
$this->vaultService->store(
    'google_maps_key',
    $apiKey,
    [
        'metadata' => [
            'frontend_accessible' => true,
        ],
    ],
);
Copied!