Skip to content
Kong Docs are moving soon! Our docs are migrating to a new home. You'll be automatically redirected to the new site in the future. In the meantime, view this page on the new site!
Kong Logo | Kong Docs Logo
  • Docs
    • Explore the API Specs
      View all API Specs View all API Specs View all API Specs arrow image
    • Documentation
      API Specs
      Kong Gateway
      Lightweight, fast, and flexible cloud-native API gateway
      Kong Konnect
      Single platform for SaaS end-to-end connectivity
      Kong AI Gateway
      Multi-LLM AI Gateway for GenAI infrastructure
      Kong Mesh
      Enterprise service mesh based on Kuma and Envoy
      decK
      Helps manage Kong’s configuration in a declarative fashion
      Kong Ingress Controller
      Works inside a Kubernetes cluster and configures Kong to proxy traffic
      Kong Gateway Operator
      Manage your Kong deployments on Kubernetes using YAML Manifests
      Insomnia
      Collaborative API development platform
  • Plugin Hub
    • Explore the Plugin Hub
      View all plugins View all plugins View all plugins arrow image
    • Functionality View all View all arrow image
      View all plugins
      AI's icon
      AI
      Govern, secure, and control AI traffic with multi-LLM AI Gateway plugins
      Authentication's icon
      Authentication
      Protect your services with an authentication layer
      Security's icon
      Security
      Protect your services with additional security layer
      Traffic Control's icon
      Traffic Control
      Manage, throttle and restrict inbound and outbound API traffic
      Serverless's icon
      Serverless
      Invoke serverless functions in combination with other plugins
      Analytics & Monitoring's icon
      Analytics & Monitoring
      Visualize, inspect and monitor APIs and microservices traffic
      Transformations's icon
      Transformations
      Transform request and responses on the fly on Kong
      Logging's icon
      Logging
      Log request and response data using the best transport for your infrastructure
  • Support
  • Community
  • Kong Academy
Get a Demo Start Free Trial
Kong Mesh
2.10.x (latest)
  • Home icon
  • Kong Mesh
  • Production
  • Secure Deployment
  • Authentication with the data plane proxy
