-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
CSV File adapter: Use AllowedAuxiliaryPathChecker in File path UI validation #10391
Merged
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
patrickmann
approved these changes
Apr 12, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested behavior locally through the UI - looks good.
Test coverage is also OK, since the actual path checking is already being tested in AllowedAuxiliaryPathCheckerTest.
mpfz0r
approved these changes
Apr 12, 2021
danotorrey
pushed a commit
that referenced
this pull request
Apr 13, 2021
…idation (#10391) * Add path check * Return after aux file check * Return after aux file check * Add tests for config validation * Provide more appropriate error message
janheise
pushed a commit
that referenced
this pull request
Apr 21, 2021
…idation (#10391) * Add path check * Return after aux file check * Return after aux file check * Add tests for config validation * Provide more appropriate error message
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
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: