Security/db entities have readable fields defined (#25404)#25576
Merged
luk-kaminski merged 1 commit into7.0from Apr 14, 2026
Merged
Conversation
* Add readableFields to DbEntity annotation and enforce in suggestion service Add a `readableFields` attribute to `@DbEntity` that declares which MongoDB document fields may be exposed through general-purpose services like `MongoEntitySuggestionService`. Sensitive data (passwords, tokens, internal configs) is excluded from each entity's readable list. `MongoEntitySuggestionService` now validates requested fields against the readable list via `EntityPermissionsUtils.areFieldsReadable()` and returns an empty response when a non-readable field is requested. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Readable fields corrected for data node, decorator and access token * Corrected readable fields for other entities * Corrections to Claude-generated code * _id field is added as readable * Removed unused methods from EntitySuggestionService * Removed service parameter that has been never used in the code... * Additional safety in MongoCollectionExportService, despite the fact it is only used with investigations collection now * Changelog added * Permission utils return false on empty or null field collection, to avoid possibility of MongoDB projection returning complete document * HTTP 400 status code on attempt to read unreadable or non-existing fields --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> (cherry picked from commit 720557e)
janheise
approved these changes
Apr 13, 2026
This file contains hidden or 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
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.
Description
Backporting #25404 to 7.0.
(cherry picked from commit 720557e)
Types of changes
Checklist: