Developer security mini-course

Lesson 4: Secrets Management and Secure Configuration

Review secrets management and secure configuration across builds, deployment and runtime. Handle exposed credentials and verify production settings.

Secrets management and secure configuration protect the credentials and settings on which an application relies. A well-written permission check can still be undermined by a leaked service key or an unnecessarily privileged deployment account.

An exposed credential response should address the credential's validity and use, as well as the place where it was found. Removing a value from the latest source file does not revoke it or erase copies from history and build output.

Learning outcome

You should be able to trace a secret from creation to use and retirement, and identify which production settings require verification during release.

Give each secret a defined purpose

Record the service, owner, privileges and expected lifecycle for important credentials. Prefer short-lived workload identities where the architecture supports them, and grant only the access required.

Keep sensitive values out of repository content, public assets and client bundles. A value shipped to a browser or distributed mobile client should be treated according to its actual exposure, regardless of its variable name.

Use a suitable secrets service or controlled runtime configuration mechanism. Environment variables can be an integration method, but their exposure through diagnostics, process access and logs still needs consideration.

Protect build and deployment paths

Review which users and jobs can read production credentials or change the code that uses them. Limit unnecessary access between development and production.

Avoid printing secret values in build output or error messages. Check generated files, container images, package archives and debugging exports as well as source code.

Respond to an exposed credential

  1. Identify the credential, owner, privileges and potentially affected services.
  2. Restrict or revoke it and arrange replacement through the approved process.
  3. Update legitimate consumers and verify expected operation.
  4. Review relevant activity records for misuse where available.
  5. Remove the exposure path and investigate related copies.
  6. Record the actions and add suitable prevention or detection.

Sequence the response according to the urgency and service dependencies. Deleting repository history alone cannot establish that nobody retained the original value.

Verify production configuration

Disable unnecessary debugging, sample functions and default accounts. Keep detailed errors in appropriately protected logs while showing users a suitable message and reference.

Review cookies, cross-origin policy, transport protection and browser security headers for the actual application architecture. Test changes before enforcing policies that could block legitimate content or authentication.

Manage non-secret configuration as reviewed code where appropriate, and control access to the system that supplies secret values. Verify the deployed state; a safe template does not prove that every running instance uses it.

Review exercise

Choose a service credential and document who can create, retrieve, use and revoke it. Identify whether it appears in logs, build output or distributed files without printing its value in the review record.

Then review one production configuration path. Compare the intended setting with runtime evidence and record how drift would be detected.

Use the findings to improve access, rotation and release checks. Retest the relevant service after changes so security and operational behaviour are both understood.

Read our Testing methodology to discuss coverage, or Book a demo with the systems and objectives you have in mind.

See your first test report this week.

Book a 30 minute demo. We will verify one of your targets with you and run a test against it, so you can judge the results on your own systems.

Book a demo