Skip to content

Conversation

@duongkame
Copy link
Contributor

What changes were proposed in this pull request?

HDDS-7830 implements secret key APIs in SCMSecurityProtocol, which for now doesn't enforce authorization (any authenticated principal can call the API).

For secret key APIs, we want to limit the access to Ozone principals only, aka, Datanode and OM. The APIs should be moved to a separate protocol to enforce authorization separately.

What is the link to the Apache JIRA

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

How was this patch tested?

Integration tests.

@duongkame duongkame marked this pull request as ready for review April 20, 2023 21:02
Copy link
Contributor

@kerneltime kerneltime left a comment

Choose a reason for hiding this comment

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

Done with 1/4th of the code review, will wrap this up tomorrow.

Copy link
Contributor

Choose a reason for hiding this comment

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

Why this todo?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This config key is used in a lot of places (more than 25 usages), I want to avoid including those changes in this PR. Filed a ticket: HDDS-8540

Copy link
Contributor

Choose a reason for hiding this comment

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

No ProtocolInfo annotation for this protocol?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's a client-side protocol interface, and doesn't need a ProtocolInfo.

@duongkame duongkame force-pushed the HDDS-8164 branch 2 times, most recently from eb3fdcd to 91d2903 Compare May 4, 2023 17:59
@umamaheswararao
Copy link
Contributor

@kerneltime do you have further comments?
@ChenSammi and @fapifta do you want to take a look at it?

Copy link
Contributor

@kerneltime kerneltime left a comment

Choose a reason for hiding this comment

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

So far looks good, will re-look post rebase

@duongkame duongkame force-pushed the HDDS-7733-Symmetric-Tokens branch from 783c90f to ba51dba Compare May 10, 2023 05:27
Copy link
Contributor

@fapifta fapifta left a comment

Choose a reason for hiding this comment

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

Hi @duongkame thank you for your work on this one, so far I found three small things, and in general the code looks good, though there are some parts I would like to give one more review tomorrow.

NOT_A_PRIMARY_SCM,
SECRET_KEY_NOT_ENABLED,
SECRET_KEY_NOT_INITIALIZED
NOT_A_PRIMARY_SCM
Copy link
Contributor

Choose a reason for hiding this comment

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

This error code seems to be only checked but it is not thrown... Do we still need it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks like SCM never throws that error code. It can be deleted I guess, but we should do that on master.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ahh... I see now...
Sorry, I thought it is newly added here, but it is just a punctuation change in the line... Ok, please ignore this earlier comment for this PR.

@kerneltime kerneltime requested a review from jojochuang May 11, 2023 21:34
@jojochuang
Copy link
Contributor

jojochuang commented May 12, 2023

PR makes sense to me. Will this work with old clients?
Also there needs to be a user doc for setting up a secure (properly authorized) system.

@duongkame
Copy link
Contributor Author

Thanks for looking at this, @jojochuang

Will this work with old clients?

Fortunately, secret key APIs don't have old clients to deal with. The APIs are introduced in a feature branch that is not merged to master yet.

Also there needs to be a user doc for setting up a secure (properly authorized) system.

Yes, we need something like this. I suppose a doc of config changes is also a part of the process to merge the feature branch to master.

@fapifta
Copy link
Contributor

fapifta commented May 12, 2023

@jojochuang as this will be in internal protocol, that is not used by the clients, and as we do not support rolling upgrade, there should not be compatibility problems with it.

@duongkame thank you for your patience, I took a second look, I think we are good to go.
+1

@umamaheswararao
Copy link
Contributor

could you approve the pr?

@jojochuang jojochuang merged commit 2f0d930 into apache:HDDS-7733-Symmetric-Tokens May 12, 2023
@jojochuang
Copy link
Contributor

Merged. Thanks all for the review and offering the patch!

