Skip to content

Add authentication between CSI driver and provider plugins #2053

Description

@reyhankoyun

Summary

The driver communicates with provider plugins over unauthenticated Unix domain sockets in a shared hostPath directory. The provider_client.go explicitly notes that "the interface is only secured through filesystem ACLs."

This means any process on the node that can access the socket file can send Mount requests to the provider. While filesystem permissions and Pod Security Standards provide layers of defense, adding protocol-level authentication between the driver and provider would provide defense-in-depth.

Proposal

Add an authentication mechanism to the driver-provider gRPC communication so providers can verify the caller is the legitimate CSI driver. Possible approaches:

  1. mTLS on the Unix socket — driver and provider exchange certificates at startup. Providers reject connections without a valid client certificate.
  2. Shared secret/token — driver passes a per-node secret (e.g., from a projected volume) in gRPC metadata that the provider validates.

Context

  • All providers (AWS, GCP, Azure) currently rely solely on filesystem ACLs for socket security
  • The Azure provider has already hardened socket permissions to 0700
  • The AWS provider has similarly restricted socket permissions (#637)
  • These are valuable hardening steps but do not fully authenticate the caller at the protocol level

Constraints

  • SO_PEERCRED (PID-based checks) is not viable because the driver and provider run in separate PID namespaces, causing the PID to resolve to 0
  • SO_PEERCRED UID checks are also insufficient when both the driver and potential attacker run as root
  • Any solution needs to work in the existing DaemonSet-to-DaemonSet deployment model with a shared hostPath volume

/kind feature

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.

    Type

    No type

    Projects

    • Status
      Subprojects - Needs Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions