-
Notifications
You must be signed in to change notification settings - Fork 947
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce LoggingMarkers marker for logging sensitive data #2051
Open
kpavlov
wants to merge
6
commits into
spring-projects:main
Choose a base branch
from
kpavlov:pii-marker
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+119
−9
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@kpavlov Could you check the test failure on this PR? Thanks |
kpavlov
changed the title
Introduce PII marker for logging sensitive data
Introduce LoggingMarkers marker for logging sensitive data
Jan 21, 2025
Introduce a utility class `LoggingMarkers` providing an SLF4J marker for tagging log entries with Personally Identifiable Information (PII). Update `BeanOutputConverter` to use the `PII_MARKER` in error logs for invalid JSON conversions. Enhance tests to verify PII marker usage in logging. Signed-off-by: Konstantin Pavlov <{ID}+{username}@users.noreply.github.com>
Updated Maven configurations to dynamically reference the Java version using `${java.version}`. Added Kotlin compiler settings, including `jvmTarget` alignment with Java version and enabling `javaParameters`. This ensures consistency and better compatibility across builds. Signed-off-by: Konstantin Pavlov <{ID}+{username}@users.noreply.github.com>
Updated the test to assert log size explicitly before accessing the first log entry. This ensures the test is more robust and avoids potential issues with accessing logs unexpectedly. Signed-off-by: Konstantin Pavlov <{ID}+{username}@users.noreply.github.com>
Replaced string concatenation with a placeholder in the logger.error call to improve performance and maintain consistency with logging best practices. This helps avoid unnecessary overhead when logging is disabled. Signed-off-by: Konstantin Pavlov <{ID}+{username}@users.noreply.github.com>
Replaced `PII_MARKER` with `SENSITIVE_DATA_MARKER`. Introduced `RESTRICTED_DATA_MARKER`, `REGULATED_DATA_MARKER` and `PUBLIC_DATA_MARKER` Updated associated logging logic and tests to reflect these changes. Signed-off-by: Konstantin Pavlov <{ID}+{username}@users.noreply.github.com>
Added missing periods to improve consistency and clarity in the Javadoc comments. This change ensures proper formatting and adheres to standard writing conventions. Signed-off-by: Konstantin Pavlov <{ID}+{username}@users.noreply.github.com>
@ilayaperumalg I have updated the PR and fixed incompatibility with JDK 17 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Introduce a utility class
LoggingMarkers
providing an SLF4J marker for tagging log entries with different data security classification, such as:Update
BeanOutputConverter
to use theSENSITIVE_DATA_MARKER
in error logs for invalid JSON conversions. Enhance tests to verify SENSITIVE_DATA_MARKER marker usage in logging.Updated Maven configurations to dynamically reference the Java version using
${java.version}
. Added Kotlin compiler settings, includingjvmTarget
alignment with Java version and enablingjavaParameters
to ensure consistency and better compatibility across builds.