data-privacy

Implements PII masking, field-level encryption, and GDPR deletion workflows in Java microservices.

Updated Jun 25, 2026
One-click install
npx skills add https://github.com/oriddd/ai-toolkit --skill data-privacy-oriddd
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: data-privacy
Source: https://github.com/oriddd/ai-toolkit/tree/main/copilot/public/skills/data-privacy
Command: npx skills add https://github.com/oriddd/ai-toolkit --skill data-privacy-oriddd

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Java microservices that process user data risk GDPR/CCPA violations through unmasked PII in logs, unencrypted database fields, and missing deletion or retention mechanisms. This Skill provides concrete patterns to handle personal data correctly across the entire service lifecycle. ## Core Features & Use Cases - PII Masking in Logs: Apply a custom @Mask annotation with a Jackson JsonSerializer or logging pattern converter so sensitive fields never appear in plain text. - Field-Level Encryption: Encrypt sensitive columns at rest using JPA Attribute Converters with AES-256 and support for key rotation. - Right to be Forgotten: Implement a Deletion Coordinator that scrambles PII synchronously, purges backups asynchronously, and emits a UserPurgedEvent on completion. - Use Case: When a user requests account deletion, the service marks the user as deleted, anonymizes their email and phone in the main database, schedules purges of audit logs and backups, and enforces TTL-based retention on remaining records. ## Quick Start Apply the data-privacy skill to add PII masking, encryption, and a deletion workflow to my Spring Boot user service.

Frequently Asked Questions about data-privacy

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I mask PII in Java application logs?

Mask PII in logs by annotating DTO fields with a custom @Mask annotation and registering a Jackson JsonSerializer that replaces characters with asterisks. Alternatively, use a Logback or Log4j2 pattern converter to mask fields at the logging layer.

How to encrypt sensitive database fields in Spring Boot JPA?

Encrypt sensitive fields using a JPA Attribute Converter annotated with @Convert on the entity field, backed by AES-256 encryption. The converter should support multiple key versions so you can rotate keys and migrate data in the background.

How do I implement GDPR right to be forgotten in a microservice?

Implement a Deletion Coordinator pattern: on a UserDeletedEvent, synchronously mark the user as deleted and scramble PII fields, then asynchronously purge audit logs, backups, and secondary stores. Emit a UserPurgedEvent once all traces are removed.

Does JPA encryption support key rotation?

Yes, if the EncryptionConverter is designed to track multiple key versions. Each encrypted value records which key version encrypted it, allowing background migration to a new key without downtime.

What data retention strategies work for SQL databases?

For SQL databases without native TTL support, use a scheduled job to purge expired rows based on retention policies. For stores like DynamoDB or Redis, configure native TTL on records so expired data is removed automatically.