Urgent.News

What's breaking now, across thousands of outlets.

Tech

Secret Scanner False Positives From Whitespace Stripping

A secret scanner has to catch keys that a line break has cut in two. The fast way to do that is to delete every whitespace character and run the key patterns on what is left. The catch is that deleting whitespace also glues the end of one word to the start of the next. A clean document can then look like it leaks a credential. This post is for anyone who maintains a secret scanner, a data loss…

A secret scanner struggles with API key matches caused by stripping whitespace. The scanner checks text for credentials, looking for patterns like sk- followed by letters and digits. When a line break splits a key in two, the scanner may falsely identify a match. The fix keeps the stripped match but verifies it against the original text.

The scanner maps each character back to its position in the original source before removing whitespace. It then re-runs a pattern on the original span, joining whitespace runs that contain line breaks or Unicode line separators. Finally, the scanner decides whether to accept or reject the match based on the joined source and the position of the match.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Kubernetes NetworkPolicy: isolate and test traffic

Picture a Friday evening: a container in your staging namespace starts querying the prod database, for the plain reason that nothing stops it. In Kubernetes that is the default behaviour.

  • Default Kubernetes behavior allows pods without NetworkPolicy to communicate in/out of cluster.
  • NetworkPolicy restricts traffic flow by defining podSelector, policyTypes, and rules.
  • Best practices include granting only necessary permissions, thorough testing, and rollout order.

More from Saturday 14 November →