duongkame added a commit to duongkame/ozone that referenced this pull request Jun 8, 2023
duongkame added a commit that referenced this pull request Jun 8, 2023
errose28 added a commit to errose28/ozone that referenced this pull request Jun 10, 2023
* master: (73 commits)
  HDDS-8587. Test that CertificateClient can store multiple rootCA certificates (apache#4852)
  HDDS-8801. ReplicationManager: Add metric to count how often replication is throttled (apache#4864)
  HDDS-8477. Unit test for Snapdiff using tombstone entries (apache#4678)
  HDDS-7507. [Snapshot] Implement List Snapshot API Pagination (apache#4065) (apache#4861)
  HDDS-8373. Document that setquota doesn't accept decimals (apache#4856)
  HDDS-8779. Recon - Expose flag for enable/disable of heatmap. (apache#4845)
  HDDS-8677. Ozone admin OM CLI command for block tokens (apache#4760)
  HDDS-8164. Authorize secret key APIs (apache#4597)
  HDDS-7945. Integrate secret keys to SCM snapshot (apache#4549)
  HDDS-8003. E2E integration test cases for block tokens (apache#4547)
  HDDS-7831. Use symmetric secret key to sign and verify token (apache#4417)
  HDDS-7830. SCM API for OM and Datanode to get secret keys (apache#4345)
  HDDS-7734. Implement symmetric SecretKeys lifescycle management in SCM (apache#4194)
  HDDS-8679. Add dedicated, configurable thread pool for OM gRPC server (apache#4771)
  HDDS-8790. Split EC acceptance tests (apache#4855)
  HDDS-8714. TestScmHAFinalization: mark testFinalizationWithRestart as flaky, enable other test cases
  HDDS-8787. Reduce ozone sh calls in robot tests (apache#4854)
  HDDS-8774. Log allocation stack trace for leaked CodecBuffer (apache#4840)
  HDDS-8729. Add metric for count of blocks pending deletion on datanode (apache#4800)
  HDDS-8780. Leak of ManagedChannel in HASecurityUtils (apache#4850)
  ...
errose28 added a commit to errose28/ozone that referenced this pull request Jun 10, 2023
* tmp-dir-refactor: (73 commits)
  HDDS-8587. Test that CertificateClient can store multiple rootCA certificates (apache#4852)
  HDDS-8801. ReplicationManager: Add metric to count how often replication is throttled (apache#4864)
  HDDS-8477. Unit test for Snapdiff using tombstone entries (apache#4678)
  HDDS-7507. [Snapshot] Implement List Snapshot API Pagination (apache#4065) (apache#4861)
  HDDS-8373. Document that setquota doesn't accept decimals (apache#4856)
  HDDS-8779. Recon - Expose flag for enable/disable of heatmap. (apache#4845)
  HDDS-8677. Ozone admin OM CLI command for block tokens (apache#4760)
  HDDS-8164. Authorize secret key APIs (apache#4597)
  HDDS-7945. Integrate secret keys to SCM snapshot (apache#4549)
  HDDS-8003. E2E integration test cases for block tokens (apache#4547)
  HDDS-7831. Use symmetric secret key to sign and verify token (apache#4417)
  HDDS-7830. SCM API for OM and Datanode to get secret keys (apache#4345)
  HDDS-7734. Implement symmetric SecretKeys lifescycle management in SCM (apache#4194)
  HDDS-8679. Add dedicated, configurable thread pool for OM gRPC server (apache#4771)
  HDDS-8790. Split EC acceptance tests (apache#4855)
  HDDS-8714. TestScmHAFinalization: mark testFinalizationWithRestart as flaky, enable other test cases
  HDDS-8787. Reduce ozone sh calls in robot tests (apache#4854)
  HDDS-8774. Log allocation stack trace for leaked CodecBuffer (apache#4840)
  HDDS-8729. Add metric for count of blocks pending deletion on datanode (apache#4800)
  HDDS-8780. Leak of ManagedChannel in HASecurityUtils (apache#4850)
  ...
@duongkame duongkame deleted the HDDS-8164 branch April 12, 2025 00:10
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.

5 participants