Skip to content

Conversation

@irisdingbj
Copy link
Member

@irisdingbj irisdingbj commented Sep 8, 2021

If istio acting as RA, user can specify signers for the CSR, We need a way to let user specify root cert for each of the signers. Detailed discussion can be found in: istio/istio#34486

This also opens doors for us to define signer to replace kubernetes.io/legacy-unknown for istiod certs, a related proposal is here

Another related proposal is here: https://docs.google.com/document/d/1rxTSLuepcE_OJHj4C23RMJcgyIZzlBI-GqO8Y37SPko/edit#heading=h.5l3l3tiit0zd , see Distribution of root of trust for signers section

@google-cla google-cla bot added the cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. label Sep 8, 2021
@istio-testing istio-testing added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Sep 8, 2021
@irisdingbj irisdingbj added the release-notes-none Indicates a PR that does not require release notes. label Sep 8, 2021
@irisdingbj
Copy link
Member Author

/test release-notes_api

@rveerama1
Copy link
Member

I think you have to run "make proto-commit" to update proto.lock with new changes.

@irisdingbj
Copy link
Member Author

@myidpt @costinm @howardjohn @shankgan Please take a look at this PR to see whether it is on the right direction. Thanks!

@istio-testing istio-testing added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Sep 13, 2021
@irisdingbj
Copy link
Member Author

@myidpt @shankgan looking forward to your comments for this!

@costinm
Copy link
Contributor

costinm commented Sep 18, 2021 via email

@costinm
Copy link
Contributor

costinm commented Sep 18, 2021 via email

@irisdingbj
Copy link
Member Author

@costinm Thanks for the review!

The reason to add this into meshConfig instead of ProxyConfig is because

  1. istiod need to validate the returned certs chain which are signed from different signers against the root certs specified in meshConfig
  2. The cert for istiod itself can be signed via the specified signer as well.

I also went through the related fileds in meshConfig and have not found a good match for this task: sepcify root certs for different signers:

  1. message CertificateData {
    oneof certificate_data {
    string pem = 1;
    SPIFFE_Trust_Domain_and_Bundle.md#the-spiffe-trust-domain-and-bundle
    string spiffe_bundle_url = 2;
    }
    }

this can not be used as it lack of places to specify signer name.

  1. message CA {
    // REQUIRED. Address of the CA server implementing the Istio CA gRPC API.
    string address = 1;
    istio.networking.v1alpha3.ClientTLSSettings tls_settings = 2;
    google.protobuf.Duration request_timeout = 3;
    bool istiod_side = 4;
    }
    this can not be used as address is a required filed but we do no need this.

  2. message Certificate {
    string secret_name = 1;
    repeated string dns_names = 2;
    }
    this can not be used as it will use built-in signers and have no place to define signers.

@howardjohn
Copy link
Member

If we are going to move forward with #1923 we may want consistency there. @mathetake @lizan is there still interest in that API?

If so, it may make sense to add two fields there: "trust_domains" for the use case in 1923 and "signers" for the use case in 1923.

@mathetake
Copy link
Member

oh yeah we are still interested in 1923 so I would really appreciate it if we could leverage the API introduced here (trust_domains field).

@istio-testing istio-testing added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Sep 29, 2021
@irisdingbj
Copy link
Member Author

@howardjohn @shankgan PTAL to see the latest change which is reusing the certificate_data filed. @mathetake PTAL to see whether the adding for trust_domains is approriate or you want to take care of it in a separate PR.

Thanks!

Copy link
Member

@mathetake mathetake left a comment

Choose a reason for hiding this comment

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

Thanks LGTM from me! (though I'm not sure if I can finish the multiple trust domains impl part for 1.12 as I am going into vacation for two weeks beginning the next week).

}
// Optional. Specify the kubernetes signers to which this certificate data belongs to
// when Istiod is acting as RA(registration authority)
// If set, they are used for these signers. Otherwise, this root CA is used for default signer.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// If set, they are used for these signers. Otherwise, this root CA is used for default signer.
// If set, they are used for these signers. Otherwise, this root CA is used for all signers.

This enables a few things...:

  • Backwards compatibility preserved
  • You can opt into allowing 2 different signers to trust each other. This is critical for a migration between CAs

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

// The certificate is retrieved from the endpoint.
string spiffe_bundle_url = 2;
}
// Optional. Specify the kubernetes signers to which this certificate data belongs to
Copy link

@shankgan shankgan Sep 30, 2021

Choose a reason for hiding this comment

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

nit: "//Optional. Specify the kubernetes signers (External CA) that use this CA certificate" - think this sounds better

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

// If set, they are used for these signers. Otherwise, this root CA is used for default signer.
repeated string cert_signers = 3;

// Optional. Specify the list of trust domains to which this certificate data belongs.
Copy link

@shankgan shankgan Sep 30, 2021

Choose a reason for hiding this comment

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

nit: could we replace the word certificate with trustAnchor in all the comments? This can be done in a later PR if needed.This entire field is used for CA certificates, that are used as trustAnchors within the mesh. The use of the word "certificate" is ambiguous IMO.

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

@istio-testing istio-testing added the needs-rebase Indicates a PR needs to be rebased before being merged label Oct 2, 2021
Copy link
Member

@howardjohn howardjohn left a comment

Choose a reason for hiding this comment

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

A few small comments to address but overall lgtm

@howardjohn howardjohn added the do-not-merge/hold Block automatic merging of a PR. label Oct 4, 2021
@istio-testing istio-testing added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed needs-rebase Indicates a PR needs to be rebased before being merged size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 11, 2021
@irisdingbj
Copy link
Member Author

A few small comments to address but overall lgtm

Thanks! I addressed the comments and removed the on-hold label to get it in. Glad to address new comments in following up PR if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. release-notes-none Indicates a PR that does not require release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants