Use this environment variables and secrets management checklist to keep configuration consistent, credentials protected, and deployments predictable across local development, staging, and production. It is designed as a reusable review tool for app teams using web, mobile, or cloud deployment workflows.
Overview
Configuration and secrets are easy to treat as deployment details until a missing variable breaks a release, a staging value reaches production, or a credential appears in a log. A dependable approach separates ordinary configuration from sensitive values, defines how each environment receives them, and gives the team a repeatable way to review changes.
Environment variables are useful for values that vary between environments, such as service URLs, feature flags, region identifiers, log levels, and connection settings. They are not automatically a secure secrets store. Anyone who can read a process environment, deployment configuration, build artifact, or diagnostic output may be able to access them. Sensitive values should therefore be stored in an appropriate secrets manager or protected CI/CD mechanism and injected only where they are needed.
The goal is not to make every environment identical. Development may use local services, test accounts, and verbose logging, while production may use managed infrastructure and stricter controls. The goal is environment parity: the same variable names, expected types, validation rules, and application behavior should exist across environments, even when the actual values differ.
For broader release controls, pair this checklist with The Complete CI/CD Pipeline Checklist for Web and Mobile App Releases. If configuration changes affect database access or migrations, also review the database migration deployment checklist.
What to track
1. Build a configuration inventory
Maintain a list of every variable an application expects. Record its name, purpose, data type, required or optional status, default behavior, and the environments where it is used. Group entries by function, such as application runtime, database, authentication, external APIs, storage, observability, and feature flags.
A useful inventory might include:
- Name: the exact variable used by the application.
- Purpose: what behavior or integration it controls.
- Type: string, integer, Boolean, URL, JSON, duration, or another defined format.
- Sensitivity: public configuration, internal configuration, credential, signing key, or private certificate.
- Required environments: local, test, staging, production, or a specific job.
- Owner: the team responsible for its value and lifecycle.
- Validation: permitted format, range, or allowed values.
Keep the inventory close to the codebase, such as in a documented configuration reference or typed schema. A checked-in example file can show variable names and safe placeholder values, but it should never contain working credentials.
2. Establish naming and validation rules
Choose a naming convention and apply it consistently. Names should communicate scope without exposing secret contents. Avoid ambiguous entries such as KEY or URL; prefer names that identify the service and purpose, such as PAYMENTS_API_BASE_URL or SESSION_SIGNING_SECRET.
Validate configuration when the application starts, rather than allowing an invalid value to cause a later and less understandable failure. Check that required values exist, URLs have the expected scheme, numeric settings are parseable, and enumerated values are supported. Fail fast in deployment environments when a required setting is absent. For optional settings, document the fallback behavior explicitly.
3. Separate secrets from ordinary configuration
Classify values before deciding where they belong. A public frontend configuration value may be safe to expose to users, while a server-side API credential, database password, encryption key, webhook signing secret, or OAuth client secret must remain private. Do not assume that a variable is secret merely because its name contains SECRET, and do not assume a value is safe because it is stored in an environment variable.
Use a dedicated secrets manager, protected deployment settings, or another access-controlled store for sensitive values. Store ordinary non-sensitive configuration in version-controlled files only when doing so fits the project’s threat model. Never commit real credentials to source control, app templates, container images, build logs, or shared documentation.
4. Make local development safe and repeatable
Provide a documented local setup path. A common pattern is a tracked example file containing placeholders and an ignored local file containing developer-specific values. Confirm that ignore rules cover all local secret files, temporary exports, shell history risks, debug dumps, and generated configuration artifacts.
Where possible, give developers safe test credentials or local emulators instead of production access. Document how to obtain access, how to revoke it, and which services can be replaced locally. New developers should be able to identify missing values without asking for a copied production configuration file.
5. Define CI/CD injection points
Decide where each deployment secret enters the pipeline and how long it remains available. Prefer injecting secrets at the latest practical stage, such as during a deployment or runtime startup, rather than baking them into source bundles or container layers. Limit secrets to the jobs and environments that need them.
Review pull request previews, build logs, test reports, artifact storage, caching, and deployment output. A secret can leak even when the main pipeline is protected if a command prints environment variables or a failed test serializes configuration. Configure masking or redaction where available, but treat masking as a safeguard rather than permission to log sensitive values.
6. Control access, rotation, and recovery
Assign access by role and environment. Developers may need local test credentials without needing production secrets; a deployment job may need a release credential without broad administrative access. Use separate credentials for separate environments and services when practical. Record who owns each credential, when it was created, where it is used, and how it can be revoked.
Define a rotation procedure before it is needed. The procedure should cover creating a replacement, updating dependent systems, deploying the new value, verifying health, invalidating the old value, and recording the change. Test whether applications can reload credentials without downtime; if they cannot, include a controlled restart or rollout in the runbook.
Prepare an incident path for suspected exposure. It should identify who can revoke the credential, how to search logs and repositories, how to assess affected systems, and how to document the response. For API integrations and signed webhooks, configuration changes should be coordinated with the integration’s validation and replay behavior. The reliable webhook integrations guide provides related design considerations.
Cadence and checkpoints
Use a lightweight review cadence instead of waiting for an audit or outage. A monthly or quarterly review is suitable for many teams, but the right interval depends on application risk, release frequency, team size, and the number of external integrations.
- Every pull request: check whether new configuration is documented, validated, and classified correctly. Confirm that no credential or sensitive example value was added to code, tests, screenshots, or fixtures.
- Before each deployment: compare the required-variable list with the target environment. Verify that new values are present, correctly scoped, and available to the actual runtime rather than only to the build job.
- Monthly: review unused variables, failed injection attempts, access changes, recent rotations, and log redaction. Remove stale settings from retired integrations and environments.
- Quarterly: test credential rotation and recovery procedures, review ownership, inspect CI/CD permissions, and confirm that local setup documentation still works from a clean checkout.
- After an incident or provider change: reassess storage, injection, masking, access, and rollback behavior. Deployment tools and cloud platforms can change how settings are scoped or exposed, so provider-specific assumptions should be checked rather than copied forward.
Track these checks in the same place as other release controls. The aim is not paperwork; it is an observable record that the application’s configuration model still matches its deployment process.
How to interpret changes
A growing configuration inventory is not automatically a problem. It may reflect new integrations or clearer separation between services. The warning signs are unmanaged growth: variables with no owner, duplicated names with different meanings, values used by only one forgotten job, or environment-specific exceptions that are not documented.
When a deployment fails because a variable is missing, first determine whether the value was never created, was stored in the wrong scope, was unavailable to the runtime, or was renamed without updating a dependent component. Avoid solving the immediate failure by copying an entire environment file between systems. That approach can introduce unrelated credentials and conceal the underlying ownership problem.
When a secret appears in a log or repository, treat it as exposed even if access seems limited. Preserve enough evidence for investigation, revoke or rotate the affected credential, remove future exposure paths, and verify that old logs, artifacts, caches, and copies are handled according to the team’s incident process. Do not rely on deleting the visible line alone.
Configuration drift is another important signal. If staging uses different variable names, fallback behavior, or service assumptions from production, a successful staging deployment may provide weak evidence about production readiness. Compare schemas and startup validation across environments, then document intentional differences such as test endpoints or development-only flags.
For architectural context, configuration boundaries often follow service boundaries. Teams evaluating a monolith, modular monolith, or microservices approach can use the app architecture decision guide to connect deployment ownership with configuration ownership.
When to revisit
Revisit this checklist on a monthly or quarterly schedule and whenever a meaningful change occurs. The most important triggers are a new cloud service, CI/CD provider, app deployment tool, authentication integration, database, storage system, or third-party API. Also review it when adding a new environment, splitting a service, changing build and runtime stages, onboarding a new team, or moving from a private deployment to a shared platform.
Use the following practical sequence for the next review:
- Export or inspect the application’s declared configuration schema.
- Compare required variables with local, test, staging, and production inventories.
- Mark each value as public, internal, or secret and verify its storage location.
- Check access permissions for developers, CI/CD jobs, runtime identities, and support roles.
- Search recent logs, artifacts, repositories, and issue attachments for accidental exposure.
- Identify credentials due for rotation or missing an owner.
- Run a safe deployment or configuration validation in a non-production environment.
- Record intentional differences, unresolved risks, and the next review date.
Keep this checklist alongside your deployment documentation, API integration notes, and release workflow. Configuration management is most reliable when it is treated as a recurring developer utility: visible to the team, checked at predictable points, and updated whenever the application or its delivery system changes.