github-edit-pageEdit this page
report-issueReport an issue
  • Kong Gateway
  • Kong Konnect
  • Kong Mesh
  • Kong AI Gateway
  • Plugin Hub
  • decK
  • Kong Ingress Controller
  • Kong Gateway Operator
  • Insomnia
  • Kuma

  • Docs contribution guidelines
  • dev
  • 2.10.x (latest)
  • 2.9.x
  • 2.8.x
  • 2.7.x (LTS)
  • 2.6.x
  • 2.5.x
  • 2.4.x
  • 2.3.x
  • 2.2.x
  • Introduction
    • About service meshes
    • Overview of Kong Mesh
    • How Kong Mesh works
    • Architecture
    • Install
    • Concepts
    • Stages of software availability
    • Version support policy
    • Software Bill of Materials
    • Vulnerability patching process
    • Mesh requirements
    • Release notes
  • Quickstart
    • Deploy Kong Mesh on Kubernetes
    • Deploy Kong Mesh on Universal
  • Kong Mesh in Production
    • Overview
    • Deployment topologies
      • Overview
      • Single-zone deployment
      • Multi-zone deployment
    • Use Kong Mesh
    • Control plane deployment
      • Kong Mesh license
      • Deploy a single-zone control plane
      • Deploy a multi-zone global control plane
      • Zone Ingress
      • Zone Egress
      • Configure zone proxy authentication
      • Control plane configuration reference
      • Systemd
      • Kubernetes
      • kumactl
      • Deploy Kong Mesh in Production with Helm
    • Configuring your Mesh and multi-tenancy
    • Data plane configuration
      • Data plane proxy
      • Configure the data plane on Kubernetes
      • Configure the data plane on Universal
      • Configure the Kong Mesh CNI
      • Configure transparent proxying
      • IPv6 support
    • Secure your deployment
      • Manage secrets
      • Authentication with the API server
      • Authentication with the data plane proxy
      • Configure data plane proxy membership
      • Secure access across services
      • Kong Mesh RBAC
      • FIPS support
    • Kong Mesh user interface
    • Inspect API
      • Matched policies
      • Affected data plane proxies
      • Envoy proxy configuration
    • Upgrades and tuning
      • Upgrade Kong Mesh
      • Performance fine-tuning
      • Version specific upgrade notes
    • Control Plane Configuration
      • Modifying the configuration
      • Inspecting the configuration
      • Store
  • Using Kong Mesh
    • Zero Trust & Application Security
      • Mutual TLS
      • External Service
    • Resiliency & Failover
      • Dataplane Health
      • Service Health Probes
    • Managing incoming traffic with gateways
      • How ingress works in Kuma
      • Delegated gateways
      • Built-in gateways
      • Running built-in gateway pods on Kubernetes
      • Configuring built-in listeners
      • Configuring built-in routes
      • Using the Kubernetes Gateway API
    • Observability
      • Demo setup
      • Control plane metrics
      • Configuring Prometheus
      • Configuring Grafana
      • Configuring Datadog
      • Observability in multi-zone
    • Route & Traffic shaping
      • Protocol support in Kong Mesh
    • Service Discovery & Networking
      • Service Discovery
      • MeshService
      • MeshMultiZoneService
      • HostnameGenerator
      • DNS
      • Non-mesh traffic
      • MeshExternalService
      • Transparent Proxying
  • Policies
    • Introduction
      • What is a policy?
      • What do policies look like?
      • Writing a targetRef
      • Merging configuration
      • Using policies with MeshService
      • Examples
      • Applying policies in shadow mode
    • MeshAccessLog
      • TargetRef support matrix
      • Configuration
      • Examples
    • MeshCircuitBreaker
      • TargetRef support matrix
      • Configuration
      • Examples
    • MeshFaultInjection
      • TargetRef support matrix
      • Configuration
      • Examples
    • MeshHealthCheck
      • TargetRef support matrix
      • Configuration
      • Examples
    • MeshHTTPRoute
      • TargetRef support matrix
      • Configuration
      • Examples
      • Merging
    • MeshLoadBalancingStrategy
      • TargetRef support matrix
      • Configuration
      • Examples
    • MeshMetric
      • TargetRef support matrix
      • Configuration
      • Prometheus
      • OpenTelemetry
      • Examples
    • MeshPassthrough
      • TargetRef support matrix
      • Configuration
      • Examples
    • MeshProxyPatch
      • TargetRef support matrix
      • Configuration
      • Examples
      • Merging
    • MeshRateLimit
      • TargetRef support matrix
      • Configuration
      • Examples
    • MeshRetry
      • TargetRef support matrix
      • Configuration
      • Examples
    • MeshTCPRoute
      • TargetRef support matrix
      • Configuration
      • Examples
      • Route policies with different types targeting the same destination
    • MeshTimeout
      • TargetRef support matrix
      • Configuration
      • Examples
    • MeshTLS
      • TargetRef support matrix
      • Configuration
      • Examples
    • MeshTrace
      • TargetRef support matrix
      • Configuration
      • Examples
    • MeshTrafficPermission
      • TargetRef support matrix
      • Configuration
      • Examples
    • MeshOPA
    • MeshGlobalRateLimit (beta)
    • Previous Policies
      • General notes about Kong Mesh policies
      • How Kong Mesh chooses the right policy to apply
      • Traffic Permissions
      • Traffic Route
      • Traffic Metrics
      • Traffic Trace
      • Traffic Log
      • Locality-aware Load Balancing
      • Fault Injection
      • Health Check
      • Circuit Breaker
      • Retry
      • Timeout
      • Rate Limit
      • Virtual Outbound
      • MeshGatewayRoute
      • OPA policy
  • Guides
    • Federate zone control plane
    • Add a builtin Gateway
    • Add Kong as a delegated Gateway
    • Kubernetes Gateway API
    • Collect Metrics with OpenTelemetry
    • Migration to the new policies
    • Progressively rolling in strict mTLS
    • Producer and consumer policies
    • Configuring inbound traffic with Rules API
    • Upgrading Transparent Proxy
    • Deploy Kong Mesh using Terraform and Konnect
    • Import existing Konnect Kong Mesh deployment to Terraform
  • Enterprise Features
    • Overview
    • HashiCorp Vault CA
    • Amazon ACM Private CA
    • cert-manager Private CA
    • OPA policy support
    • MeshOPA
    • Multi-zone authentication
    • FIPS support
    • Certificate Authority rotation
    • Role-Based Access Control
    • Red Hat
      • UBI Images
      • Red Hat OpenShift Quickstart
    • Windows Support
    • ECS Support
    • Auditing
    • MeshGlobalRateLimit (beta)
    • Verify signatures for signed Kong Mesh images
    • Build provenance
      • Verify build provenance for signed Kong Mesh images
      • Verify build provenance for signed Kong Mesh binaries
  • Reference
    • HTTP API
    • Kubernetes annotations and labels
    • Kuma data collection
    • Control plane configuration reference
    • Envoy proxy template
  • Community
    • Contribute to Kuma
enterprise-switcher-icon Switch to OSS
On this pageOn this page
  • Service Account Token
  • Data plane proxy token
    • Usage
    • Data Plane Proxy Token boundary
    • Token Revocation
    • Signing key rotation
    • Token rotation
    • Offline token issuing
    • Multizone
  • None

Authentication with the data plane proxy

To obtain a configuration from the control-plane, a data plane proxy must authenticate itself. There are several authentication methods availble.

Service Account Token

On Kubernetes, a data plane proxy proves its identity with the Service Account Token that is mounted in every pod.

Keep in mind that if you don’t explicitly specify serviceAccountTokenName in Deployment, the Pod is run with the default Service Account Token in the Namespace. This means that authentication scope is bound to a Namespace, so any Pod in the Namespace can authenticate as any other Pod in a Namespace.

To have a strict security bound to a Deployment, every Deployment should use unique Service Account Token. On top of that, users should not be able to modify serviceAccountTokenName in Deployment. This can be achieved for example with OPA Gatekeeper.

Service Account Token is not bound to a mesh, see data plane proxy membership how to restrict which Pods can join a mesh.

Data plane proxy token

On Universal, a data plane proxy must be explicitly configured with a unique security token (data plane proxy token) that will be used to prove its identity.

The data plane proxy token is a JWT token that contains:

  • Mesh to which data plane belongs (required)
  • The name of a data plane proxy (optional)
  • List of tags that are permitted to use (optional)
  • Expiration date of the token (required, 10 years if not specified)

The Data plane proxy token is signed by a signing key that is autogenerated when Mesh is created. Tokens are never stored in the control plane, the only thing that is stored are signing keys that are used to verify if a token is valid. The signing key is RSA256 encrypted.

You can check for the signing key:

kumactl get secrets

which returns something like:

MESH      NAME                                    AGE
default   dataplane-token-signing-key-default-1   49s

Usage

You can generate token either by REST API

curl -XPOST \
  -H "Content-Type: application/json" \
  --data '{"name": "dp-echo-1", "mesh": "default", "tags": {"kuma.io/service": ["backend", "backend-admin"]}, "validFor": "720h"}' \
  http://localhost:5681/tokens/dataplane

or by using kumactl

kumactl generate dataplane-token \
  --name dp-echo-1 \
  --mesh default \
  --tag kuma.io/service=backend,backend-admin \
  --valid-for 720h > /tmp/kuma-dp-echo1-token

The token should be stored in a file and then used when starting kuma-dp

kuma-dp run \
  --cp-address=https://127.0.0.1:5678 \
  --dataplane-file=dp-backend.yaml \
  --dataplane-token-file=/tmp/kuma-dp-echo-1-token

You can also pass Dataplane Token inline as KUMA_DATAPLANE_RUNTIME_TOKEN Environment Variable.

Data Plane Proxy Token boundary

As we can see in the example above, we can generate a token by passing a name, mesh, and a list of tags. The control plane will then verify the data plane proxy resources that are connecting to it against the token. This means we can generate a token by specifying:

  • Only mesh. By doing so we can reuse the token for all dataplanes in a given mesh.
  • mesh + tag (ex. kuma.io/service). This way we can use one token across all instances/replicas of the given service. Please keep in mind that we have to specify to include all the services that a data plane proxy is in charge of. For example, if we have a Dataplane with two inbounds, one valued with kuma.io/service: backend and one with kuma.io/service: backend-admin, we need to specify both values (--tag kuma.io/service=backend,backend-admin).
  • mesh + name + tag (ex. kuma.io/service). This way we can use one token for one instance/replica of the given service.

Token Revocation

Kong Mesh does not keep the list of issued tokens. Whenever the single token is compromised, we can add it to revocation list so it’s no longer valid.

Authentication between the control plane and data planes is only checked at connection start. This means that when revoking a token after the data plane connects, the connection won’t stop. The recommended action on token revocation is to either restart the control plane or the concerned data planes.

Every token has its own ID which is available in payload under jti key. You can extract ID from token using jwt.io or jwt-cli tool. Here is example of jti

0e120ec9-6b42-495d-9758-07b59fe86fb9

Specify list of revoked IDs separated by , and store it as Secret named dataplane-token-revocations-{mesh}

Universal
Kubernetes
echo "
type: Secret
mesh: default
name: dataplane-token-revocations-default
data: " | kumactl apply --var revocations=$(echo '0e120ec9-6b42-495d-9758-07b59fe86fb9' | base64) -f -
REVOCATIONS=$(echo '0e120ec9-6b42-495d-9758-07b59fe86fb9' | base64) && echo "apiVersion: v1
kind: Secret
metadata:
  name: dataplane-token-revocations-default
  namespace: kong-mesh-system
data:
  value: $REVOCATIONS
type: system.kuma.io/secret" | kubectl apply -f -

Signing key rotation

If the signing key is compromised, we must rotate it and all the tokens that was signed by it.

  1. Generate new signing key The signing key is stored as a Secret with a name that looks like dataplane-token-signing-key-{mesh}-{serialNumber}.

    Make sure to generate the new signing key with a serial number greater than the serial number of the current signing key.

    Universal
    Kubernetes

    Check what is the current highest serial number.

       kumactl get secrets
       MESH      NAME                                    AGE
       default   dataplane-token-signing-key-default-1   49s

    In this case, the highest serial number is 1. Generate a new signing key with a serial number of 2

       echo "
       type: Secret
       mesh: default
       name: dataplane-token-signing-key-default-2
       data: " | kumactl apply --var key=$(kumactl generate signing-key) -f -

    Check what is the current highest serial number.

       kubectl get secrets -n kong-mesh-system --field-selector='type=system.kuma.io/secret'
       NAME                                 TYPE                    DATA   AGE
       dataplane-token-signing-key-mesh-1   system.kuma.io/secret   1      25m

    In this case, the highest serial number is 1. Generate a new signing key with a serial number of 2

       TOKEN="$(kumactl generate signing-key)" && echo "
       apiVersion: v1
       data:
         value: $TOKEN
       kind: Secret
       metadata:
         name: dataplane-token-signing-key-mesh-2
         namespace: kong-mesh-system
       type: system.kuma.io/secret
       " | kubectl apply -f -
  2. Regenerate tokens Create new data plane proxy tokens. These tokens are automatically created with the signing key that’s assigned the highest serial number, so they’re created with the new signing key. At this point, tokens signed by either new or old signing key are valid.

  3. Remove the old signing key

    Universal
    Kubernetes
       kumactl delete secret dataplane-token-signing-key-default-1 --mesh=default
       kubectl delete secret dataplane-token-signing-key-default-1 -n kong-mesh-system

    All new connections to the control plane now require tokens signed with the new signing key.

Token rotation

If you need to generate a new token for a Dataplane or you are using service account token projection on Kubernetes, it’s possible to configure dynamic token reloading. To enable this behaviour, set the kuma-cp configuration property dpServer.auth.enableReloadableTokens to true. When you enable the property, kuma-dp detects changes to the token file, reloads the token and uses the new value when establishing a new connection to kuma-cp. By the defaut, enableReloadableTokens feature is enabled on Kubernetes.

Offline token issuing

In addition to the regular flow of generating signing keys, storing them in secret, and using them to sign tokens on the control plane, Kuma also offers offline signing of tokens. In this flow, you can generate a pair of public and private keys and configure the control plane only with public keys for token verification. You can generate all the tokens without running the control plane.

The advantages of this mode are:

  • easier, more reproducible deployments of the control plane, and more in line with GitOps.
  • potentially more secure setup, because the control plane does not have access to the private keys.

