Sign in
GUIDE 14 / Operations

Who can reach what?Give every permission a purpose.

Learn how secrets, service identity, least privilege and credential rotation work together, with an interactive permission map.

THE SHORT VERSION

A secret is sensitive material such as a password or token.

Authentication identifies; authorization decides allowed actions.

Limit, review and revoke access throughout its lifecycle.

01 / Secrets & access

Knowing who you are is different from deciding what you can do.

Authentication establishes an identity. Authorization decides what that identity may access or change. A person can sign in successfully and still have no permission to deploy an application, read a database or modify a domain. Services need similarly deliberate boundaries.

Imagine a customer portal with a browser frontend, an API and a notification worker. They perform different jobs. Giving all three the same database administrator credential would make access simple to wire together, but difficult to constrain or explain. Start by writing down each role’s actual responsibilities.

02 / Secrets & access

Connect credentials to the service that needs them.

A secret might be a database password, an API token or a private key. It should reach the intended workload through a controlled runtime mechanism, without becoming part of public source code or a distributable image. Merely changing a value’s filename does not make it secret.

The explorer shows a deliberately narrow example: the API can read the database credential, the worker can use a mail token, and the public frontend gets neither. This is an access model to reason about, not a claim that every application must use the same roles.

INTERACTIVE EXPLAINERGive each service its own permission boundary.
Give each service its own permission boundary.
REQUESTING IDENTITYAPI service
Database credentialAllowed
Mail sending tokenNo access
Infrastructure admin keyNo access

The API receives a database credential scoped to its application work. It does not inherit mail or infrastructure administration access.

REQUESTING IDENTITYMail worker
Database credentialNo access
Mail sending tokenAllowed
Infrastructure admin keyNo access

The worker receives the sending token needed for its job. Database access would require a separate, deliberate decision.

REQUESTING IDENTITYPublic frontend
Database credentialNo access
Mail sending tokenNo access
Infrastructure admin keyNo access

Public browser code receives no privileged secret in this model. Requests needing privileged access go through a service that enforces authorization.

Conceptual example · explore each state
03 / Secrets & access

A secret needs a delivery path, not a hiding place.

Compose supports granting secrets to selected services and making them available as files inside those containers. Applications must know how to read the provided secret. A file-based declaration does not automatically protect the original file on the host or replace a broader secret-management system.

Review the whole path: where the value originates, who can read it, how it enters the workload and what might print it. Debug output, crash reports and copied configuration are common places for sensitive values to travel beyond their intended audience.

Reference: Docker: using secrets in Compose
A secret needs a delivery path, not a hiding place.
ConceptPurposeExample question
IdentityName the callerWhich person or service is acting?
PermissionLimit allowed actionsDoes it need read or write access?
SecretProvide sensitive credential materialWho can obtain this value?
Audit eventRecord meaningful activityWho changed access, and when?
04 / Secrets & access

Smaller permissions make mistakes easier to contain.

Least privilege means granting the access needed for a task rather than broad access by default. Scope credentials to the service and environment where possible. A development worker should not casually share the production application’s credentials.

For the portal, ask whether the mail worker needs to read all customer data or only the information required for a notification. Ask whether a deployment role needs to change billing settings. Clear boundaries help review both normal operation and the consequences of a compromised credential.

Reference: OWASP: secrets management
05 / Secrets & access

Access changes as the project changes.

Credentials need an owner and a lifecycle. Rotation introduces a new value and retires the old one; revocation removes access. Plan how a workload will reload or receive a new credential and how you will verify that legitimate work still succeeds.

When someone leaves or a service is retired, review accounts, tokens and inherited permissions together. If a credential is exposed, removing it from a visible file is not enough: invalidate the old value and investigate where it could have been used. A short access inventory makes that response much more concrete.

Reference: OWASP: secrets management
CLEAR UP THE DETAILS

Common questions.

Is an environment variable always a safe secret store?

No. Its exposure depends on the runtime, tooling, diagnostics and permissions. Use a deliberate secret-delivery mechanism and avoid logging sensitive values.

Can frontend JavaScript keep an API secret?

A credential shipped to a browser should be treated as visible to that user. Keep privileged secrets in an appropriate trusted service.

Does using secrets make the whole app secure?

No. Secret handling is one part of security alongside application authorization, network controls, updates and monitoring.

WHERE DOCKOCK FITS

Connect the concept to your work.

DOCKOCK connects workspace access and deployment review with the infrastructure being changed, helping keep responsibility and permissions understandable.

Explore secrets & access in DOCKOCK

Keep learning from the source.

Further reading from the teams and documentation behind these technologies.

Docker: using secrets in ComposeOWASP: secrets management
CONTINUE EXPLORING

What is a VPS?

The server behind your application, explained from the hardware up.

Read the next guide