{"id":35151164,"url":"https://github.com/christianklisch/smartmask-spring-boot-starter","last_synced_at":"2026-01-13T22:02:23.550Z","repository":{"id":330834481,"uuid":"1118471550","full_name":"christianklisch/smartmask-spring-boot-starter","owner":"christianklisch","description":"A unified data masking library for Spring Boot applications that consistently masks sensitive data in JSON responses and logs, reducing GDPR/DSGVO risks while enabling secure audit and security logging.","archived":false,"fork":false,"pushed_at":"2026-01-04T10:39:04.000Z","size":145,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-01-08T22:57:50.413Z","etag":null,"topics":["audit-logging","compliance","data-masking","dsgvo","gdpr","jackson","java","json","logging","pii-masking","privacy","security","spring-boot","spring-boot-starter"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/christianklisch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-17T20:03:56.000Z","updated_at":"2026-01-04T10:39:07.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/christianklisch/smartmask-spring-boot-starter","commit_stats":null,"previous_names":["christianklisch/smartmask-spring-boot-starter"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/christianklisch/smartmask-spring-boot-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christianklisch%2Fsmartmask-spring-boot-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christianklisch%2Fsmartmask-spring-boot-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christianklisch%2Fsmartmask-spring-boot-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christianklisch%2Fsmartmask-spring-boot-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/christianklisch","download_url":"https://codeload.github.com/christianklisch/smartmask-spring-boot-starter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christianklisch%2Fsmartmask-spring-boot-starter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28400681,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T14:36:09.778Z","status":"ssl_error","status_checked_at":"2026-01-13T14:35:19.697Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["audit-logging","compliance","data-masking","dsgvo","gdpr","jackson","java","json","logging","pii-masking","privacy","security","spring-boot","spring-boot-starter"],"created_at":"2025-12-28T15:40:20.348Z","updated_at":"2026-01-13T22:02:23.545Z","avatar_url":"https://github.com/christianklisch.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SmartMask Spring Boot Starter\n\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n![Maven Central](https://img.shields.io/maven-central/v/io.github.christianklisch/smartmask-spring-boot-starter)\n![Build Status](https://github.com/christianklisch/smartmask-spring-boot-starter/actions/workflows/ci.yml/badge.svg)\n\n\nA unified data masking library for Spring Boot applications that delivers consistent masking of sensitive data across JSON responses and logs, designed to support GDPR/DSGVO compliance, audit logging, and security-critical logging scenarios.\n\n\u003e **If you find this project useful, please consider giving it a ⭐ on GitHub!**\n\n## Features\n\n- **Annotation-based**: Simply mark fields with `@Sensitive` to enable masking\n- **Multiple masking strategies**: Specialized masking for emails, credit cards, phone numbers, IBANs, and generic data\n- **Customizable masking**: Configure how many characters to show, which character to use for masking\n- **Role-based access control**: Show unmasked data to authorized users based on Spring Security roles\n- **Automatic integration**: Works with Spring Boot's auto-configuration\n- **Dual protection**: Masks sensitive data in both JSON responses and logs\n\n## Requirements\n\n- Java 17 or higher\n- Spring Boot 3.5.x\n- Jackson (for JSON masking)\n- Logback (for log masking)\n\n## Installation\n\n### Maven\n\nAdd the following dependency to your `pom.xml`:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.github.christianklisch\u003c/groupId\u003e\n    \u003cartifactId\u003esmartmask-spring-boot-starter\u003c/artifactId\u003e\n    \u003cversion\u003e0.4.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### Gradle\n\nAdd the following dependency to your `build.gradle`:\n\n```groovy\nimplementation 'io.github.christianklisch:smartmask-spring-boot-starter:0.4.0'\n```\n\nOr if you're using Kotlin DSL (`build.gradle.kts`):\n\n```kotlin\nimplementation(\"io.github.christianklisch:smartmask-spring-boot-starter:0.4.0\")\n```\n\n## Usage\n\n### Basic Usage\n\n1. Add the dependency to your project\n2. Annotate fields that contain sensitive data with `@Sensitive`\n\n```java\nimport io.github.christianklisch.smartmask.annotations.Sensitive;\n\npublic class User {\n    private Long id;\n    private String username;\n    \n    @Sensitive\n    private String password;\n    \n    @Sensitive(type = MaskType.EMAIL)\n    private String email;\n    \n    @Sensitive(type = MaskType.CREDIT_CARD)\n    private String creditCardNumber;\n    \n    // Getters and setters\n}\n```\n\n### Customizing Masking\n\nYou can customize how the data is masked:\n\n```java\n// Show first 3 characters, mask the rest\n@Sensitive(showFirst = 3)\nprivate String partiallyVisibleData;\n\n// Show last 4 characters, mask the rest\n@Sensitive(showLast = 4)\nprivate String lastFourVisible;\n\n// Use a custom mask character\n@Sensitive(maskChar = '#')\nprivate String customMaskChar;\n```\n\n### Role-Based Access Control\n\nYou can specify which roles are allowed to see the unmasked data:\n\n```java\n// Only users with ROLE_ADMIN can see the unmasked value\n@Sensitive(rolesAllowed = {\"ROLE_ADMIN\"})\nprivate String adminOnlyData;\n\n// Multiple roles can be specified\n@Sensitive(rolesAllowed = {\"ROLE_ADMIN\", \"ROLE_SUPPORT\"})\nprivate String supportData;\n```\n\n### Logging\n\nWhen logging objects with sensitive fields, the library automatically masks those fields:\n\n```java\nUser user = new User();\nuser.setUsername(\"johndoe\");\nuser.setPassword(\"secret123\");\nuser.setEmail(\"john.doe@example.com\");\n\n// The password and email will be masked in the log\nlog.info(\"User created: {}\", user);\n```\n\n## Available Mask Types\n\n- `MaskType.GENERIC`: Customizable masking (default)\n- `MaskType.EMAIL`: Masks the email address while preserving the format (e.g., `j***e@example.com`)\n- `MaskType.CREDIT_CARD`: Shows only the last 4 digits (e.g., `************1234`)\n- `MaskType.PHONE_NUMBER`: Shows first 3 and last 2 digits (e.g., `123****78`)\n- `MaskType.IBAN`: Shows first 4 and last 4 characters (e.g., `DE89************1234`)\n\n## Examples\n\nYou can find a complete example project in the [/examples/springboot3](examples/springboot3) directory.\n\n## License\n\nThis project is licensed under the Apache License 2.0 - see the [LICENSE](http://www.apache.org/licenses/LICENSE-2.0.txt) file for details.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add some amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## Code of Conduct\n\nPlease note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. Please read the [Code of Conduct](CODE_OF_CONDUCT.md) for more information.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchristianklisch%2Fsmartmask-spring-boot-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchristianklisch%2Fsmartmask-spring-boot-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchristianklisch%2Fsmartmask-spring-boot-starter/lists"}