Repository navigation
Conversation
…irectory A project schema read from the source cluster was joined into the mapping file path, so a value such as ../x could select a file outside --mappings. Such a schema now falls back to default_node.json like any unknown schema. Addresses Sonar pythonsecurity:S8707. Co-Authored-By: jason.han <hanhuijun@gmail.com>
Contributor
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
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.
Summary
elastic/scripts/migrate_search_indices.pypicks a node mapping file as<schema>_node.jsoninside--mappings, whereschemais read from the project's metadata document in the source cluster. A schema such as../xor an absolute path madeshipped_mappingload a file outside the mappings directory and send it to the target cluster as the index mapping. A schema that is not a plain file name is now treated like any unknown schema: a warning, thendefault_node.json.Relates to SonarCloud issue
AaHncA10_gf8BehZaY6E(pythonsecurity:S8707,migrate_search_indices.py:154). Sonar traces the taint from the--mappingsCLI argument. That part is by design (the operator chooses the directory), so the issue may stay open after this change and is then a candidate to mark as accepted; the path this PR closes is the one a person running the script does not control.Why it is safe
default,cameo,jupyter,msosa) and any custom schema that is a plain name resolve exactly as before; only names containing a path separator change, and they get the existing fallback.shipped_mappingwith a stub source and a temp mappings directory:cameo→cameo_node.json,unknown→ default with warning,../secretand an absolute path → default with warning. Ondevelopthe same../secretcall returned the file outside the directory. The script has no test suite in the repo, so this check is not committed.Implemented in session Get SonarCloud analysis landing for exec-mms
Review with Devin · Open in Devin Desktop