Here’s how to use offline issuing

  1. Generate a pair of signing keys

    The following commands generate standard RSA key of 2048 bits and outputs it in PEM-encoded format. You can use any external tool to generate a pair of keys.

    kumactl generate signing-key --format=pem > /tmp/key-private.pem
    kumactl generate public-key --signing-key-path=/tmp/key-private.pem > /tmp/key-public.pem
    

    The result should be similar to this output

    cat /tmp/key-private.pem /tmp/key-public.pem 
    -----BEGIN RSA PRIVATE KEY-----
    MIIEpAIBAAKCAQEAsS61a79gC4mkr2Ltwi09ajakLyUR8YTkJWzZE805EtTkEn/r
    ...
    htKtzsYA7yGlt364IuDybrP+PlPMSK9cQAmWRRZIcBNsKOODkAgKFA==
    -----END RSA PRIVATE KEY-----
    -----BEGIN RSA PUBLIC KEY-----
    MIIBCgKCAQEAsS61a79gC4mkr2Ltwi09ajakLyUR8YTkJWzZE805EtTkEn/rL2u/
    ...
    se7sx2Pt/NPbWFFTMGVFm3A1ueTUoorW+wIDAQAB
    -----END RSA PUBLIC KEY----- 
    
  2. Configure the control plane with public key

    Configure a control plane with the following settings

    dpServer:
      authn:
        dpProxy:
          type: dpToken
          dpToken:
            enableIssuer: false # disable control plane token issuer that uses secrets
            validator:
              useSecrets: false # do not use signing key stored in secrets to validate the token
              publicKeys:
              - kid: "key-1"
                mesh: default
                key: |
                  -----BEGIN RSA PUBLIC KEY-----
                  MIIBCgKCAQEAsS61a79gC4mkr2Ltwi09ajakLyUR8YTkJWzZE805EtTkEn/rL2u/
                  ...
                  se7sx2Pt/NPbWFFTMGVFm3A1ueTUoorW+wIDAQAB
                  -----END RSA PUBLIC KEY-----
    
  3. Use the private key to issue tokens offline

    The command is the same as with online signing, but with two additional arguments:

    • --kid - ID of the key that should be used to validate the token. This should match kid specified in the control plane configuration.
    • --signing-key-path - path to a PEM-encoded private key.
    kumactl generate dataplane-token \
      --name dp-echo-1 \
      --mesh default \
      --tag kuma.io/service=backend,backend-admin \
      --valid-for 720h > /tmp/kuma-dp-echo1-token \
      --signing-key-path /tmp/key-private.pem \
      --kid key-1
    

    You can also use any external system that can issue JWT tokens using RS256 signing method with the following claims:

    • Name (string) - the name of the DPP
    • Mesh (string) - the name of the mesh
    • Tags (map of string to []string) - list of tags that are permitted to use

Migration

You can use both offline and online issuing by keeping dpServer.authn.dpProxy.dpToken.enableIssuer to true. You can use both secrets and public key static config validators by keeping dpServer.authn.dpProxy.dpToken.validator.useSecrets to true.

Management

Token revocation works the same when using both online and offline issuing.

Signing key rotation works similarly:

  • generate another pair of signing keys
  • configure a control plane with old and new public keys
  • regenerate tokens for all existing data plane proxies with the new private key
  • remove the old public key from the configuration

Multizone

When running in multizone, mode we can generate data plane proxy token both on global and zone control plane. If the deployment pipeline is configured to generate data plane proxy token before running the proxy, it can rely on the Zone CP. This way Global CP is not a single point of failure. Signing key rotation or token revocation should be performed on the global control plane.

None

We can turn off the authentication by setting KUMA_DP_SERVER_AUTH_TYPE to none.

If we disable the authentication between the control plane and the data plane proxies, any data plane proxy will be able to impersonate any service, therefore this is not recommended in production.

Thank you for your feedback.
Was this page useful?
Too much on your plate? close cta icon
More features, less infrastructure with Kong Konnect. 1M requests per month for free.
Try it for Free
  • Kong
    Powering the API world

    Increase developer productivity, security, and performance at scale with the unified platform for API management, service mesh, and ingress controller.

    • Products
      • Kong Konnect
      • Kong Gateway Enterprise
      • Kong Gateway
      • Kong Mesh
      • Kong Ingress Controller
      • Kong Insomnia
      • Product Updates
      • Get Started
    • Documentation
      • Kong Konnect Docs
      • Kong Gateway Docs
      • Kong Mesh Docs
      • Kong Insomnia Docs
      • Kong Konnect Plugin Hub
    • Open Source
      • Kong Gateway
      • Kuma
      • Insomnia
      • Kong Community
    • Company
      • About Kong
      • Customers
      • Careers
      • Press
      • Events
      • Contact
  • Terms• Privacy• Trust and Compliance
© Kong Inc. 2025