Input source security feature should work for MSQ tasks#14056
Input source security feature should work for MSQ tasks#14056zachjsh merged 2 commits intoapache:masterfrom
Conversation
Previously msq controller and worker tasks did not have implementations for the `getInputSourceResources()` method. This causes the submission of these tasks to fail if the following auth config is enabled: `druid.auth.enableInputSourceSecurity=true` Added implementations of for these tasks that return an empty set of input sources. This means that for these task types, if `druid.auth.enableInputSourceSecurity=true` config is used, the input source types will be properly computed and authorized in the SQL layer, but not if the equivalent controller / worker tasks are submitted to the task endpoint.
| @Override | ||
| public Set<ResourceAction> getInputSourceResources() | ||
| { | ||
| // the input sources are properly computed in the SQL / calcite layer, but not in the native MSQ task here. |
There was a problem hiding this comment.
Actually, thinking about it, should we remove the default implementation that throws an exception in the Task interface? Making the method abstract would force developers to think about the input security model for our different task types from the ground up instead of fixing things because of an unsupported exception at runtime when the feature is enabled. Thoughts?
There was a problem hiding this comment.
This only throws an exception by default if a the task is used with the inputSourceType security feature enabled. I think better to default fail than to allow the the usage of the input source unsecured by default. What do you think?
There was a problem hiding this comment.
Thanks for clarifying! One more reason why we cannot remove the default implementation is it's a method on a common interface and can break compilation because things can be loaded from custom extensions. So I think having the default behavior is good 👍
|
Should we backport this change and #14050 to the 26.0 release? The other input source security changes are in the 26.0 release branch |
### Description Previously msq controller and worker tasks did not have implementations for the `getInputSourceResources()` method. This causes the submission of these tasks to fail if the following auth config is enabled: `druid.auth.enableInputSourceSecurity=true` Added implementations of this method for these tasks that return an empty set of input sources. This means that for these task types, if `druid.auth.enableInputSourceSecurity=true` config is used, the input source types will be properly computed and authorized in the SQL layer, but not if the equivalent controller / worker tasks are submitted to the task endpoint.
* Input source security sql layer can handle input source with multiple types (#14050) ### Description This change allows for input sources used during MSQ ingestion to be authorized for multiple input source types, instead of just 1. Such an input source that allows for multiple types is the CombiningInputSource. Also fixed bug that caused some input source specific functions to be authorized against the permissions ` [ new ResourceAction(new Resource(ResourceType.EXTERNAL, ResourceType.EXTERNAL), Action.READ), new ResourceAction(new Resource(ResourceType.EXTERNAL, {input_source_type}), Action.READ) ] ` when the inputSource based authorization feature is enabled, when it should instead be authorized against ` [ new ResourceAction(new Resource(ResourceType.EXTERNAL, {input_source_type}), Action.READ) ] ` * Input source security feature should work for MSQ tasks (#14056) ### Description Previously msq controller and worker tasks did not have implementations for the `getInputSourceResources()` method. This causes the submission of these tasks to fail if the following auth config is enabled: `druid.auth.enableInputSourceSecurity=true` Added implementations of this method for these tasks that return an empty set of input sources. This means that for these task types, if `druid.auth.enableInputSourceSecurity=true` config is used, the input source types will be properly computed and authorized in the SQL layer, but not if the equivalent controller / worker tasks are submitted to the task endpoint.
Description
Previously msq controller and worker tasks did not have implementations for the
getInputSourceResources()method. This causes the submission of these tasks to fail if the following auth config is enabled:druid.auth.enableInputSourceSecurity=trueAdded implementations of this method for these tasks that return an empty set of input sources. This means that for these task types, if
druid.auth.enableInputSourceSecurity=trueconfig is used, the input source types will be properly computed and authorized in the SQL layer, but not if the equivalent controller / worker tasks are submitted to the task endpoint.This PR has: