Skip to content
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
merged 5 commits into from
Apr 12, 2021

Conversation

danotorrey
Copy link
Contributor

@danotorrey danotorrey commented Apr 8, 2021

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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

@danotorrey danotorrey marked this pull request as ready for review April 9, 2021 13:01
Copy link
Contributor

@patrickmann patrickmann left a 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 mpfz0r merged commit c493d33 into master Apr 12, 2021
@mpfz0r mpfz0r deleted the cloud/issue-830 branch April 12, 2021 14:53
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
mpfz0r pushed a commit that referenced this pull request Apr 13, 2021
…idation (#10391) (#10425)

* 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants