procedure Security & reliability
Secrets management for web applications
Keep credentials out of repositories and public client output. After exposure, deleting a visible copy is not enough: authorized revocation or rotation and verification are separate tasks.
What it means
A secret is a value whose disclosure can grant someone authority, such as access to an application service. Its protection depends on where the value becomes available and who can use it—not on whether its variable name sounds private. Browser-delivered code is an output boundary: a value embedded there is available to recipients of that code. Keeping a value on the server avoids that particular route, but does not settle access, logging or lifecycle questions.
Try it
Simulation: use only the supplied synthetic selections—no real credentials are needed or accepted. Start with Secret location = public client bundle and Leaked key has been revoked? = no. Then change only Secret location to server env and inspect the changed result and explanation. Select Compare with baseline to display both outcome labels. This changes only a local example; it does not move, revoke or inspect a credential.
Check synthetic secret exposure
Change one condition and inspect the computed result, its cause, and the model boundary.
No real secrets, credentials or deployment environment are accessed.
Client or repository exposure requires authorized containment, investigation and credential revocation.
| Input | Supplied value |
|---|---|
| Secret location | public client bundle |
| Leaked key has been revoked? | no |
Synthetic local learning example. No account, real network, server, filesystem, credential, command or production change is accessed.
About this model
No real secrets, credentials or deployment environment are accessed.
These are bounded teaching rules. Actual behavior needs the linked subject specifications and independent observations. The examples are not live checks.
The baseline result is “STOP: likely secret exposure.” Its explanation is “Client or repository exposure requires authorized containment, investigation and credential revocation.” The public client placement supplies an exposure path, while the no selection supplies no revocation assumption. This is a synthetic warning, not an observed incident. For a real suspected exposure, keep secrets out of shared evidence and involve the authorized incident owner before making changes.
Keep Leaked key has been revoked? = no while changing Secret location from public client bundle to server env. The comparison isolates placement; it does not model incident history or a completed migration.
Reset restores Secret location = public client bundle and Leaked key has been revoked? = no, clears input errors, and removes the comparison. It preserves your independent choices to open or close FAQ answers and About this model.
How it works
A credential can grant authority because a service accepts it, not because of the file or variable that contains it. If a build embeds a valid secret in a public client bundle, recipients can obtain that value. The intermediate condition is therefore not merely “the application uses a secret”; it is “the secret has crossed into output available to recipients.” Server-only placement can avoid that route, provided the value actually stays on the server. Runtime access and logging remain separate concerns.
Placement and containment answer different questions. Correcting a build can prevent the same value from appearing in future output, but it does not withdraw copies already obtained. Revocation changes whether the issuing service accepts the old credential. Rotation also requires a verified transition for legitimate consumers; merely replacing text in one configuration is not proof that the exposed credential has lost its authority.
For a second synthetic case, select Secret location = source control and Leaked key has been revoked? = yes. The result is “Exposure may be contained, verification needed,” with the explanation “Revocation must be confirmed across all consumers; removing one copy is insufficient.” The yes selection changes the model's containment assumption; it does not perform revocation or verify it. In practice, you need evidence that the issuer no longer accepts the old credential and that affected legitimate consumers use the intended replacement.
Worked example
This is a synthetic baseline, not a captured production observation.
| Input | Value |
|---|---|
| Secret location | public client bundle |
| Leaked key has been revoked? | no |
The result is “STOP: likely secret exposure.” The explanation is “Client or repository exposure requires authorized containment, investigation and credential revocation.”
The location makes the credential available through client output in this example. With revocation set to no, the model has no basis for treating its continuing authority as contained. The relevant next task in a real incident would be authorized containment—not merely hiding the variable name or deleting the visible string.
What changes when the condition changes
Change only Secret location to server env. Keep Leaked key has been revoked? = no.
The result becomes “No immediate client exposure indicated.” The explanation is: “Server-only environment variables may be appropriate with least privilege, but server logs and access still matter.”
The changed assumption removes the browser-delivered copy from the modeled placement, so the model no longer signals that particular exposure path. This is a different synthetic situation, not a demonstration that moving an already leaked key makes it safe. The server env branch takes precedence regardless of the revocation answer; it does not evaluate earlier public copies or prove that the credential is protected.
In practice
Use this checklist only for applications and credentials you are authorized to administer. Exact revocation and deployment steps depend on the credential issuer and hosting platform; this page supplies no provider-specific commands. Keep real secrets out of this page, screenshots and shared issue reports.
- Establish the environment and authority. Identify the credential issuer, application, repository, build or deployment, affected environment, and incident owner. Confirm who may inspect evidence, revoke credentials and change deployments. STOP if the target or your authority is uncertain; route the incident to the responsible owner rather than trying credentials or changing access speculatively.
- Perform a read-only preflight. Within that scope, review approved configuration, output and access evidence without publishing or copying secret values into new locations. Determine whether the value remained server-only, entered a client bundle, or appeared in source control. Identify its granted permissions and legitimate consumers. If the evidence is incomplete, record what is unknown; a server-side setting alone cannot rule out an earlier leak.
- Define the minimal change and recovery plan. Record the affected configuration and deployment identifiers in the restricted incident record. Identify exactly which credential will be revoked or rotated, which consumers need an update, and how application service can be recovered without restoring the compromised credential. Preserve relevant evidence before speculative cleanup. If you cannot identify the credential or its consumers reliably, STOP the speculative change and escalate for authorized containment.
- Contain through the approved incident procedure. The authorized owner should revoke or rotate the exposed credential and update legitimate consumers as required by the issuer's procedure. Do not delay authorized containment to finish repository cleanup. Separately correct the placement or build configuration that exposed the value; deleting one copy does not invalidate other copies.
- Verify both security and application behavior. Use approved issuer evidence or authorized verification tooling to confirm that the old credential no longer grants access. Verify that legitimate consumers work with the intended credential and that the affected build or deployment no longer publishes it. A successful application request alone does not establish revocation, and a clean current file does not establish that historical copies are gone.
If the change disrupts legitimate consumers, follow the approved recovery plan. Roll back application or configuration changes only to a state that uses a noncompromised credential, then verify application behavior and containment again. Do not reactivate the exposed credential as a convenience rollback. If safe recovery is uncertain, stop speculative changes and escalate.
Limits and unknowns
No real secrets, credentials or deployment environment are accessed. The simulation does not inspect a client bundle, repository, log, credential issuer or running application. Its messages apply only to the selected synthetic conditions.
The model treats source control as an exposure path without examining repository visibility, access history or surviving copies. For public client bundle and source control, the revocation selection changes the containment branch. For server env, the placement branch takes precedence and the revocation selection does not affect the result. Neither branch establishes whether a real credential was previously disclosed or whether containment succeeded.
If placement, access history or revocation cannot be established from authorized evidence, the real-world conclusion remains unknown. Collect that missing evidence rather than choosing a reassuring answer. The model has no “containment verified” result.
If input is invalid, the previous calculated outcome is removed; correct the selection or use Reset before interpreting a result. Without JavaScript, the initial example and explanation remain readable, but the controls do not operate.
What to carry forward
Make two separate decisions: where future builds and deployments may obtain a secret, and whether an already exposed credential still grants authority. A server-only placement can address the first question without resolving the second. Close an exposure incident only on authorized evidence of containment and working legitimate consumers—not on a cleaner repository or a favorable simulation result.
Frequently asked questions
Editorial questions, answered from the sources listed for this article.
Does naming a build variable SECRET keep it private?
No. A variable name is not an access control. Some build configurations expose values based on naming conventions, while others can substitute a value regardless of its name. Renaming may affect a future build, but it does not by itself prove that public output is secret-free or revoke copies already delivered. Inspect the actual configuration and output within your authorized environment.
Is a server environment variable automatically safe?
No. Server-side placement avoids some client exposure paths, but process access, logs and configuration mistakes still matter. Check who can read the runtime configuration, whether the application can disclose it, and whether the credential has only the permissions it needs. Storage location alone does not establish protection.
Does removing a leaked key from a repository revoke it?
No. Deleting a file or removing it from repository history does not itself change whether the issuing service accepts the credential, and other copies may remain. Address the credential's continuing authority through authorized revocation or rotation first; treat repository cleanup as a separate task, not proof of revocation.
Can I paste a real token here to check whether it is exposed?
No. There is no credential-entry field: this model only uses a location selection and a yes/no revocation assertion. It cannot inspect a token or determine where it has appeared. Use approved incident tooling for real evidence, and redact secrets from screenshots, shared reports and support requests.
Sources & model boundaries
Primary references used for this explanation. The interactive example is an educational model, not a live check.
- OWASP: secrets management
Lifecycle, exposure, least privilege and rotation. Where a secret is stored does not alone establish protection or revocation
Checked .
- GitHub: removing sensitive data
First revoke or rotate exposed credentials; history-removal limits. Deleting text from a repository does not itself revoke the credential
Checked .