fmorg-git commented on code in PR #11134:
URL: https://github.com/apache/ozone/pull/11134#discussion_r3912126517
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/s3/security/S3AssumeRoleRequest.java:
##########
@@ -274,13 +284,129 @@ String getSessionPolicy(OzoneManager ozoneManager,
String originalAccessKeyId, S
final Set<OzoneGrant> grants = Strings.isNullOrEmpty(awsIamPolicy) ?
null :
- IamSessionPolicyResolver.resolve(awsIamPolicy, volumeName,
IamSessionPolicyResolver.AuthorizerType.RANGER);
+ resolveGrantsAgainstBucketLinks(
+ IamSessionPolicyResolver.resolve(awsIamPolicy, volumeName,
IamSessionPolicyResolver.AuthorizerType.RANGER),
+ (linkVolume, linkBucket) ->
ozoneManager.resolveBucketLink(Pair.of(linkVolume, linkBucket), true, false));
Review Comment:
> One thing I'm not very sure about is this "false" in
`ozoneManager.resolveBucketLink(Pair.of(linkVolume, linkBucket), true, false))`
>
> For other linked bucket operations, it's "true" when resolve bucket link,
which means the caller must have the READ permission on both the linked bucket,
and target bucket. If we turn this "false" to "true", which means that Role
definition need to include both the linked bucket, and source(target) bucket?
@fmorg-git , could you verify this behavior for linked bucket with Ranger, for
example, using existing bucket allowed operations?
hi @ChenSammi - good question. I tested locally and I believe we do `NOT`
want the `false` to be `true`. Usually, the credential vender Kerberos
identity only has `ASSUME_ROLE` permission in Ranger and the role has the
requisite volume, bucket, key access as necessary. If we turned the `false`
flag to `true`, then the credential vender Kerberos identity would need access
to the linked buckets as well in order to complete the AssumeRole api call,
otherwise they would get AccessDenied from Ranger when the code is resolving
the links. Requiring the credential vender to have this additional access is
unnecessary because all we need is the topology/structure of the bucket links
to generate the session policy.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]