Lion Cipher Lab

Search code with ripgrep, and catch the secrets its fast defaults skip

Why it matters

Searching a codebase is something you will do every working day in security: finding where a config value is set, which files call a risky function, every IP address in a repo you were just handed, or whether anyone pasted a password into the code. ripgrep (the command is rg) has become the default tool for that job because it is fast and it hides noise. The catch is how it hides noise: by default it skips everything your .gitignore lists, every hidden file and folder, and every binary file. That is great for reading code and dangerous for security work, because the files most likely to hold…

What you'll learn

Steps in this lab

  1. The words first: what ripgrep is and the one trap this lab measures
  2. Open a terminal, check Git and Python, make a lab folder
  3. Install ripgrep and confirm the version
  4. Build the practice repo and the scorer
  5. Look before you search: what Git tracks, what it ignores, and the file that is both
  6. Measure 1, the baseline: grep -r searches everything
  7. Measure 2: rg with its defaults finds 2 of 9
  8. Measure 3: peel the filters off one layer at a time
  9. Measure 4: speed on a bigger tree, and where the speed really comes from
  10. Daily patterns: narrow, count, extract, and search literally
  11. --json: results a script can trust
  12. The security job: a small pre-commit gate with rg
  13. Honest negatives: three ways a secret still gets past you
  14. Judgment: rg, grep, or a scanner, and how a pro sets this up

Open the full interactive lab →