Lesson 3: Give access deliberately
You will be able to: apply least privilege to human and service identities, and keep access and secrets appropriate as people and systems change.
About 4 min
Least privilege means each identity gets only the access its job requires, for only as long as it requires it. “Identity” includes people and also non-human identities: service accounts, CI pipelines, workloads, and API keys. Non-human identities are often the most privileged and the least reviewed.
Access has a life cycle: request → approve → provision → review → change or remove. It needs to follow people when they join, move teams, and leave. People who move teams tend to keep their old access, so their permissions quietly pile up.
- Grant access through roles or groups, not one-off grants to individuals.
- Use single sign-on with strong multi-factor authentication; prefer phishing-resistant methods.
- Use just-in-time access for sensitive actions: requested, approved, time-limited, and logged.
- Give pipelines short-lived credentials issued per run (for example, through OIDC federation) instead of long-lived keys.
- Keep secrets in a secrets manager, never in code, and rotate them when they may have been exposed.
The evidence trail is the access life cycle itself: requests and approvals, provisioning logs, periodic access review results, and removal records that line up with departure dates.
Exercise 1 of 2: Configure the access matrix
Brightwell is setting up access for three identities. Everyone starts with no access. Set each permission to the least access that lets the identity do its job.
Set each cell to None, Just-in-time, or Standing. Then check your configuration.
- None
- No access.
- Just-in-time
- Requested for a specific need, approved, time-limited, and logged.
- Standing
- Always available while the role lasts.
| Identity | Read source code | Approve pull requests | Deploy to production | Read production logsRedacted | Query customer recordsAd hoc database reads | Support consoleView customer accounts |
|---|---|---|---|---|---|---|
| PriyaBackend developer, joins the on-call rotation | ||||||
| SamCustomer support agent | ||||||
| Deploy pipelineCI service identity |
Priya
Backend developer, joins the on-call rotation
Sam
Customer support agent
Deploy pipeline
CI service identity
If an identity were compromised today, an attacker would hold:
- Priya: nothing standing
- Sam: nothing standing
- Deploy pipeline: nothing standing
Apply it 2 of 2: A key in a public repository
You notice that a cloud access key was committed to a public repository two hours ago.
What do you do first?
Key points
- Least privilege applies to people and to service identities: pipelines, workloads, API keys.
- Access follows people through joining, moving teams, and leaving. Movers keep old access unless someone removes it.
- Use just-in-time access for sensitive actions and short-lived credentials for pipelines.
- An exposed secret is compromised: revoke it first, then investigate.