Identifier recognizers make incorrect validation decisions on some values
Affected module
Ingestion Framework
Describe the bug
Four configured identifier recognizers make incorrect validation decisions on particular inputs. Typical valid inputs still work; the defects appear at the boundaries below.
PL_PESELcompares the check digit with the weighted-sum remainder instead of its complement.IT_FISCAL_CODEreturnsNonewhen the check character is wrong. Presidio treats that as no validation decision, retains the pattern score, and OpenMetadata can promote the match using column context.AU_ACNomits the final modulo operation, rejecting valid ACNs with check digit zero.FI_PERSONAL_IDENTITY_CODEparses the two-digit year without the century encoded by the separator.
To Reproduce
Observed with OpenMetadata commit ba688d605830bb3d287ab65e8096b3b4724ce198, Python 3.11.16, Presidio Analyzer 2.2.358, the shipped PII recognizer configuration, and fixed one-value samples. Database sampling was bypassed. Run recognition using each row’s workflow language and column name; inspect the target entity returned by TagAnalyzer.analyze().
| Entity | Language | Column | Value | Observed target-entity result |
|---|---|---|---|---|
PL_PESEL |
pl |
pesel |
44051401458 (valid) |
Missing |
PL_PESEL |
pl |
pesel_test |
44051401452 (invalid) |
Present at 1.0 |
IT_FISCAL_CODE |
it |
codice_fiscale_test |
RSSMRA85T10A562A (invalid check character) |
Present at 1.0 after context promotion |
AU_ACN |
en |
acn |
000 250 000 (valid) |
Missing |
FI_PERSONAL_IDENTITY_CODE |
fi |
hetu_test |
290200-1239 (invalid: - denotes 1900) |
Present at 1.0 |
The underlying recognizer results can also be reproduced in an ingestion Python environment with Presidio Analyzer 2.2.358:
from presidio_analyzer.predefined_recognizers import (
AuAcnRecognizer,
FiPersonalIdentityCodeRecognizer,
ItFiscalCodeRecognizer,
PlPeselRecognizer,
)
cases = [
(PlPeselRecognizer(), "44051401458"),
(PlPeselRecognizer(), "44051401452"),
(ItFiscalCodeRecognizer(), "RSSMRA85T10A562A"),
(AuAcnRecognizer(), "000 250 000"),
(FiPersonalIdentityCodeRecognizer(), "290200-1239"),
]
for recognizer, value in cases:
hits = recognizer.analyze(value, recognizer.supported_entities)
print(recognizer.name, value, [(hit.entity_type, hit.score) for hit in hits])This prints no hit for the valid PESEL and ACN; a 1.0 hit for the invalid PESEL and Finnish code; and a 0.3 Italian fiscal-code hit that the named column promotes in OpenMetadata.
Expected behavior
Correct each recognizer’s validation rule so the valid examples pass and the invalid examples fail as that entity. Keep the fixes independently reviewable within this issue.
Regression checks should include a wrong check digit and supported 2000-century month encoding for PESEL; valid omocodic fiscal codes; spaced ACNs with zero and nonzero check digits; and Finnish dates using supported 1900- and 2000-century separators, including valid 290200A1239 versus invalid 290200-1239.
Check resulting classification separately. Identifier validity does not by itself determine whether a column contains PII.
Additional context
Singapore NRIC checksum support is excluded pending a decision on supported variants. Parent epic: #33827.
Source: open-metadata/OpenMetadata