Skip to content

Commit b1b7ead

Browse files
Launch Commit
0 parents  commit b1b7ead

13 files changed

+632
-0
lines changed

.gitignore

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
2+
# macOS
3+
.DS_Store
4+
.AppleDouble
5+
.LSOverride
6+
Icon
7+
._*
8+
.Spotlight-V100
9+
.Trashes
10+
ehthumbs.db
11+
Thumbs.db
12+
13+
# Python
14+
__pycache__/
15+
*.py[cod]
16+
*$py.class
17+
.Python
18+
env/
19+
venv/
20+
ENV/
21+
build/
22+
develop-eggs/
23+
dist/
24+
downloads/
25+
eggs/
26+
.eggs/
27+
lib/
28+
lib64/
29+
parts/
30+
sdist/
31+
var/
32+
*.egg-info/
33+
.installed.cfg
34+
*.egg
35+
pip-log.txt
36+
pip-delete-this-directory.txt
37+
htmlcov/
38+
.tox/
39+
.nox/
40+
.coverage
41+
.cache
42+
nosetests.xml
43+
coverage.xml
44+
*.cover
45+
.hypothesis/
46+
.pytest_cache/
47+
.pyre/
48+
.pytype/
49+
50+
# .NET
51+
bin/
52+
obj/
53+
*.user
54+
*.suo
55+
*.userosscache
56+
*.sln.docstates
57+
*.vspscc
58+
*.vssscc
59+
*.dbmdl
60+
*.pdb
61+
*.cache
62+
*.log
63+
*.vs/
64+
TestResults/
65+
*.nupkg
66+
*.snupkg
67+
project.lock.json
68+
project.fragment.lock.json
69+
artifacts/
70+
71+
# Java
72+
*.class
73+
*.jar
74+
*.war
75+
*.ear
76+
*.nar
77+
*.zip
78+
*.tar.gz
79+
*.rar
80+
hs_err_pid*
81+
*.log
82+
*.jks
83+
*.iml
84+
.idea/
85+
target/
86+
out/
87+

CHANGELOG

Whitespace-only changes.

CONTRIBUTIONS.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Contributing to protegrity-developer-edition
2+
3+
Thank you for your interest in contributing to the **protegrity-developer-edition** repository! We welcome contributions from the community to help improve and expand the capabilities of this project.
4+
5+
## 🧠 How to Contribute
6+
7+
### 1. Fork the Repository
8+
Click the **Fork** button at the top right of this page to create your own copy of the repository.
9+
10+
### 2. Clone Your Fork
11+
```bash
12+
git clone https://github.com/your-username/protegrity-developer-edition.git
13+
cd protegrity-developer-edition
14+
```
15+
16+
### 3. Create a Branch
17+
```bash
18+
git checkout -b feature/your-feature-name
19+
```
20+
21+
### 4. Make Your Changes
22+
Make sure your code follows the existing style and includes appropriate tests and documentation.
23+
24+
### 5. Commit and Push
25+
```bash
26+
git add .
27+
git commit -m "Add your message here"
28+
git push origin feature/your-feature-name
29+
```
30+
31+
### 6. Submit a Pull Request
32+
Go to the original repository and open a pull request from your forked branch.
33+
34+
## 🧪 Coding Guidelines
35+
- Follow Python best practices (PEP8).
36+
- Include docstrings and comments where necessary.
37+
- Write unit tests for new features or bug fixes.
38+
- Keep pull requests focused and concise.
39+
40+
## 📄 License
41+
By contributing, you agree that your contributions will be licensed under the same license as the project.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
DEFINITIONS
2+
"Developer Edition" means the non-production version of Protegrity's software platform, SDKs, APIs, and related tools and documentation provided by Protegrity solely for internal evaluation, development, testing, or education.
3+
Customer - means the entity or individual using this license
4+
Protegrity - means Protegrity USA, Inc.
5+
1. LICENSE GRANT & USAGE RIGHTS
6+
License Grant. Subject to your compliance with this agreement, Protegrity grants you a limited, non-exclusive, non-sublicensable, non-transferable, revocable license to use the Developer Edition solely for your internal, non-commercial, and non-production development, testing, and evaluation purposes. You agree not to: (a) Use the Developer Edition for any production or commercial purpose; (b) Copy, modify, create derivative works of, or distribute the Developer Edition except as expressly permitted; (c) Reverse engineer, disassemble, decompile, or otherwise attempt to derive source code or underlying ideas from the Developer Edition; (d) Benchmark or test the performance of the Developer Edition for competitive purposes; (e) Use the Developer Edition to create software that competes with any Protegrity product or service; (f) Input or store regulated data, including personal data, PCI data, or protected health information (PHI); (g) Circumvent any access control or usage limits; or (h) Transfer, rent, lease, or sublicense the Developer Edition or make it available to third parties. If the Developer Edition includes software development kit (SDKs) or APIs, your use of them is subject to the documentation and any limits imposed by Protegrity.
7+
2. SUPPORT AND AVAILABILITY
8+
No Support Obligations. The Developer Edition is provided without any formal support, maintenance, or updates. You may participate in any community support offered by Protegrity at your own risk. Protegrity makes no guarantees regarding availability, uptime, or performance. Access may be suspended or limited at any time without notice.
9+
3. TERM AND TERMINATION
10+
This agreement begins upon your acceptance and continues until terminated. Protegrity may terminate this agreement or your access to the Developer Edition at any time for any reason. Upon termination: (a) All rights granted to you immediately terminate; (b) You must destroy or delete all materials and applications developed using the Developer Edition; (c) Protegrity may delete all data, configurations, or environments associated with your use.
11+
4. OWNERSHIP AND INTELLECTUAL PROPERTY
12+
4.1 Proprietary Rights. All right, title, and interest in and to the Developer Edition, including but not limited to all software, code, application programming interface (APIs), SDKs, algorithms, designs, graphics, user interfaces, documentation, and all intellectual property rights therein, are and shall remain the exclusive property of Protegrity or its licensors. No rights are granted to you other than those expressly set forth in this Agreement.
13+
4.2 Ownership of Derivatives. Any modifications, enhancements, or derivative works you create based on the Developer Edition or any part thereof shall be the exclusive property of Protegrity to the extent they incorporate or are derived from Protegrity intellectual property, and you hereby assign all rights in such works to Protegrity.
14+
4.3 Feedback. If you provide suggestions, enhancement requests, recommendations, or other feedback related to the Developer Edition, Protegrity shall have a royalty-free, worldwide, irrevocable, perpetual license to use, incorporate, and commercialize such feedback without restriction or compensation.
15+
16+
5. WARRANTY DISCLAIMER
17+
THE DEVELOPER EDITION IS PROVIDED "AS IS" AND "AS AVAILABLE." PROTEGRITY MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, OR ACCURACY.
18+
6. LIMITATION OF LIABILITY
19+
PROTEGRITY (AND ITS LICENSORS) SHALL NOT BE LIABLE TO LICENSEE IN CONNECTION WITH THIS AGREEMENT FOR (A) LOSS OF ACTUAL OR ANTICIPATED PROFIT, (B) LOSSES CAUSED BY BUSINESS INTERRUPTION, (C) LOSS OF GOODWILL OR REPUTATION, (D) LOSS OF OR CORRUPTION OF DATA, OR (E) ANY DIRECT, INDIRECT, PUNITIVE, EXEMPLARY, MULTIPLE, SPECIAL, OR CONSEQUENTIAL COST, EXPENSE, LOSS OR DAMAGE, EVEN IF SUCH COST, EXPENSE, LOSS OR DAMAGE WAS REASONABLY FORESEEABLE OR MIGHT REASONABLY HAVE BEEN CONTEMPLATED BY THE PARTIES AND WHETHER ARISING FROM BREACH OF CONTRACT, TORT, NEGLIGENCE, BREACH OF STATUTORY DUTY OR OTHERWISE.
20+
7. INDEMNIFICATION
21+
Customer shall defend Protegrity from any and all claims brought against Protegrity alleging that Customer data, Customer applications, or other materials developed by Customer using the Developer Edition (a) infringe or misappropriate a third party<92>s intellectual property rights, (b) violate applicable law, or (c) otherwise harm a third party. Customer shall indemnify Protegrity for all damages and costs (including reasonable attorneys<92> fees) awarded by a court of competent jurisdiction or agreed to in a settlement approved by Customer in connection with such claims.

README.md

