feat(similarity): sign-up similarity check #31

Open
thelion wants to merge 0 commits from thelion/signup-similarity into main AGit
Owner

Flags sign-ups that look like existing accounts (same SSH key, IP, normalised email, proxy client; medium/weak signals), escalates strong matches with banned accounts. Relay/CDN/own hosts never count.

Flags sign-ups that look like existing accounts (same SSH key, IP, normalised email, proxy client; medium/weak signals), escalates strong matches with banned accounts. Relay/CDN/own hosts never count.
feat(similarity): sign-up similarity check
All checks were successful
Release / release (push) Successful in 11m2s
bb39f8a67a
When a sign-up arrives, and whenever staff open a request, managebot now
says whether it looks like the same person as an existing account, which
one, and why. It's a warning, never a ban.

Signals (internal/services/similarity/signals.go):
- strong (60/50): the same SSH key fingerprint; the same exact,
  non-shared IP from any source (signup, ssh, znc, irc); the same
  normalised email (case folded, +tags and Gmail dots dropped); the same
  proxy client (the abuse scan's proxy_client links)
- medium: the same exact IP on a hosting/VPN network (20); the same /24
  or /64 on a residential or mobile network (20); the same name stem
  once digits and separators are gone, or one edit apart for 6+ letters
  (25; stems under 4 letters, common words and names on more than 8
  accounts don't count); the match is in a cluster staff banned as
  linked (15). Two different medium signals together count as strong.
- weak, context only (5 each): same ASN, same IRC client version,
  sign-ups within 48 hours. Matches are only reported on a medium or
  strong signal.

Shared infrastructure never counts as an address match: iCloud Private
Relay and CDN/WARP egress (by range, ASN and organisation), Tor exits
when the list has any, private addresses, the IRC box (ZNC, the webchat
gateway and the ZNC user vhosts), the VPS and the shells host, its NAT
and IPv6. The list is SharedInfrastructure in shared.go, extendable with
CHECK_SHARED_NETS. Addresses on more than 5 accounts, subnets on more
than 6 and anything staff accounts have used are ignored too.

Results are cached in similarity_results (migration 000020), worked out
at intake, on demand (GET/POST /api/requests/{id}/similar) and every 6
hours for all requests. The request page has a "similar accounts" panel
linking each match and showing bans; the queue badges rows with the best
match. A strong match with a banned account adds a similar.banned reason
and turns an auto-approval into an escalation (never a rejection);
accounts already approved are left alone.

Only local data is used: the database and the local GeoLite ASN file.

Also: the queue table's sr-only header no longer widens the page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
All checks were successful
Release / release (push) Successful in 11m2s
This branch is already included in the target branch. There is nothing to merge.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin +refs/pull/31/head:thelion/signup-similarity
git switch thelion/signup-similarity

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff thelion/signup-similarity
git switch thelion/signup-similarity
git rebase main
git switch main
git merge --ff-only thelion/signup-similarity
git switch thelion/signup-similarity
git rebase main
git switch main
git merge --no-ff thelion/signup-similarity
git switch main
git merge --squash thelion/signup-similarity
git switch main
git merge --ff-only thelion/signup-similarity
git switch main
git merge thelion/signup-similarity
git push origin main
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ircforever/managebot!31
No description provided.