Skip to content

Secure CSI Driver TCP Connections via Substrate Pod Identity - #956

Open
hajiler wants to merge 1 commit into
agent-substrate:mainfrom
hajiler:managed-tcp
Open

Secure CSI Driver TCP Connections via Substrate Pod Identity#956
hajiler wants to merge 1 commit into
agent-substrate:mainfrom
hajiler:managed-tcp

Conversation

@hajiler

@hajiler hajiler commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Secures network-based gRPC connections between the ate-api control plane and CSI driver controller services using mutual TLS (mTLS) backed by Substrate's Pod Identity.

Requests from ate-api to CSI driver controllers occur over the network, as configured via the CSIDriverConfig custom resource. This PR extends the CSIDriverConfig CRD to include a tls configuration section, which leverages
Substrate's Pod Identity certificate infrastructure (managed by podcertcontroller) to secure these
TCP connections using mTLS. Because standard CSI drivers typically communicate over Unix domain sockets, a proxy sidecar (e.g., envoy) is added to the CSI controller deployment to terminate TLS and forward requests to the local CSI socket.

#232

It's a good idea to open an issue first for discussion.

  • [X ] Tests pass
  • Appropriate changes to documentation are included in the PR

@hajiler
hajiler force-pushed the managed-tcp branch 6 times, most recently from 7837061 to ac4da29 Compare August 14, 2026 22:28
@mattcary

Copy link
Copy Markdown

/lgtm

Seems to do the right thing from what I understand.

@mattcary

Copy link
Copy Markdown

/assgin Michael Taufen (@mtaufen)

#
# This exposes the hostpath's Unix domain csi.sock as a TCP port to the
# outside world. The mapping from Unix domain socket to TCP is done
# by socat.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Seems like it is no longer done with socat?

match_typed_subject_alt_names:
- san_type: URI
matcher:
exact: "spiffe://cluster.local/ns/ate-system/sa/ate-api-server"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

In the near future we are going to have to make the cluster.local part configurable. What sort of matches does Envoy support in its config?

}

// Load CA Pool
caPoolBytes, err := os.ReadFile(paths.caCert)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The CA file may update on disk if the CA goes through a rotation.

We may need to copy the CA handling code from https://github.com/ahmedtd/tinycert/blob/main/lib/spiffefsd/spiffefsd.go (I wrote this under the terms of my IP agreement with Google, and it's Apache-licensed, so it's fine to copy in and attribute to Google)

By default tls.Config only allows specifying a static pool of root certificates. We have to use the combination of InsecureSkipVerify and VerifyConnection to enable automatic reloading.

@hajiler
hajiler marked this pull request as ready for review August 18, 2026 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants