Skip to content

Commit

Permalink
destination: add UriLikeIdentity and server_name (#285)
Browse files Browse the repository at this point in the history
Changes the `TlsIdentity` type in the destination API such that: 

- we add an extra `UriLikeIdentity` identity type that should contain identities that are in URI format (e.g. SPIFFE)
- we add a `server_name` to the `TlsIdentity` type. This allows us to differentiate between an SNI value and a TLS Id value. This is mainly needed because in certain identity systems (SPIFFE/SPIRE) the TLS SAN can be in URI form. A URI cannot be used as a SNI extension in a `ClientHello`, so an alternative SNI value needs to be provided. This brings the need to distinguish between these two concepts. 

For context: 
linkerd/linkerd2-proxy#2506

Signed-off-by: Zahari Dichev <[email protected]>
Co-authored-by: Oliver Gould <[email protected]>
  • Loading branch information
zaharidichev and olix0r authored Jan 5, 2024
1 parent a3c6b13 commit 2da43c5
Show file tree
Hide file tree
Showing 17 changed files with 404 additions and 265 deletions.
572 changes: 340 additions & 232 deletions go/destination/destination.pb.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion go/destination/destination_grpc.pb.go

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

4 changes: 2 additions & 2 deletions go/grpc_route/grpc_route.pb.go

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

4 changes: 2 additions & 2 deletions go/http_route/http_route.pb.go

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

4 changes: 2 additions & 2 deletions go/http_types/http_types.pb.go

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

4 changes: 2 additions & 2 deletions go/identity/identity.pb.go

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

2 changes: 1 addition & 1 deletion go/identity/identity_grpc.pb.go

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

9 changes: 4 additions & 5 deletions go/inbound/inbound.pb.go

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

2 changes: 1 addition & 1 deletion go/inbound/inbound_grpc.pb.go

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

4 changes: 2 additions & 2 deletions go/meta/meta.pb.go

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

4 changes: 2 additions & 2 deletions go/net/net.pb.go

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

9 changes: 4 additions & 5 deletions go/outbound/outbound.pb.go

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

2 changes: 1 addition & 1 deletion go/outbound/outbound_grpc.pb.go

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

4 changes: 2 additions & 2 deletions go/tap/tap.pb.go

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

2 changes: 1 addition & 1 deletion go/tap/tap_grpc.pb.go

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

20 changes: 18 additions & 2 deletions proto/destination.proto
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,19 @@ message WeightedAddr {
AuthorityOverride authority_override = 7;
}

// Which strategy should be used for verifying TLS.
message TlsIdentity {
reserved 2;
reserved "k8s_pod_identity";

oneof strategy { DnsLikeIdentity dns_like_identity = 1; }
oneof strategy {
DnsLikeIdentity dns_like_identity = 1;
UriLikeIdentity uri_like_identity = 3;
}

// The server name of the endpoint. This is the value that needs to be included
// by clients in the ClientHello SNI extension of the TLS handshake when they
// initiate TLS connections to servers.
DnsLikeIdentity server_name = 4;

// Verify the certificate based on the Kubernetes pod identity.
message DnsLikeIdentity {
Expand All @@ -118,6 +125,15 @@ message TlsIdentity {
// {name}.{namespace}.{type}.identity.{control-namespace}.{trust-domain...}
string name = 1;
}

// Verify the certificate based on an URI identity.
message UriLikeIdentity {
// A URI name that encodes workload identity.
//
// For example:
// spiffe://trust-domain/workload-dentifier
string uri = 1;
}
}

message AuthorityOverride { string authority_override = 1; }
Expand Down
21 changes: 19 additions & 2 deletions src/gen/io.linkerd.proxy.destination.rs

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

0 comments on commit 2da43c5

Please sign in to comment.