BM: Baca dalam Bahasa Melayu
World 8: Shields: Security
Secret scanning and push protection
You will learn: how GitHub catches leaked keys, before and after a push.
The problem
In a rush, you pasted the key straight into app.js. You’re about to push. Will anyone notice in time?
Watch
GitHub has a guard called secret scanning: GitHub reads your repo and its history, looking for leaked keys.. It reads your repo, old commits too, looking for keys. Found one? It raises an alert, so you can act. Public repos get it for free.
Try it
Be the scanner! Tap every line that holds a secret.
Tap every line that holds a secret.
0 of 2 found
Watch
push protection: GitHub blocks a push that holds a secret, before it lands. checks your push before it lands. Spots a key? GitHub blocks the push and shows where the key is. The secret never reaches the repo.
Try it
Put a blocked push in order. First step at the top.
First step at the top. Put these in order. Use the arrows, or drag.
- GitHub spots the key
- You push your commits
- You push again, safely
- You take the key out of your commits
- The push is blocked
Hint
Nothing lands on GitHub until the key is gone.Predict
Push protection blocked you. The key is real. What is the best move?
Pick one answer.
Check
Which guard does it? Sort each card.
Drag a card into a box. Or tap the card, then tap the box.
You did it!
You can now let GitHub’s guards catch leaked keys for you.
Go deeper (optional)
Some services team up with GitHub. If their key leaks in a public repo, GitHub tells them. They can cancel the key fast. Your own pushes to public repos get push protection by default. Tools like gitleaks can even check before you commit.
Bahasa Melayu
Sebab tergesa-gesa, anda tampal kunci terus dalam app.js. Anda hampir buat push. Sempatkah sesiapa perasan?
GitHub ada pengawal bernama secret scanning (imbasan rahsia). Ia baca repo anda, termasuk commit lama, untuk cari kunci. Jumpa satu? Ia beri amaran, supaya anda boleh bertindak. Repo awam dapat percuma.
Jadi pengimbas! Ketik setiap baris yang ada rahsia.
Push protection (perlindungan push) semak push anda sebelum ia sampai. Nampak kunci? GitHub sekat push itu dan tunjuk di mana kunci itu. Rahsia tak pernah sampai ke repo.
Susun push yang disekat ikut urutan. Langkah pertama di atas.
Push protection sekat anda. Kunci itu kunci sebenar. Apa langkah terbaik?
Pengawal mana yang buat? Susun setiap kad.
Kini anda boleh biar pengawal GitHub tangkap kunci yang bocor untuk anda.
You finished this before. Practice is always welcome!
Official docs: About secret scanning · About push protection
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?