Skip to main content

Practice · 1 of 3

Secret Pattern Scanner

CHALLENGE
Difficulty: intermediate+25 XP

Write findSecrets(line) returning an array of matches. Patterns: AWS access keys (AKIA followed by 16 uppercase letters/digits), GitHub tokens (ghp_ + 36+ chars), API keys (sk- + 20+ chars), and name = "value" assignments where name matches /key|token|secret|password/i case-insensitively and value is 8+ chars. Return the matched substrings in the order they appear.

Back to lesson: Practice: Secret Detection — Practice