Lines changed: 210 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,210 @@
1+
# Protegrity Developer Edition
2+
3+
Welcome to the `protegrity-developer-edition` repository, part of the Protegrity Developer Edition suite. This repository provides a self-contained experimentation platform for discovering and protecting sensitive data using Protegrity’s Data Discovery and Protection APIs.
4+
5+
## 🚀 Overview
6+
7+
This repository enables developers to:
8+
- Rapidly set up a local environment using Docker Compose.
9+
- Experiment with unstructured text classification and PII redaction.
10+
- Integrate Protegrity APIs into GenAI and traditional applications.
11+
- Use sample applications and data to understand integration workflows.
12+
13+
## 📦 Repository Structure
14+
15+
```text
16+
.
17+
├── CHANGELOG
18+
├── CONTRIBUTIONS.md
19+
├── LICENSE
20+
├── README.md
21+
├── data-discovery
22+
│   ├── sample-classification-commands.sh
23+
│   └── sample-classification-python.py
24+
├── docker-compose.yml
25+
└── samples
26+
├── config.json
27+
├── requirements.txt
28+
├── sample-app-find-and-redact.py
29+
├── sample-app-find.py
30+
└── sample-data
31+
└── sample-find-redact.txt
32+
```
33+
34+
## 🧰 Features
35+
36+
- **Data Discovery**: REST-based classification of unstructured text using Data Discovery.
37+
- **Data Protection**: Integration with a sample Python application for redaction or masking.
38+
- **Sample App**: Demonstrates how to find and redact PII.
39+
- **Cross-platform**: Works on Linux, Windows, and MacOS.
40+
41+
## 🛠️ Getting Started
42+
43+
### Prerequisites
44+
- [Python >= 3.9.23](https://www.python.org/downloads/)
45+
- [pip](https://pip.pypa.io/en/stable/installation/)
46+
- [Python Virtual Environment](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/)
47+
- Container management software:
48+
- For Linux/Windows: [Docker](https://docs.docker.com/reference/cli/docker/)
49+
- For MacOS: [Docker Desktop](https://docs.docker.com/reference/cli/docker/) or Colima
50+
- [Docker Compose V2](https://docs.docker.com/compose/install/)
51+
- [Git](https://git-scm.com/downloads)
52+
53+
Linux and Windows users can proceed to [Setup Instructions](#setup-instructions).
54+
55+
**Additional settings for MacOS**
56+
57+
MacOS requires additional steps for Docker and for systems with Apple Silicon chips. Complete the following steps before using Developer Edition.
58+
59+
1. Complete one of the following options to apply the settings.
60+
- For Colima:
61+
1. Open a command prompt.
62+
2. Run the following command.
63+
```
64+
colima start --vm-type vz --vz-rosetta
65+
```
66+
- For Docker Desktop:
67+
1. Open Docker Desktop.
68+
2. Go to **Settings > General**.
69+
3. Enable the following check boxes:
70+
- **Use Virtualization framework**
71+
- **Use Rosetta for x86_64/amd64 emulation on Apple Silicon**
72+
4. Click **Apply & restart**.
73+
74+
2. Update one of the following options for resolving certificate related errors.
75+
- For Colima:
76+
1. Open a command prompt.
77+
2. Navigate and open the following file.
78+
79+
```
80+
~/.colima/default/colima.yaml
81+
```
82+
3. Update the following configuration in `colima.yaml` to add the path for obtaining the required images.
83+
84+
Before update:
85+
```
86+
docker: {}
87+
```
88+
89+
After update:
90+
```
91+
docker:
92+
insecure-registries:
93+
- ghcr.io
94+
```
95+
4. Save and close the file.
96+
5. Stop colima.
97+
```
98+
colima stop
99+
```
100+
6. Close and start the command prompt.
101+
7. Start colima.
102+
```
103+
colima start --vm-type vz --vz-rosetta
104+
```
105+
- For Docker Desktop:
106+
1. Open Docker Desktop.
107+
2. Click the gear or settings icon.
108+
3. Click **Docker Engine** from the sidebar. The editor with your current Docker daemon configuration `daemon.json` opens.
109+
4. Locate and add the `insecure-registries` key in the root JSON object. Ensure that you add a comma after the last value in the existing configuration.
110+
111+
After update:
112+
```
113+
{
114+
.
115+
.
116+
<existing configuration>,
117+
"insecure-registries": [
118+
"ghcr.io",
119+
"githubusercontent.com"
120+
]
121+
}
122+
```
123+
124+
5. Click **Apply & Restart** to save the changes and restart Docker Desktop.
125+
6. Verify: After Docker restarts, run `docker info` in your terminal and confirm that the required registry is listed under **Insecure Registries**.
126+
127+
3. Optional: If the *The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested* error is displayed.
128+
129+
1. Start a command prompt.
130+
2. Navigate and open the following file.
131+
132+
```
133+
~/.docker/config.json
134+
```
135+
3. Add the following paramater.
136+
```
137+
"default-platform": "linux/amd64"
138+
```
139+
4. Save and close the file.
140+
5. Run the `docker compose up -d` from the `protegrity-developer-edition` directory if already cloned, else proceed to Setup Instructions.
141+
142+
### Setup Instructions
143+
144+
Complete the steps provided here to clone, install, find, and test the Developer Edition.
145+
146+
1. Open a command prompt.
147+
2. Clone the git repository.
148+
```
149+
git clone https://github.com/Protegrity-Developer-Edition/protegrity-developer-edition.git
150+
```
151+
3. Navigate to the `protegrity-developer-edition` directory in the cloned location.
152+
4. Start the Data Discovery services in background. The dependent containers are large in size. Based on the network connection, the containers might take time to download and deploy.
153+
```
154+
docker compose up -d
155+
```
156+
Based on your configuration use the `docker-compose up -d` command.
157+
5. Install the `protegrity-developer-python` module. It is recommended to install and activate the Python virtual environment before installing the module.
158+
```bash
159+
pip install protegrity-developer-python
160+
```
161+
The installation completes and the success message is displayed.
162+
163+
164+
### Run the Sample application
165+
166+
Complete the steps provided here to run the sample application. The sample application reads the `sample-find-redact.txt` file, classifies and redacts the sensitive data, and the `output.txt` file is saved to the folder `samples/sample-data`.
167+
168+
1. Open a command prompt.
169+
2. Navigate to the `protegrity-developer-edition` directory in the cloned location.
170+
3. Run the sample application.
171+
```
172+
python samples/sample-app-find-and-redact.py
173+
```
174+
175+
## 📄 Configuration
176+
177+
Edit `samples/config.json` to customize the Python module:
178+
- API endpoint (Default: `localhost`)
179+
- Named entity mappings
180+
- Redaction method (`redact` or `mask`, Default: `redact`)
181+
- Masking Character (Default: `#`)
182+
- Classification score threshold (Default: `0.6`)
183+
- Enable logging (Default: `true`)
184+
```json
185+
{
186+
"api_endpoint": "http://localhost:8580/pty/data-discovery/v1.0/classify",
187+
"named_entity_map": {
188+
"CREDIT_CARD": "CCN",
189+
"DATE_TIME": "DATE"
190+
},
191+
"redaction_method": "redact",
192+
"masking_character": "#",
193+
"classification_threshold": 0.6,
194+
"enable_logging": true
195+
}
196+
```
197+
198+
## 📚 Documentation
199+
200+
- The Protegrity Developer Edition documentation is available at [http://developer.docs.protegrity.com/](http://developer.docs.protegrity.com/).
201+
- For API reference and tutorials, visit the Developer Portal at [https://www.protegrity.com/developers](https://www.protegrity.com/developers).
202+
203+
## 📢 Community & Support
204+
205+
- Join the discussion on https://github.com/orgs/Protegrity-Developer-Edition/discussions.
206+
- Anonymous downloads supported; registration required for participation.
207+
208+
## 📜 License
209+
210+
See [LICENSE](https://github.com/Protegrity-Developer-Edition/protegrity-developer-edition/blob/main/LICENSE) for terms and conditions.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env bash
2+
3+
export TEST_DATA="The customer reported their card number as 4024007154260020, \
4+
but they might need to check it again. During the verification process, \
5+
we noticed 6011781675152556 was submitted multiple times by mistake. \
6+
Please ensure you replace the incorrect input 5167982896988451 with valid data. \
7+
I think 4539754659592262 was listed in a previous entry, but double-check just in case. \
8+
For reference, 348598789276293 seems to follow an old format; update as required."
9+
10+
curl -X POST "http://localhost:8580/pty/data-discovery/v1.0/classify" -H "Content-Type: text/plain" --data "$TEST_DATA"

0 commit comments

Comments
 (0)