Skip to content

HDDS-9663. Allow OM to detect client address when using gRPC#5590

Merged
adoroszlai merged 3 commits intoapache:masterfrom
vtutrinov:HDDS-9663-grpc-client-ip-and-host
Nov 18, 2023
Merged

HDDS-9663. Allow OM to detect client address when using gRPC#5590
adoroszlai merged 3 commits intoapache:masterfrom
vtutrinov:HDDS-9663-grpc-client-ip-and-host

Conversation

@vtutrinov
Copy link
Contributor

What changes were proposed in this pull request?

A lot of code pieces in OM proto method handlers use OMClientRequest.preExecute method to define/detect userInfo for consequent ACLs checks. But if the provided client hostname is null (in case of GRPC transport) the user will be replaced by an 'om' one and the consequent ACLs check through a custom authorizer (e.g. Ranger) will fail due to non-existent permission policies for the 'om' user.
So, the PR introduces a new client&server interceptor to send/receive header with the client IP and hostname and uses it in GrpcOmTransport

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-9663

How was this patch tested?

1 unit test to check that userInfo has hostname and IP in case of GRPC transport (ozone-manager)
2 unit tests to check that client and server interceptors set and read client IP and hostname to/from the GRPC request header
Manual test of the expected behavior (the ACLs will be checked for the current user, not for 'om' on committing the key) on cluster with Ranger

@vtutrinov vtutrinov force-pushed the HDDS-9663-grpc-client-ip-and-host branch from d512ca5 to 02fb168 Compare November 14, 2023 12:15
@vtutrinov vtutrinov force-pushed the HDDS-9663-grpc-client-ip-and-host branch from 02fb168 to fea5c15 Compare November 14, 2023 16:01
@adoroszlai adoroszlai changed the title HDDS-9663. om grpc transport - provide client ip and hostname HDDS-9663. Allow OM to detect client address when using gRPC Nov 15, 2023
Copy link
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

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

Thanks @vtutrinov for the patch.

@vtutrinov vtutrinov requested a review from adoroszlai November 15, 2023 08:54
Copy link
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

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

Thanks @vtutrinov for updating the patch, LGTM.

I'll let other reviewers (@kerneltime, @xBis7) take a look before merging it.

@adoroszlai
Copy link
Contributor

@kerneltime would you like to take a look?

@adoroszlai adoroszlai merged commit 7a13895 into apache:master Nov 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants