Security Checklists

Test Environment Configuration and Secrets Isolation

Prevent automated tests from loading production configuration or exposing credentials.

Overview

Test environments should be deliberately separate from development, staging and production. A mistaken environment variable can make a test suite alter real data or send real messages.

Use explicit environment selection

Define a clear test environment and fail fast if required test configuration is missing. Do not silently fall back to production endpoints.

Isolate credentials and services

Use test-only database accounts, mail sinks and API credentials. Store secrets in the CI platform's secret manager and restrict which workflows can access them.

Verify destructive operations

Database refresh and filesystem cleanup commands should check the active environment before running. Add safeguards that make production targets impossible or require an explicit, protected operation.

Keep examples safe

Sample environment files should contain placeholders, never live credentials. Document which values are required and which services are mocked in automated tests.

Share this page Help other developers discover this resource.