Skip to content

transitengineapi: mTLS with client authorization by workloadSecret #1348

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

Merged
merged 2 commits into from
Apr 14, 2025

Conversation

jmxnzo
Copy link
Contributor

@jmxnzo jmxnzo commented Apr 7, 2025

This PR introduces mTLS to the transit engine API to secure connections based on Contrast mesh certs.

  • The client is only authorized to the transit key set of the workloadSecretID in the received meshCert extension. As prior we handle the <name> parameter of existing Vault implementations as our workloadSecretID.

  • On initialization the transit engine API derives a private ecdsa key. For each incoming TLS connection of the transit engine API, the coordinator issues itself a fresh mesh cert for this private key of the transit engine API, which is therefore valid for the current state.

The logging mechanism introduced in #1345 and the new authorizationMiddleware is bypassed during testing using a mock transitengine API.

@jmxnzo jmxnzo added the no changelog PRs not listed in the release notes label Apr 7, 2025
@jmxnzo jmxnzo force-pushed the meshapi/workloadSecretExt branch from ffd1e49 to ee94f99 Compare April 7, 2025 15:15
@jmxnzo jmxnzo changed the base branch from meshapi/workloadSecretExt to transitapi/tls-authentication April 7, 2025 15:16
@jmxnzo jmxnzo force-pushed the transitapi/tls-authorization branch from 38a3913 to 7453d2c Compare April 7, 2025 15:19
@katexochen katexochen added this to the v1.9.0 milestone Apr 8, 2025
@jmxnzo jmxnzo force-pushed the transitapi/tls-authorization branch from 7453d2c to d300fc9 Compare April 8, 2025 11:24
@jmxnzo jmxnzo marked this pull request as ready for review April 8, 2025 12:19
@jmxnzo jmxnzo requested a review from burgerdev as a code owner April 8, 2025 12:19
@jmxnzo jmxnzo force-pushed the transitapi/tls-authentication branch from 7d585df to b5249b5 Compare April 9, 2025 10:05
@jmxnzo jmxnzo force-pushed the transitapi/tls-authorization branch from d300fc9 to b99cf83 Compare April 9, 2025 12:39
@jmxnzo jmxnzo requested a review from burgerdev April 14, 2025 09:50
@jmxnzo jmxnzo force-pushed the transitapi/tls-authorization branch from 7e8140e to 5755b22 Compare April 14, 2025 09:55
@jmxnzo jmxnzo force-pushed the transitapi/tls-authentication branch from b5249b5 to a1eaded Compare April 14, 2025 14:10
@jmxnzo jmxnzo force-pushed the transitapi/tls-authorization branch from 5755b22 to 7c3c5de Compare April 14, 2025 14:20
Base automatically changed from transitapi/tls-authentication to main April 14, 2025 14:46
jmxnzo added 2 commits April 14, 2025 16:49
The worklaodSecretID send in the client cert extension is compared
to the requested workloadSecretID of the name parameter using an
authorization middleware. Thus clients are only authorized for the key
set corresponding to the workloadSecretID set in the manifest.
The transit engine API holds a persistent ecdsa private key which is
used in getCertificate to create a valid mesh cert based on the current
state for the for the transit engine API.
@jmxnzo jmxnzo force-pushed the transitapi/tls-authorization branch from 7c3c5de to e0be4c2 Compare April 14, 2025 14:53
@jmxnzo jmxnzo merged commit bc49c33 into main Apr 14, 2025
15 checks passed
@jmxnzo jmxnzo deleted the transitapi/tls-authorization branch April 14, 2025 16:18
@katexochen katexochen modified the milestones: v1.9.0, v1.10.0 May 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no changelog PRs not listed in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants