Skip to content

client/pkg/transport: Support multiple values for allowed client and peer TLS identities#13460

Closed
LINKIWI wants to merge 4 commits intoetcd-io:mainfrom
LINKIWI:tls-multiple-peers
Closed

client/pkg/transport: Support multiple values for allowed client and peer TLS identities#13460
LINKIWI wants to merge 4 commits intoetcd-io:mainfrom
LINKIWI:tls-multiple-peers

Conversation

@LINKIWI
Copy link

@LINKIWI LINKIWI commented Nov 5, 2021

This change proposes allowing multiple CNs or SAN DNS names for client and peer TLS verification. This is useful for use cases that depend on etcd to enforce an ACL, but where there are multiple different clients (with different certificates and thus different identities) permitted to connect to the cluster.

The proposal is to use a comma as the delimiting character for multiple allowed identities. The peer verification routine allows the handshake to proceed as long as the peer identity matches one of the supplied allowed identities.

Note that in f1500fb I changed the type of AllowedCN and AllowedHostname in TLSInfo to a []string to accommodate this, and pulled out the comma-separated list parsing to the command line parser. However, this breaks backwards compatibility for embedded etcd users. If desired, I can leave AllowedCN and AllowedHostname as strings (to retain backwards compatibility) and instead do a strings.Split in the verifyCertificate routine itself.

Tangentially related change: #13445.

Closes #11728.

@mitake
Copy link
Contributor

mitake commented Dec 13, 2021

@LINKIWI I think the change seems to be reasonable, but could you share some additional motivations for doing this for peer connection? It’s still not clear for me so I want to understand concrete use cases.

@LINKIWI
Copy link
Author

LINKIWI commented Dec 13, 2021

Hi @mitake the primary motivation for this change (in general) is to allow etcd to enforce server ACLs with multi-valued identities. For peer verification/intra-cluster traffic in particular, using CN validation as an example, this would allow identity enforcement for connections of all other peer members, all of whom have unique CNs.

It is common for each node within the same cluster to have unique CNs (usually the machine hostname). Currently, I don't think there exists a mechanism to support such a peer ACL natively in etcd without this patch. (Another commonly implemented approach is supporting prefix or regular expression matches)

@stale
Copy link

stale bot commented Mar 15, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 21 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Mar 15, 2022
@riyazcom riyazcom mentioned this pull request Apr 7, 2022
28 tasks
@stale stale bot closed this Apr 13, 2022
badouralix added a commit to DataDog/etcd that referenced this pull request Sep 5, 2023
…peer TLS identities

Cherry-pick etcd-io#13460 manually because
the remote repository has been deleted
badouralix added a commit to DataDog/etcd that referenced this pull request Sep 20, 2023
…peer TLS identities

Cherry-pick etcd-io#13460 manually because
the remote repository has been deleted

Signed-off-by: Ayaz Badouraly <ayaz.badouraly@datadoghq.com>
nyodas pushed a commit to DataDog/etcd that referenced this pull request Jun 10, 2024
…peer TLS identities

Cherry-pick etcd-io#13460 manually because
the remote repository has been deleted

Signed-off-by: Ayaz Badouraly <ayaz.badouraly@datadoghq.com>
nyodas pushed a commit to DataDog/etcd that referenced this pull request Jul 16, 2024
…peer TLS identities

Cherry-pick etcd-io#13460 manually because
the remote repository has been deleted

Signed-off-by: Ayaz Badouraly <ayaz.badouraly@datadoghq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

allowed-hostname only supports a single hostname

2 participants