Repository navigation
detectors: Spanish social security number (NUSS), validated by its control - #29
Merged
yagobski merged 1 commit intoOct 19, 2026
Conversation
…ntrol Two digits of province, eight of number, two of control; the control is the province and number modulo 97, so a match is checked, not guessed from the shape. Grouped with one consistent separator it matches on its own; a bare run of twelve digits only next to its label (NUSS, NAF, numero de afiliacion, Seguridad Social). Registered as spanish_social_security_number in group:government_ids and at AgentRisk level 4. Refs Privatris/AgentLeak#4.
nikhilred2619
pushed a commit
to nikhilred2619/agentleak
that referenced
this pull request
Nov 3, 2026
…ntrol (yagobski#29) Two digits of province, eight of number, two of control; the control is the province and number modulo 97, so a match is checked, not guessed from the shape. Grouped with one consistent separator it matches on its own; a bare run of twelve digits only next to its label (NUSS, NAF, numero de afiliacion, Seguridad Social). Registered as spanish_social_security_number in group:government_ids and at AgentRisk level 4. Refs Privatris/AgentLeak#4.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follows #23 (DNI/NIE) with the other Spanish government identifier that turns up in HR and health records: the social security number (NUSS, número de afiliación). Today it produces no finding.
Two digits of province, eight of number, two of control. The control is the province and number modulo 97 (a number below ten million counts as
number + province × 10^7, the published rule), so a match is checked rather than guessed from the shape;28 12345678 40is the usual example and comes out right.28/12345678/40,28 12345678 40,28-12345678-40): matches on its own.NUSS,NAF,número de afiliación,Seguridad Social.Registered like the DNI/NIE:
spanish_social_security_number, HIGH, ingroup:government_idsand at AgentRisk level 4. Those were the only places listingnational_insurance_numberoutside the tests.Tests in
tests/test_pii_spanish_nuss.py(control arithmetic, both forms, negatives, registration); the values are made up. Locally: ruff, SPDX and mypy clean; the full suite shows no new failures. CHANGELOG entry at the bottom of Added. Merges cleanly together with #27 and #28.Refs Privatris/AgentLeak#4.