Commit Graph

114 Commits

Author SHA1 Message Date
Dor Lugasi-Gal
152ee24a1e AHDS authentication security with ChainedTokenCredential and add CodeQL suppression (#1763)
* adding codeql exemption

* fix: Update comments for DefaultAzureCredential usage in AHDS recognizers

* shorter message

* fix: Enhance authentication setup for AHDS integration with secure-by-default approach
2025-10-28 11:37:35 +02:00
Dor Lugasi-Gal
f1689400f8 fix: Add non-root user to all Dockerfiles for security (#1759)
* fix: add non-root user to all Dockerfiles for security

- Create dedicated user 'presidio' with UID 1001 in all Linux containers
- Add USER directive to ensure containers don't run as root
- Set proper file ownership with chown for production images
- Apply same security fix to Windows containers using net user
- Update sample Dockerfiles to follow security best practices

This addresses the container security requirement that containers
should not run with root privileges.

* fix: configure Poetry to not use virtualenvs in containers

When running as non-root user, Poetry was trying to create virtualenvs
in the user's home directory, causing 'Command not found: gunicorn' errors.

Setting POETRY_VIRTUALENVS_CREATE=false ensures Poetry installs packages
system-wide (already isolated by the container), making them accessible
to the non-root user at runtime.

Tested locally with analyzer container - health and analyze endpoints
working correctly.

* fix: pre-install spaCy model in image-redactor for non-root user

The image-redactor was attempting to install en_core_web_lg at runtime,
which failed when running as non-root user due to write permission issues
on system site-packages.

Installing the model during Docker build (as root) ensures it's available
system-wide for the non-root user to read and use at runtime.

Using en_core_web_lg as the default model, which matches the presidio-analyzer
default configuration.

* fix: add POETRY_VIRTUALENVS_CREATE=false to Windows Dockerfiles

Windows containers also need Poetry configured to install packages
system-wide rather than in virtualenvs to ensure the non-root user
can access the installed dependencies.
2025-10-23 11:07:23 +03:00
Copilot
bef0470ff2 Update Python version support: Remove 3.9 (EOL), Add 3.13 (#1741) 2025-10-17 00:04:59 +03:00
Tamir Kamara
e480d3fa68 Update noqa (part 2) (#1736)
* update noqa

* remove noqa which isn't needed
2025-09-28 15:21:12 +03:00
Tamir Kamara
bc4f85b129 Update noqa syntax (#1734) 2025-09-28 08:44:04 +03:00
BhargavDT
a67145ca8a update LiteLLM Docs for detailed guide link (#1698)
Co-authored-by: Omri Mendels <omri374@users.noreply.github.com>
Co-authored-by: Tamir Kamara <26870601+tamirkamara@users.noreply.github.com>
2025-09-02 22:53:54 +03:00
rishasurana
3f510cf8c4 Azure Health and Data Services (AHDS) De-identification Service Surrogator (#1672) 2025-08-15 23:50:04 +02:00
Sharon Hart
a4d49983e4 Update requirements.txt (#1689) 2025-08-10 14:05:52 +03:00
Sharon Hart
c8efdd7109 Force streamlit dependency versions (#1685) 2025-08-04 13:35:21 +03:00
Sharon Hart
cd9fced789 Force new requests to mitigate GHSA-9hjg-9r4m-mvj7 (#1683)
* lock requests to mitigate GHSA-9hjg-9r4m-mvj7

* e2e req
2025-08-03 12:44:08 +03:00
Sharon Hart
333a1cdefd Update requirements.txt with new dependencies 2025-08-03 10:23:04 +03:00
Risha S.
13f9d4c8b6 Azure Health and Data Services (AHDS) De-identification Service (#1624) 2025-07-16 20:16:28 +03:00
FT
c1a917b0f4 Fix Typos in Documentation and Test Descriptions (#1631)
* Update test_context_support.py

* Update image_redaction_allow_list_approach.ipynb

---------

Co-authored-by: Sharon Hart <sharonh.dev@gmail.com>
2025-06-17 10:46:18 +03:00
Sharon Hart
9bfd4c50a0 Exclude 'recognition_metadata' attribute from REST Analyze Response DTO (#1627)
* Exclude 'recognition_metadata' attribute from REST Analyze Response DTO

* json format

---------

Co-authored-by: Omri Mendels <omri374@users.noreply.github.com>
2025-06-16 17:32:56 +03:00
leopardracer
3a306570e0 Fix Typos in Documentation and Test Descriptions (#1628)
* Update test_context_support.py

* Update index.md

* Update docs/samples/python/transformers_recognizer/index.md

---------

Co-authored-by: Omri Mendels <omri374@users.noreply.github.com>
2025-06-13 11:34:44 +03:00
Ron Shakutai
452d6bb1a5 refactor: simplify index retrieval in InstanceCounterAnonymizer (#1577) 2025-05-07 21:24:47 +03:00
Itye Richter
88a9fc6301 Added a new section to the deployments docs (#1462)
* Added a new section to the deployments docs, best practices to deanonymize data when using OpenAI

* dded a line to mkdocs.yaml under samples

* fixed link title

* PR fixes

---------

Co-authored-by: itye-msft <ityer@microsoft.com>
Co-authored-by: Omri Mendels <omri374@users.noreply.github.com>
2025-04-07 18:05:32 +03:00
Omri Mendels
bacf23fa39 Add multiprocessing parameters (#1521) 2025-03-10 11:59:03 +02:00
Ron Shakutai
8b288fae61 docs: Add environment setup and notebook execution guides for Presidio + Spark in Fabric (#1529) 2025-03-06 13:04:30 +02:00
Omri Mendels
7d26bac0a1 example GLiNER integration (#1504) 2025-01-13 11:03:08 +02:00
Omri Mendels
bed2979d4a Docs revamp (#1500) 2024-12-29 13:16:29 +02:00
Sharon Hart
ce63783fcc Unlock numpy after dropping 3.8 (#1480) 2024-11-06 15:21:45 +02:00
Omri Mendels
33808c2837 Removed python 3.8 support (EOL) and added 3.12 (#1479) 2024-11-04 11:47:02 +02:00
Roel Fauconnier
71fa64df96 docs: clarify the docs on deploying presidio to k8s (#1453) 2024-10-14 20:14:53 +03:00
Krish Dholakia
cd7e5471cb (docs) Use Presidio across Anthropic, Bedrock, VertexAI, Azure OpenAI, etc. w/ LiteLLM Proxy (#1421) 2024-07-24 22:40:38 +03:00
Ranjan Singh
d85ba6e5a7 Typo fix added missing ":" after if condition (#1419) 2024-07-22 11:59:05 +03:00
Omri Mendels
d46bacb20b minor notebook changes (#1420) 2024-07-22 11:58:46 +03:00
Omri Mendels
ac38ccae3c NLP engine sample + refresh on samples (#1388) 2024-07-10 16:04:47 +03:00
Andreas Eberle
97a7e42b38 Fix the entity filtering of the transformer_recognizer.py analzye function (#1403) 2024-07-09 22:19:20 +03:00
Vijay Devane
733cca26cf Adding Span Marker Recognizer Sample (#1321)
* Adding Span Marker Recognizer Sample

* Removing "O" label

* Added parameters definitions

* Added span marker sample in list of samples
2024-03-13 06:51:43 +02:00
Omri Mendels
7f09c95b9d added pseudonimyzation sample (#1296) 2024-02-13 13:55:44 +02:00
Omri Mendels
ee84d70b0d Added the option to add custom operators + pseudonymization sample (#1284) 2024-02-12 15:45:52 +02:00
Jakob Serlier
966d17a5a5 Feature/presidio-structured (#1192)
* presidio-structured

changelog

Static analysis

docstrings, types

preliminary tests engine

static analysis

isort

Minor refactorings

Update README.md

Fix late binding issues and example

removal of old samples

Refactoring, adding example

pre-clean-break-commit

broken commit, fixing TabularConfigBuilder

Rename TabularConfig

pre-breaking replace commit

removal of some old experimental files

rename tabular to structured

restructuring presidio tabular - pre del commit

Add project TODOs

testing dump presidio tabular

* Add unit tests

* rename engine, add buildfile

* Update setup.py

* lint-build-test

* Update lint-build-test.yml

* Add packages to setup.py

* Update presidio-structured to alpha version

* Update Presidio structured README.md

* Add logging configuration to presidio-structured
module

* Refactor AnalysisBuilder constructor to accept an
optional AnalyzerEngine parameter

* Fix entity mapping in JsonAnalysisBuilder

* Drop type in docstring in analysis builder classes

* Refactor TabularAnalysisBuilder to use
BatchAnalyzerEngine for all columns

* Update data_reader.py with type hints for file
paths

* Update data_reader.py to include additional
keyword arguments in read() method

* Update Transformer to Processor term in
StructuredEngine

* Add PandasDataProcessor as default to StructuredEngine
init

* Move structured sample files to the docs

* Add Presidio Structured  Notebook to samples index

* Remove unnecessary imports in structured sample

* Update to processors in structured __init__ files

* Add explanation for structured table sample

* Delete unnecessary __init__s in structured test

* Fix bug in JsonAnalysisBuilder entity mapping

* pr comments, nits, minor tests

* README

* Add TabularAnalysisBuilder

* Some basic logging

* linting

* Fix typo in logger variable name

* Refactor analysis builder to include score
threshold

* Linting, continued

* Update Pipfile

* Refactor JsonAnalysisBuilder to support language
parameter

* Fix not camel case in TabularAnalysisBuilder

* Add score_threshold parameter to AnalysisBuilder

* Refactor JSON analysis builder to gain consistency

* Remove low score results in JsonAnalysisBuilder

* Add tests to json analysis  with score threshold

* Fix bug in JSON analysis to update map with
nested_mappings

* Fix bug in JSON analysis to take only entity types

* Fix typos in test anl json names and assert values

* Update build-structured.yml

* Create __init__.py

* Type hint fix python <3.10, loggger typo

* Update setup.py

* PR comments variety

* further pr comments

* readme, refactor score, refactor tabular analysis

* Update test_analysis_builder.py

* lint

---------

Co-authored-by: Omri Mendels <omri374@users.noreply.github.com>
Co-authored-by: Sharon Hart <sharonh.dev@gmail.com>
Co-authored-by: enrique.botia <enrique.botia@netzima.com>
2024-01-14 11:22:44 +02:00
Omri Mendels
2a8d3ec93b Azure AI language recognizer (#1228) 2024-01-11 13:13:43 +02:00
Vijay Devane
175c170876 Update index.md (#1241)
Removed the extra symbol that causing error to load the site
2023-12-28 21:20:10 +02:00
Omri Mendels
b24dbeda54 Updates to demo website with new NLP Engine (#1181) 2023-12-13 18:57:10 +02:00
Omri Mendels
4aaa05fca8 New NlpEngine - docs (#1177) 2023-10-25 15:17:56 +03:00
Nile Wilson
7400dc4b35 Updating verification engines and enable plotting of custom bboxes (#1164)
* Adding methods to enable plotting of custom bboxes

* Adding test for get_pii_bboxes

* Linting fixes and addition of test for add_custom_bboxes

* Adding use of custom bbox into DICOM verification engine

* Fixing tests for the DICOM verification engine

* Adding in ocr kwargs compatibility and updating tests

* Adding example notebook

* Linting fixes

* Remaining linting fix

---------

Co-authored-by: Omri Mendels <omri374@users.noreply.github.com>
2023-09-28 16:02:10 -04:00
Nile Wilson
93934a93b2 Adding examples of toggling metadata usage and saving bboxes (#1158) 2023-08-28 08:56:56 +03:00
Nile Wilson
60e1f7db94 Enabling allow list approach with all image redaction (#1145)
* Enabling allow list approach

* Adding in empty list for allow_list in existing unit tests

* Added unit tests for newly introduced methods

* Adding unit test for allow list functionality

* Linting fixes

* Removing spaces in empty lines

* Fix integration test not accounting for empty space removal

* Updating notebook with more examples and adding ad_hoc_recognizers approach to standard image redactor engine as well

* Linting fixes

* Removing incomplete example code

* Fixing section header numbers

* Removing duplicate comment

---------

Co-authored-by: Omri Mendels <omri374@users.noreply.github.com>
2023-08-23 16:44:47 -04:00
Omri Mendels
0e5c3b7907 Updated docs website and notebooks (#1086) 2023-06-04 12:55:08 +03:00
Omri Mendels
dda4444fda Updates to the TransformersRecognizer sample (#1084) 2023-06-04 12:14:18 +03:00
Omri Mendels
3e84d9ef25 Updated demo website (#1078) 2023-06-01 16:53:03 +03:00
Nava Vaisman Levy
481811af11 Add batch anonymization (#993) 2023-05-01 09:18:00 +03:00
Paulo Costa
24a76a8f44 Added "keep" anonymizer (#1062) 2023-04-30 10:25:00 +03:00
Omri Mendels
61a5405611 New demo app for Presidio, based on Streamlit (#1054) 2023-04-24 14:35:03 +03:00
Omri Mendels
60911edf16 GPT-3 based synthetic data generation (#1051) 2023-04-16 12:41:36 +03:00
Andy
07b854dd7a Adding a sample for identifying PII in a PDF (#1023) 2023-01-30 15:46:36 +02:00
Nile Wilson
b0430cabbb Add evaluation code for DICOM de-identification (#979)
* Initial commit with old paths (will need to fix)

* Fixing paths

* Adding in notebook and updating documentation

* Adding in WIP notebook and docs

* Adding example notebook

* Clearing some output to reduce file size

* Linting fix v1

* Linting v2

* Add rounding to integration test to account for minor differences in real testing

* Fixing typo with wrong variable name

* Removing check for exact or rounded conf

* Updating logic for comparing ocr_results

* Minor fixes on DICOM verify code based on PR comments

* Changing results and gt format from dictionary to list of dictionaries

* Updating notebook

* Updating docstring format

* Linting fix

* Changing fixture scope for mock_engine

* Update docs/image-redactor/evaluating_dicom_redaction.md

Co-authored-by: Omri Mendels <omri374@users.noreply.github.com>

* Docstring updates

* Improving efficiency of _remove_duplicate_entities

* Add handling for divide by zero in recall and precision calculations

* Making precision and recall calculation functions public

* Moving common fixtures to conftest

* PR comments

Co-authored-by: Omri Mendels <omri374@users.noreply.github.com>
2023-01-05 08:01:46 -05:00
Nava Vaisman Levy
8993be09e9 fix access to start end positions (#994) 2023-01-03 14:50:45 +02:00