TotalApp Docs

Secrets Management

Store and access environment variables and API keys securely.

Overview

Secrets Management is a secure key-value store for environment variables, API keys, database connection strings, tokens, and any other sensitive configuration values your pipelines and services need. Values are masked by default in the UI — only the key name is visible until you click Reveal. Secrets are namespaced by environment (dev, staging, prod) so the same key name can hold different values per environment without duplication.

Integration with CI/CD

Secrets stored here can be injected into CI/CD Pipeline steps using the ${{secrets.KEY_NAME}} syntax in step commands and environment variable values. The pipeline runner resolves the reference at execution time — the raw value never appears in the pipeline definition.

Adding Secrets

  1. Navigate to Secrets Management in the DevOps sidebar.
  2. Select the target environment from the environment tabs at the top (Development, Staging, Production).
  3. Click + Add Secret.
  4. Enter the Key name. Use UPPER_SNAKE_CASE by convention (e.g. DATABASE_URL, STRIPE_SECRET_KEY).
  5. Enter the Value. The input is a password field by default — the value is not visible as you type.
  6. Optionally enter a Description for the secret (visible in the key list — keep it informative but non-sensitive).
  7. Click Save. The secret is stored and the value is immediately masked.

Key Naming Conventions

Prefix keys by service to avoid collisions: POSTGRES_DB_URL, REDIS_URL, STRIPE_SECRET_KEY, AWS_ACCESS_KEY_ID. Avoid generic names like API_KEY — they become ambiguous when you have multiple services.

Environments

Secrets are organised into three environments that map to typical software deployment stages. Each environment is isolated — secrets in Production are not visible or accessible from the Development environment view.

Development

Local development credentials. Database URLs pointing to localhost, sandbox API keys, mock service tokens. Values here are often less sensitive but should still be protected from accidental sharing.

Staging

Pre-production credentials for the staging environment. Should mirror production configuration with separate accounts and databases so staging tests are realistic but isolated from live data.

Production

Live system credentials. Production database connection strings, payment processor live keys, third-party production API tokens. Access to production secrets should be restricted to authorised personnel only.

Promoting a Secret Across Environments

Click the Copy to Environment option on a secret's context menu to create the same key in another environment. The value must be re-entered — values are never automatically copied to other environments to prevent accidentally promoting development credentials to production.

Injecting into Pipelines

Reference secrets from Secrets Management inside CI/CD Pipeline step commands and environment variable values using the interpolation syntax:

  • In environment variable values: set the value to ${{secrets.DATABASE_URL}} — the pipeline runner substitutes the resolved secret value at runtime.
  • In step commands: use ${{secrets.MY_KEY}} inside the command string (e.g. curl -H "Authorization: Bearer ${{secrets.API_TOKEN}}" https://api.example.com).

The resolved values are never written to log output — if a step command echoes a resolved secret, it is automatically redacted with *** in the step log.

Environment Selection

When manually triggering a pipeline run, you are prompted to select which secret environment to use (Development / Staging / Production). The pipeline definition does not hard-code an environment — the choice is made at run time. Webhook-triggered runs use the environment configured in the pipeline's default environment setting.

Access Audit Log

Every access to a secret value — reveal, copy, or pipeline injection — is recorded in the Audit Log tab. Each entry shows:

  • Timestamp
  • User who accessed the secret
  • Secret key name and environment
  • Action type: Reveal, Copy, Pipeline Inject, Update Value, Delete
  • Pipeline run ID (for injection events)

The audit log is read-only and cannot be edited or deleted. Entries are retained for 90 days. Export the log as CSV from the toolbar for external compliance reporting.

Best Practices

  • Never hardcode secrets in pipeline step commands. Always use ${{secrets.KEY_NAME}} references so the raw value is not visible in the pipeline definition YAML or JSON.
  • Rotate secrets regularly. Update the value in Secrets Management and all pipeline runs immediately use the new value — no pipeline edits required.
  • Use separate credentials per environment. A compromised staging key should not grant access to production systems. Always use distinct accounts/keys per environment.
  • Review the audit log monthly. Unexplained reveal or copy events may indicate unauthorized access to Secrets Management.
  • Delete secrets you no longer use. Stale secrets that are never rotated and never deleted are a long-term security risk. Review and prune the secret list quarterly.
  • Prefer short-lived tokens over long-lived API keys. Where the service supports OAuth tokens, prefer tokens with expiry over permanent API keys.

FAQ

Are secret values encrypted at rest?
Yes. Secret values are encrypted before being written to the server-backed JSON store using AES-256-GCM with a key derived from the server's secret key environment variable (TOTALAPP_SECRETS_KEY). Without this key, the stored JSON is not usable. Set a strong, random value for TOTALAPP_SECRETS_KEY in your server environment and keep it confidential.
Can I export all secrets for backup?
The Export feature (available to administrators) exports secrets as a JSON file with values encrypted using the same TOTALAPP_SECRETS_KEY. The export file is not human-readable without the key. Import the export file into another TotalApp instance to restore secrets. Never export secrets to a plaintext file.
Who can view secret values?
By default, any authenticated TotalApp user can reveal secret values in the Development environment. Staging and Production environments require the "Secrets: Read Sensitive" permission role. Role assignments are managed in HR → Employees. The audit log records every reveal regardless of role.