CSV File adapter: Use AllowedAuxiliaryPathChecker in File path UI validation #10391
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
Use the AllowedAuxiliaryPathChecker (and therefore the
allowed_auxiliary_paths
server configuration file parameter) for the CSV Lookup adapter UI validation for the File path field. This ensures that the user cannot use the UI validation on the File path field to inspect if arbitrary directories and files exist on the file system in the Cloud context as described in https://github.com/Graylog2/graylog-plugin-cloud/issues/830. The AllowedAuxiliaryPathChecker was already being used in the process of starting the CSV File adapter (see #10244), and this adds the same check for the UI validation.Motivation and Context
Fixes https://github.com/Graylog2/graylog-plugin-cloud/issues/830, which is a security concern in the Cloud context.
How Has This Been Tested?
Tested in the UI to verify that when
allowed_auxiliary_paths
values are specified, the UI will not attempt to perform validation for file paths that are outside of the specified permitted directories.Also tested that when
allowed_auxiliary_paths
values are not specified, that the file existence and readability checks are performed normally as expected.Types of changes
Checklist: