Skip to content
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

HDDS-4763. Owner field of S3AUTHINFO type delegation token should be validated #1871

Merged
merged 3 commits into from
Feb 2, 2021

Conversation

elek
Copy link
Member

@elek elek commented Feb 1, 2021

What changes were proposed in this pull request?

Adding a check for S3AUTH token validation.

Please see the jira for the motivation.

What is the link to the Apache JIRA

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

How was this patch tested?

Test method is explained in the Jira (with the code to test it).

@elek elek requested a review from xiaoyuyao February 1, 2021 18:12
throw new InvalidToken(
"Owner is missing from the S3 auth token");
}
if (!identifier.getOwner().toString().equals(identifier.getAwsAccessId())) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks @elek for working on this. I have one question about the awsaccessId from identifier or owner, they can all be modified by the attacker as well. What we need to check is compare awsaccessId from the identifier.stringtosign using s3 signatureparser (after verify the secret) with the one from the owner/awsid from the identifier.

Copy link
Member Author

Choose a reason for hiding this comment

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

awsaccessId is used as a primary key to find the stored secret in the rockdb. If you use any wrong accessId the signature validation will be failed. If the string2sign contains reference to a different accessId, the validation will be failed as the signature won't be matched.

(At least this is my understanding, but let me know if I missed something...)

Copy link
Contributor

Choose a reason for hiding this comment

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

Make sense to me. I further check the hadoop rpc code and the UGI of token user is taken from the owner field of the identifier. Because S3 token identifier is not protected with a token signature like Hadoop delegation token, the proposed check of owner against awsaccessid is the right fix.

Copy link
Contributor

@xiaoyuyao xiaoyuyao left a comment

Choose a reason for hiding this comment

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

One question added inline. Otherwise, LGTM.

@xiaoyuyao xiaoyuyao merged commit 60e0787 into apache:master Feb 2, 2021
jojochuang pushed a commit to jojochuang/ozone that referenced this pull request Mar 11, 2021
…validated (apache#1871)

Change-Id: I6085e579dec1a43471411f7ccd735e5a03bc93bd
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