BM: Baca dalam Bahasa Melayu
World 8: Shields: Security · Boss challenge
Leak drill
You will learn: to fix a leaked key fast, in the right order.
The problem
Drill time! A fake key slipped into your last commit. Good news: you have not pushed yet. Fix it fast.
Watch
There it is: .env in the newest commit. Three rooms, three fixes. Stuck? After 2 tries, a hint appears.
Try it
Clean up the leak, room by room.
Step 1 of 3: Stop tracking the key
Take .env out of the box, but keep the file on your computer.
- Empty
- Empty
- 4 save points
- Add weather widget
- Ignore log files
- Add day 1 page
Hint
Rungit status in each room first.Check
Plot twist: that commit was already pushed to a public repo. What do you do first?
Pick one answer.
Check
Now put the full rescue in order. First step at the top.
First step at the top. Put these in order. Use the arrows, or drag.
- Close the secret scanning alert
- Rewrite history with git filter-repo
- Rotate the key
- Force-push and tell your team
- Untrack .env and add it to .gitignore
Hint
A leaked key must stop working before anything else.You did it!
You can now handle a leaked key, pushed or not.
Bahasa Melayu
Masa latihan! Satu kunci palsu terselit dalam commit (titik simpan) terakhir anda. Berita baiknya: anda belum push. Baiki cepat.
Itu dia: .env dalam commit terbaru. Tiga bilik, tiga pembaikan. Buntu? Selepas 2 cubaan, petunjuk akan muncul.
Bersihkan kebocoran ini, bilik demi bilik.
git status dulu dalam setiap bilik.Kejutan: commit itu sebenarnya dah di-push ke repo awam. Apa anda buat dulu?
Sekarang susun penyelamatan penuh. Langkah pertama di atas.
Kini anda boleh uruskan kunci yang bocor, dah di-push atau belum.
You finished this before. Practice is always welcome!
Official docs: git rm · gitignore · git commit (--amend) · Removing sensitive data from a repository
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?