The suffix capture group was written as `([a-dA-D{1}])`, placing the
intended `{1}` quantifier *inside* the character class. Inside a class,
`{`, `1`, and `}` are treated as literal members, so the class admitted
the digit `1` as a valid NINO suffix (the `{`/`}` variants are only
blocked incidentally by the trailing `\b`).
A UK National Insurance Number always ends in a single suffix letter
A, B, C or D (HMRC/DWP format); a numeric suffix is never valid. As a
result inputs such as `AB 12 34 56 1` were wrongly reported as a
UK_NINO. The prefix groups in the same pattern already use the correct
`[...]{1}` form (quantifier outside the class).
Fix by moving the quantifier outside the class: `([a-dA-D]{1})`.
Adds parametrized cases asserting a numeric suffix is rejected.
Co-authored-by: Sharon Hart <sharonh.dev@gmail.com>
Presidio - Data Protection and De-identification SDK
📣 Presidio is moving to a new home! Read more here 📣
Context aware, pluggable and customizable PII de-identification service for text and images.
| Component | Downloads | Coverage |
|---|---|---|
| Presidio Analyzer | ||
| Presidio Anonymizer | ||
| Presidio Image-Redactor | ||
| Presidio Structured |
What is Presidio
Presidio (Origin from Latin praesidium ‘protection, garrison’) helps to ensure sensitive data is properly managed and governed. It provides fast identification and anonymization modules for private entities in text such as credit card numbers, names, locations, social security numbers, bitcoin wallets, US phone numbers, financial data and more.
📘 Full documentation
📣 Project transition update
❓ Frequently Asked Questions
💭 Demo
🛫 Examples
Goals
- Allow organizations to preserve privacy in a simpler way by democratizing de-identification technologies and introducing transparency in decisions.
- Embrace extensibility and customizability to a specific business need.
- Facilitate both fully automated and semi-automated PII de-identification flows on multiple platforms.
Main features
- Predefined or custom PII recognizers leveraging Named Entity Recognition, regular expressions, rule based logic and checksum with relevant context in multiple languages.
- Options for connecting to external PII detection models.
- Multiple usage options, from Python or PySpark workloads through Docker to Kubernetes.
- Customizability in PII identification and de-identification.
- Module for redacting PII text in images (standard image types and DICOM medical images).
⚠️ Presidio can help identify sensitive/PII data in un/structured text. However, because it is using automated detection mechanisms, there is no guarantee that Presidio will find all sensitive information. Consequently, additional systems and protections should be employed.
Installing Presidio
Running Presidio
- Getting started
- Setting up a development environment
- PII de-identification in text
- PII de-identification in images
- Usage samples and example deployments
Support
- Before you submit an issue, please go over the documentation.
- For general discussions, please use the GitHub repo's discussion board.
- If you have a usage question, found a bug or have a suggestion for improvement, please file a GitHub issue.
- For other matters, please email presidio@dataprivacystack.org.
Contributing
For details on contributing to this repository, see the contributing guide.
This project has adopted the Contributor Covenant Code of Conduct.
