Skip to content

Input source security 26.0.0 backport#14066

Merged
clintropolis merged 3 commits intoapache:26.0.0from
zachjsh:input-source-security-26.0.0-backport
Apr 13, 2023
Merged

Input source security 26.0.0 backport#14066
clintropolis merged 3 commits intoapache:26.0.0from
zachjsh:input-source-security-26.0.0-backport

Conversation

@zachjsh
Copy link
Copy Markdown
Contributor

@zachjsh zachjsh commented Apr 11, 2023

Description

This change backports the following 2 prs: (#14050, #14056)

#14050 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) ]

#14056 fixed a bug where 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.

This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • a release note entry in the PR description.
  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
  • added or updated version, license, or notice information in licenses.yaml
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • added integration tests.
  • been tested in a test Druid cluster.

zachjsh added 2 commits April 11, 2023 15:31
… types (apache#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)
]
`
### 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.
@zachjsh zachjsh marked this pull request as ready for review April 11, 2023 19:37
@clintropolis clintropolis added this to the 26.0 milestone Apr 11, 2023
@zachjsh zachjsh changed the title Input source security 26.0.0 backport Input source security 26.0.0 backport (#14050, #14056) Apr 11, 2023
@zachjsh zachjsh changed the title Input source security 26.0.0 backport (#14050, #14056) Input source security 26.0.0 backport Apr 11, 2023
@clintropolis
Copy link
Copy Markdown
Member

ci failure is unrelated, should be fixed by #14079

@clintropolis clintropolis merged commit 8b8ce58 into apache:26.0.0 Apr 13, 2023
@zachjsh zachjsh deleted the input-source-security-26.0.0-backport branch April 13, 2023 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants