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

Adding broker level config for disabling Pinot queries with Groovy #8159

Merged
merged 6 commits into from Feb 10, 2022

Conversation

timsants
Copy link
Contributor

@timsants timsants commented Feb 7, 2022

Description

This change adds a broker config for disabling Groovy in Pinot queries as it is a security risk. See Github issue #7966. By default, Groovy is allowed for backwards compatibility to not break existing use cases which currently use Groovy.

Testing

Added unit tests and tested config with quick-start config override.

Upgrade Notes

Does this PR prevent a zero down-time upgrade? (Assume upgrade order: Controller, Broker, Server, Minion)

  • Yes (Please label as backward-incompat, and complete the section below on Release Notes)

Does this PR fix a zero-downtime upgrade introduced earlier?

  • Yes (Please label this as backward-incompat, and complete the section below on Release Notes)

Does this PR otherwise need attention when creating release notes? Things to consider:

  • Yes (Please label this PR as release-notes and complete the section on Release Notes)

Release Notes

Introduced new config for disabling Groovy in queries: pinot.broker.disable.query.groovy. If not defined, defaults to false.

@timsants timsants marked this pull request as ready for review February 7, 2022 23:49
Copy link
Contributor

@Jackie-Jiang Jackie-Jiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM otherwise

@codecov-commenter
Copy link

codecov-commenter commented Feb 8, 2022

Codecov Report

Merging #8159 (75ef030) into master (6844cb3) will increase coverage by 39.53%.
The diff coverage is 66.66%.

Impacted file tree graph

@@              Coverage Diff              @@
##             master    #8159       +/-   ##
=============================================
+ Coverage     30.67%   70.20%   +39.53%     
- Complexity        0     4302     +4302     
=============================================
  Files          1612     1623       +11     
  Lines         83962    84350      +388     
  Branches      12602    12652       +50     
=============================================
+ Hits          25754    59217    +33463     
+ Misses        55919    21038    -34881     
- Partials       2289     4095     +1806     
Flag Coverage Δ
integration1 ?
integration2 27.68% <2.77%> (+0.12%) ⬆️
unittests1 67.88% <ø> (?)
unittests2 14.19% <66.66%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...r/transform/function/TransformFunctionFactory.java 82.72% <ø> (+2.72%) ⬆️
...va/org/apache/pinot/spi/utils/CommonConstants.java 23.63% <ø> (+23.63%) ⬆️
...roker/requesthandler/BaseBrokerRequestHandler.java 70.70% <66.66%> (+6.26%) ⬆️
...pinot/minion/exception/TaskCancelledException.java 0.00% <0.00%> (-100.00%) ⬇️
...nverttorawindex/ConvertToRawIndexTaskExecutor.java 0.00% <0.00%> (-100.00%) ⬇️
...e/pinot/common/minion/MergeRollupTaskMetadata.java 0.00% <0.00%> (-94.74%) ⬇️
...plugin/segmentuploader/SegmentUploaderDefault.java 0.00% <0.00%> (-87.10%) ⬇️
.../transform/function/MapValueTransformFunction.java 0.00% <0.00%> (-85.30%) ⬇️
...ot/common/messages/RoutingTableRebuildMessage.java 0.00% <0.00%> (-81.82%) ⬇️
...data/manager/realtime/DefaultSegmentCommitter.java 0.00% <0.00%> (-80.00%) ⬇️
... and 1167 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6844cb3...75ef030. Read the comment docs.

@amrishlal
Copy link
Contributor

This will scan each and every statement when DISABLE_GRROVY option is enabled. I am wondering if there is a more efficient option like doing a check while invoking groovy function whether it is disabled for SQL statements or not? I don't think there is an issue with groovy function being called during ingestion so that can be ignored.

@Jackie-Jiang
Copy link
Contributor

@amrishlal It is done on a per query basis on the broker side, which should be fine. We already have multiple similar operations on the broker (e.g. fixing column name, override hll etc,), and so far no obvious performance hit, so I wouldn't worry too much about that.

@Jackie-Jiang Jackie-Jiang merged commit 58f74ce into apache:master Feb 10, 2022
@Jackie-Jiang Jackie-Jiang deleted the groovy_config branch February 10, 2022 23:40
@Jackie-Jiang Jackie-Jiang added the release-notes Referenced by PRs that need attention when compiling the next release notes label Feb 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes Referenced by PRs that need attention when compiling the next release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants