Updating Java Libraries
This document provides guidance on migrating from the Protegrity AI Developer Edition to the Protegrity AI Team Edition (Cloud Protectors) using the Java SDK.
Prerequisites
- Install and set up the Protegrity Provisioned Cluster (PPC) and AI Team Edition using the steps from the PPC documentation and the respective feature documentation.
- Install and set up a compatible Cloud Protector for Protegrity AI Team Edition.
Move to Protegrity AI Team Edition using one of the following approaches:
- CLI tool: For an automated CLI-based migration, refer to Using the CLI tool.
- Java SDK: To migrate manually using the AI Team Edition Java SDK, refer to Using the Java SDK of AI Team Edition.
Scenario 1: Using the CLI Tool
Protegrity AI Developer Edition version 1.2.0 includes a CLI to make the Protegrity AI Developer Edition (DE) → Protegrity AI Team Edition (TE) transition mechanical rather than manual. Install the Python and the Protegrity AI Developer Edition Python package and use the CLI tool to verify the migration and to create the required policies on PPC.
Set Team Edition environment variables for the SDK on the application host:
export PTY_CP_HOST=<your-cloud-protect-invoke-url> export PTY_AUTH_MODE=aws_iam # or cognito, bearer_token, mtls, noneSet PPC credentials. This is used by both
checkandcreate-policy:export PTY_PPC_HOST=<your-ppc-host> export PTY_PPC_PASSWORD=<admin-password>Both commands also accept
--ppc-host <host>and--ppc-password <password>flags if you prefer to pass them explicitly per invocation. Environment variables are recommended to keep credentials out of shell history.As an alternative, every
pty-migrateand SDK setting can also reside in~/.protegrity/config.yaml. The resolution order: CLI flag > env var > YAML file > default. Storing passwords in the file requiresallow_secrets_in_file: trueANDchmod 600on the file. This is the same model as~/.pgpass. For the full key list, refer toconfig.yaml.templatein theprotegrity-ai-developer-pythonpackage.Run a readiness check to view any missing requirements:
pty-migrate checkBy default, this verifies only the data elements and users present in the local usage stats. Add
--fullto verify the entire bundled Protegrity AI Developer Edition policy instead.The output lists each item, such as the SDK version, endpoint reachability, PPC data elements, datastore export key, and role members, with
✓or✗and a concrete remediation command for anything missing.Deploy the policy to PPC. This is only needed the first time, or after a PPC reset:
pty-migrate create-policyBy default, the CLI deploys only the data elements that usage stats show are used. Add
--fullto deploy the complete bundled Developer Edition policy. This is recommended for QA, training, or demo environments that should mirror Protegrity AI Developer Edition.Register the datastore export key so the Policy Agent can sync the policy to Cloud Protect. The exact
curlcommand with the right datastore id is printed at the end ofcreate-policy. Supply the KMS public key (PEM); the fingerprint returned must matchPTY_DATASTORE_KEYon the Policy Agent Lambda.Trigger the Policy Agent Lambda or wait for its hourly schedule to push the policy from PPC to Cloud Protect.
Re-run
pty-migrate check. If required, add--fullif earlier deployed with--full. When every line shows✓, the application’s existingsample-app-protection.py/sample-app-protection.shcommands will work unchanged against Protegrity AI Team Edition with the samepolicy_userand samedata_elementnames.
Note: The same data elements, role names, and policy users you used in Protegrity AI Developer Edition, such as
superuser,admin,name,address,text,ccn, and so on, are preserved on Protegrity AI Team Edition bycreate-policy. No application code changes are required to switch environments.
The pty-migrate CLI
Installed automatically with the package.
Run the following three subcommands to help you create the required policies and migrate:
pty-migrate check # Pre-flight readiness validation
pty-migrate create-policy # Create the equivalent DE policy on your PPC
pty-migrate stats # View local usage statistics
pty-migrate checkvalidates SDK version,PTY_CP_HOST, auth credentials, and (optionally) round-trips a realprotectcall against your Cloud Protect endpoint. Run it once after exporting your env vars; it prints actionable hints for each missing piece.pty-migrate create-policytalks to your Protegrity Provisioned Cluster (PPC) usingPTY_PPC_HOST,PTY_PPC_USER,PTY_PPC_PASSWORD, andPTY_WORKBENCH_PASSWORD, then creates a TE policy whose data elements match the ones DE provided out of the box (ccn,ssn,name,email, …). It is safe to re-run this command.pty-migrate statsprints a per-data-element, per-day breakdown so you can size your TE deployment based on real DE usage.
Note: Storing PPC passwords in the YAML file is supported but off by default. To opt in, add
allow_secrets_in_file: trueto~/.protegrity/config.yamlandchmod 600the file; only then willppc_passwordandworkbench_passwordbe read from it. Without both,pty-migrateignores those keys and prints a remediation hint - the same model as~/.pgpassand~/.npmrc. CLI flags (--ppc-password) and env vars (PTY_PPC_PASSWORD) always take precedence and need no opt-in.
Scenario 2: Using the AP Java module of AI Team Edition
Note: When the policy is set up on the AI Team Edition, ensure that the same data elements added for the AI Developer Edition are used. For more information about the data elements policy, refer to Policy Definition.
If you use different data elements while creating the policy, then modify the data elements used in the AI Developer Edition accordingly before running the modules.
Install Application Protector Java libraries using the steps from the Application Protector Java documentation.
Note: When prompted for the ESA IP address, enter the hostname of the PPC. Similarly, when prompted for the ESA listening port number, enter
25400. This enables the protector to integrate with the PPC.Include the
ApplicationProtectorJava.jarin the classpath of your applications.Navigate to the location where the AI Developer Edition is cloned.
Go to the
protegrity-ai-developer-edition/samples/javadirectory.a. Update the
pom.xmland theapplication-protector-javadependency.``` <dependency> <groupId>com.protegrity</groupId> <artifactId>application-protector-java</artifactId> <version>1.1.0</version> <scope>system</scope> <systemPath>/opt/protegrity/sdk/java/lib/ApplicationProtectorJava.jar</systemPath> </dependency> ```Note: The AP Java libraries are expected to be in the default path
/opt/protegrity/sdk/java/lib/. If the installation uses a different directory, update the environment or configuration so the system can locate the correct JAR files.b. Run the following command.
``` ./mvnw clean package ```c. Update the sample shell script to include
ApplicationProtectorJava.jarin the classpath.d. Run the samples.
Feedback
Was this page helpful?