-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Ensure the dashboard zip is sane #6921
Conversation
This adds a check that all files from the dashboard zip file are pointing to the right target, and don't override other configs.
libbeat/dashboards/importer.go
Outdated
return err | ||
} | ||
if strings.HasPrefix(filepath.ToSlash(relPath), "../") { | ||
return fmt.Errorf("Zip file contains files outside of directory target: %s", relPath) |
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.
s/directory target/target directory/ ?
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.
LGTM. A test with an invalid zip would have been nice.
If I may I'd recommend using |
This uses the same approach and code as the Kibana dashboards loader. Fixes elastic#6921.
* Ensure the dashboard zip is sane This adds a check that all files from the dashboard zip file are pointing to the right target, and don't override other configs. * changelog * addressed comment (cherry picked from commit a34c9eb)
* Ensure the dashboard zip is sane This adds a check that all files from the dashboard zip file are pointing to the right target, and don't override other configs. * changelog * addressed comment (cherry picked from commit a34c9eb)
This uses the same approach and code as the Kibana dashboards loader. Fixes #6921.
This uses the same approach and code as the Kibana dashboards loader. Fixes elastic#6921. (cherry picked from commit a7c9062)
* Ensure the dashboard zip is sane This adds a check that all files from the dashboard zip file are pointing to the right target, and don't override other configs. * changelog * addressed comment (cherry picked from commit 028a3fd)
…#6996) This uses the same approach and code as the Kibana dashboards loader. Fixes elastic#6921. (cherry picked from commit b514dd1)
…astic#6995) * Ensure the dashboard zip is sane (elastic#6921) * Ensure the dashboard zip is sane This adds a check that all files from the dashboard zip file are pointing to the right target, and don't override other configs. * changelog * addressed comment (cherry picked from commit 028a3fd) * cleanup changelog
This adds a check that all files from the dashboard zip file
are pointing to the right target, and don't override other configs.