The Simplest Way to Make Databricks ML and Kong Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams use databricks ml and kong to serve machine learning models to apps. Databricks trains and hosts the models while Kong routes incoming web traffic to them. This setup lets developers call model endpoints through one central entry point. Data scientists can update models in the workspace while Kong handles web requests. Still, linking these two tools takes careful work around keys, roles, and logs. How databricks ml and kong handle requests and permissions The workflow starts when a cli

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

Teams use databricks ml and kong to serve machine learning models to apps. Databricks trains and hosts the models while Kong routes incoming web traffic to them.

This setup lets developers call model endpoints through one central entry point. Data scientists can update models in the workspace while Kong handles web requests. Still, linking these two tools takes careful work around keys, roles, and logs.

How databricks ml and kong handle requests and permissions

The workflow starts when a client app sends a request to Kong. Kong checks the caller identity and applies rate limits to the route. Next, Kong forwards the request to the Databricks model serving endpoint.

Databricks needs a valid token or service principal to accept this incoming call. Many teams store a Databricks token inside Kong to make this step work. Databricks checks the token permissions and runs the model against the input data. Then the model sends the prediction back through Kong to the client app.

This path works well for basic tests and small internal apps. Yet it creates blind spots when many teams share the same routes. Databricks only sees the shared service account that Kong used for the call. It does not see which specific user or developer triggered the model run.

Common failure modes with shared tokens and broad roles

The biggest risk in this setup is a long-lived personal token in Kong. If a developer leaves the team, revoking their token breaks the production route. To avoid downtime, teams often create a shared service account with broad permissions. If someone leaks that shared key, an attacker can read workspace data.

Broad network rules cause another common problem for platform teams. Teams often open the model endpoints to wide network ranges for easy access. This lets callers bypass Kong and hit the Databricks endpoints without rate limits. Unlogged queries then pile up, and security teams cannot trace who ran what.

End-to-End Encryption + Kong Security Plugins: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

You can fix this by scoping roles down to each specific model endpoint. Give each service principal permission to run only one model, not the workspace. Lock down the network path so Databricks only accepts traffic from your routers.

Scoping data access and auditing model inputs

Model endpoints often process user payloads that contain sensitive fields like emails. When apps send payloads through Kong, standard web logs might miss the body. Or worse, debug logs might write raw card numbers or phone numbers to disk.

Teams need a way to inspect and clean payloads before storage or use. Data masking can rewrite matched fields like national IDs in the results. You also need clear audit logs that tie every query to a person. When you link user identity to each call, audits take minutes instead of days.

Keeping local testing and production routes aligned

Engineers often test Databricks models from their laptops before updating Kong routes. During local tests, developers tend to copy workspace tokens onto their own machines. Those local keys sit in plain text files and skip central log checks.

Standardize how engineers and apps talk to Databricks across every stage of work. Require identity checks for both human engineers and automated service calls. Rotate service credentials on a short schedule so old keys cannot cause harm. Keep your permission rules simple so teams do not look for risky workarounds.

Govern statements and responses across databases and APIs

Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev runs beside each supported service as an open-source proxy, a sidecar for your database or API.

First, hoop.dev guardrails block banned queries before they run. Then hoop.dev data masking rewrites matched sensitive values in responses in memory. The audit trail records every statement and verdict per resource. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.

Frequently asked questions

How should Kong authenticate to a Databricks model endpoint?

Use a dedicated Databricks service principal instead of a personal user token. Grant that principal permission to query only the single model endpoint it needs.

How do we stop callers from bypassing Kong to reach Databricks?

Set up private network links and IP access lists inside your Databricks workspace. Allow incoming traffic only from the specific network addresses that your Kong nodes use.

Why do our Databricks logs show only one user for all Kong traffic?

Kong uses one shared credential to call the model endpoint on every request. Pass caller identity headers from Kong and log them alongside your workspace audit records.

The query runs. The emails stay hidden.