BolEnglishLearn · Play · Win
Login

🗝️ Security · Security Fundamentals

🗝️

Secrets Management

Security ControlIntermediateModule 6

Keep passwords, keys, and tokens out of source code.

Secrets need controlled storage and rotation.

💡 In practice

Store an API key in a secrets manager instead of Git.

🖼️ CONCEPT PICTURE
A picture to help remember Secrets Management
Store an API key in a secrets manager instead of Git.

💡 Don't tape the house key to the front door: keep it somewhere locked, and change the lock if it ever goes missing.

💡 Learn🛠️ Apply🎯 Check

💡 Why it matters

A secret in source code spreads to every clone, branch, and backup, and once pushed it is hard to truly erase. Leaked keys are routinely scanned for and abused within minutes. Managing secrets properly keeps them out of code and lets you rotate them fast when needed.

🛠️ How to achieve it

1
Use a secrets store
Keep keys and passwords in a dedicated secrets manager or environment config, never in the repo.
2
Keep them out of Git
Add secret files to ignore lists and scan commits so nothing slips in.
3
Rotate regularly
Change keys on a schedule and immediately after any suspected leak.
4
Scope each secret
Give each secret the narrowest access and a short lifetime where possible.

⚠️ Signs of trouble

  • •API keys or passwords appear directly in the code.
  • •The same secret is reused across every environment.
  • •Secrets are shared over chat or email.
  • •No one knows how to rotate a key if it leaks.
⚠️ Common mistake: Committing a secret to the repository. Move it to a secrets manager, remove it from history, and rotate the key immediately.

🎯 Quick check

Score: 0/3

Three questions to test the idea.

  1. 1. Where should an API key be stored?

    Answer: In a secrets manager or secure config, not in the repo

    Secrets belong in a dedicated store, kept out of source control where they would spread everywhere.

  2. 2. Why does rotation matter for secrets?

    Answer: A leaked key can be replaced quickly to cut off access

    Regular and on-demand rotation means a compromised secret can be revoked and swapped out fast.

  3. 3. A key was accidentally committed to Git. What is the right response?

    Answer: Rotate the key and remove it from history

    Once committed a secret may already be exposed, so you must rotate it and scrub it from history.

🔑 Key terms

Secret
Any sensitive value like a password, API key, or token.
Secrets manager
A secure store that hands out secrets to the apps allowed to use them.
Rotation
Replacing a secret with a new value on a schedule or after a leak.
Environment variable
A config value supplied at runtime rather than written in code.

✅ Review checklist

📊 Your progress

0%
Mark this topic learned to track it.
Saved in this browser.
🚀 Got it?
Mark it learned and move to the next topic.
Next topic →