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

Add SPIFFE independent multiple trust domain API. #1923

Closed
wants to merge 9 commits into from
6 changes: 6 additions & 0 deletions kubernetes/customresourcedefinitions.gen.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

469 changes: 265 additions & 204 deletions mesh/v1alpha1/config.pb.go

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions mesh/v1alpha1/config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,13 @@ message MeshConfig {
// The certificate is retrieved from the endpoint.
string spiffe_bundle_url = 2;
}

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

Choose a reason for hiding this comment

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

Suggested change
// Optional. Specify the list of trust domains to which this certificate data belongs.
// Optional. Specify the list of trust domains to which this root of trust belongs.

// If set, they are used for this root CA. Otherwise, this root CA is used for default trust domain
// and its aliases.
Copy link
Contributor

Choose a reason for hiding this comment

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

This becomes error prone now. If the user forgets to specify trust_domains, the external CAs will be able to impersonate the local CA. I think in the long term, we should mandate this field to be non-empty (ie, if it's empty, the CertificateData is invalid). How about if users want to use this to configure extra roots for the local trust domains. they should set "LOCAL" as the trust domain? We need to think about the backward compatibility, though. Istiod can log warnings in 1.11 when trust_domains is unset, and we mandate it in 1.12.

// Note that we can have multiple certificate data for a same trust_domain.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Note that we can have multiple certificate data for a same trust_domain.
// Note that we can have multiple roots of trust for a same trust domain.

// In that case, certificates with a same trust domain will be merged and used together to verify peer certificates.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// In that case, certificates with a same trust domain will be merged and used together to verify peer certificates.
// In that case, root certificates associated with the same trust domain will be merged and used together to verify peer certificates from that trust domain.

repeated string trust_domains = 3;
Copy link
Member

Choose a reason for hiding this comment

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

How does this relate to trust domain defined above?

Copy link
Member Author

Choose a reason for hiding this comment

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

this is associated with the "additional" root ca (CertificateData) to be used to validate incoming peer certs. In contrast, the trust domain above is used for singing certs with this cluster's root ca (e.g. istio-ca-secret).

Copy link
Member

Choose a reason for hiding this comment

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

I see. May be add a comment related to it? I found it confusing so asked.

Copy link
Member

@linsun linsun Apr 2, 2021

Choose a reason for hiding this comment

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

+1 very confusing. Can we clarify this? Even in the names, such as cluster_trust_domains or mesh_trust_domains?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think this is that confusing since this is a field of CertificateData which is not in the top-level MeshConfig. But I agree that this is a bit confusing. @costinm @howardjohn thoughts?

Choose a reason for hiding this comment

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

Is there a corresponding PR in the Istio Repo yet to handle Certificates for multiple TrustDomains? As of now, it is assumed that all these trustAnchors are intended for the configured mesh TrustDomain

Copy link
Member

Choose a reason for hiding this comment

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

why is the trust_domains plural, does that means the certificate_data can belong to multi trust domains?

Copy link
Member Author

@mathetake mathetake Apr 20, 2021

Choose a reason for hiding this comment

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

yes. See discussion here: #1923 (comment) for example, it can be used for aliasing trust domains.

}

// The extra root certificates for workload-to-workload communication.
Expand Down
10 changes: 10 additions & 0 deletions mesh/v1alpha1/istio.mesh.v1alpha1.gen.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions mesh/v1alpha1/istio.mesh.v1alpha1.pb.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

111 changes: 59 additions & 52 deletions python/istio_api/mesh/v1alpha1/config_pb2.py

Large diffs are not rendered by default.

19 changes: 13 additions & 6 deletions python/istio_api/security/v1beta1/authorization_policy_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions security/v1beta1/authorization_policy.gen.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading