feat(risk-presidio): drop IPv6 short-form and IPv4 unspecified IP false positives#2915
Conversation
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 0940bde The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Prompt-injection risk reportCorpus: 933 cases (384 malicious / 549 benign) No main baseline artifact found yet; this comment shows the current run only. Operational Modes
L1 opt-in was not evaluated in this run: classifier URL is not set. Generated by |
🚀 Preview Environment (PR #2915)Preview URL: https://pr-2915.dev.getgram.ai
Gram Preview Bot |
Why
Production
risk_resultsanalysis on the read replica (1.38M total matches) showed Presidio'sIP_ADDRESSdetector dominating noise —1.03Mof the 1.38M findings, 75% of all triggered risks, come from a single entity type, almost all of them not-actually-IP text fragments.Breakdown of the noise:
::(already filtered)<hex>::(b::,ad::,bed::,dead::,1::,2::,3::,5::,d::,deaf::,fad::)0.0.0.0IP_ADDRESS+pii.ip_address)These come from hex constants, partial address text in logs/code, and
0.0.0.0bind-address literals. None of them are addresses anyone meaningfully uses.What
Extend
isPresidioFalsePositiveto drop:netip.ParseAddr(...).IsUnspecified()— automatically covers::,::0,0::0,0:0:0:0:0:0:0:0(existing),0.0.0.0(new), and any other spelling Go's parser recognizes.<hex>::via regex^[0-9a-f]{1,4}::$— catches the new ~17k class.::1(loopback) anddead::beef(two-group IPv6) are deliberately preserved as real addresses — covered by existing + new test cases.Test plan
presidio_internal_test.goupdated to cover0.0.0.0,b::,dead::,1::,DEAF::(case-insensitive), and thedead::beef/::1negative casesgo vet ./internal/background/activities/risk_analysis/...cleango test ./internal/background/activities/risk_analysis/ -run 'IsPresidioFalsePositive|FiltersIPv6Unspecified'passes