-
Notifications
You must be signed in to change notification settings - Fork 2.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
feat(search): search access controls #9892
Conversation
8d3ea31
to
3614b9e
Compare
3614b9e
to
31351a8
Compare
31351a8
to
0522e7e
Compare
ef56331
to
7df1de0
Compare
7df1de0
to
2d5bc0c
Compare
2d5bc0c
to
af4df38
Compare
af4df38
to
718813a
Compare
Note that I've found a critical limitation in this implementation. I've introduced a limit to the number owners by making the owner a nested field. This should be addressed by making the field the owner type instead. This reversal puts the limit on the max number of ownership types instead of the owner identities. |
718813a
to
f6cbf9a
Compare
Fixed the owner urn limitation by using this structure "ownerTypes": {
"urn:li:ownershipType:__system__none": [
"urn:li:corpuser:jdoe",
"urn:li:corpuser:datahub"
],
"urn:li:ownershipType:__system__technical_owner": [
"urn:li:corpuser:myuser"
],
"urn:li:ownershipType:__system__business_owner": [
"urn:li:corpuser:myuser"
]
}, |
metadata-io/src/main/java/com/linkedin/metadata/search/LineageSearchService.java
Outdated
Show resolved
Hide resolved
TODO: * cache keys - need to be context aware to prevent incorrect results * ownership migration upgrade step * complete unit tests for access controls * restricted entity hydration and graphql response (chris)
TODO: * ownership migration upgrade step * complete unit tests for access controls * comprehensive api coveration graphql, openapi, restli * restricted entity hydration and graphql response
a8e3c6d
to
c47db24
Compare
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.
this is looking awesome. but man there's lots of code haha so it's kind of hard to get a very solid review. I left a few comments on higher level stuff but in general looking good.
datahub-upgrade/src/main/java/com/linkedin/datahub/upgrade/UpgradeCli.java
Outdated
Show resolved
Hide resolved
...ade/src/main/java/com/linkedin/datahub/upgrade/system/ownershiptypes/OwnershipTypesStep.java
Show resolved
Hide resolved
metadata-io/src/main/java/com/linkedin/metadata/search/LineageSearchService.java
Outdated
Show resolved
Hide resolved
metadata-io/src/main/java/com/linkedin/metadata/search/elasticsearch/query/ESBrowseDAO.java
Outdated
Show resolved
Hide resolved
metadata-io/src/main/java/com/linkedin/metadata/search/utils/ESAccessControlUtil.java
Outdated
Show resolved
Hide resolved
metadata-models/src/main/pegasus/com/linkedin/common/Ownership.pdl
Outdated
Show resolved
Hide resolved
metadata-service/configuration/src/main/resources/application.yml
Outdated
Show resolved
Hide resolved
metadata-io/src/main/java/com/linkedin/metadata/search/utils/ESAccessControlUtil.java
Outdated
Show resolved
Hide resolved
datahub-upgrade/src/main/java/com/linkedin/datahub/upgrade/UpgradeCli.java
Outdated
Show resolved
Hide resolved
...ade/src/main/java/com/linkedin/datahub/upgrade/system/ownershiptypes/OwnershipTypesStep.java
Show resolved
Hide resolved
metadata-io/src/main/java/com/linkedin/metadata/search/utils/ESAccessControlUtil.java
Outdated
Show resolved
Hide resolved
metadata-io/src/main/java/com/linkedin/metadata/search/utils/ESAccessControlUtil.java
Outdated
Show resolved
Hide resolved
…chFlags (#9939) Co-authored-by: Chris Collins <chriscollins3456@gmail.com>
Co-authored-by: Chris Collins <chriscollins3456@gmail.com>
Introduces controls around search results based on policy privileges which can filter or restrict the data on the entities being returned from search operations.
Policy Logic:
VIEW_ENTITY
privilegeESAccessControlUtil
class.OperationContext:
OperationContext
which wraps several layers of context including the session and system authentication contexts. Additionally it includes all information needed to build search query filters from policies for the user.OperationContext
also include the logic to compute a unique context id which should be added to all cache keys to ensure the cache doesn't bypass the intended filtering/restrictions.OperationContext
allows control over privilege escalation. The default implementation here follows the legacy mode where a user session is allowed to escalate to a system level privilege as needed. In the future this could be restricted to only allow escalation based on policy.SearchFlags/SearchEntity:
SearchEntity
object within theSearchResult
objects now includes a list of restricted aspects. The initial implementation only includes the key aspect which indicates that the entity should be fully restricted. In the future this might be a subset of the aspects for the entity.Data Models:
FieldType
forMAP_ARRAY
for maps with string keys and multiple values (without having to be string encoded)MAP_ARRAY
fieldsTODO:
Checklist