Kong Interview Questions on Plugins and Security (2027)
42 most asked Kong interview questions on plugin precedence, priorities, auth plugins, rate limiting policies, vaults and Admin API security.
The Kong questions interviewers ask most often are about plugins and API security: how plugin scope and precedence work, which authentication plugin fits which client, how rate limiting stays accurate across nodes, and how to keep credentials and the Admin API safe. This set of 42 questions answers those directly, from basics to scenarios, using Kong Gateway 3.x documentation.
Other Kong posts on this site take different angles. The main set is Kong API Gateway interview questions. Hands-on configuration is in 75+ Kong questions on hands-on config, production operations in real-time Kong questions, and architecture in advanced Kong questions. This page stays on plugins and security.
Key takeaways
- A plugin can be global or scoped to a Service, Route, Consumer or Consumer Group. When several instances of the same plugin match, the most specific scope wins.
- Execution order between different plugins follows each plugin's
PRIORITY: higher runs first. Authentication (Key Auth at 1250) runs before Rate Limiting (910). - Rate Limiting's
localpolicy is fast but approximate;redisis accurate across nodes;clusteruses the database and is not supported in hybrid mode or Konnect. - Store credentials and plugin secrets as vault references, never in plain declarative files.
- Never expose the Admin API publicly. Bind it to localhost or a private network and protect it.
Plugin categories interviewers expect you to know
| Category | Examples | Typical question |
|---|---|---|
| Authentication | Key Auth, Basic Auth, JWT, OAuth 2.0, HMAC Auth, LDAP Auth, OpenID Connect, mTLS Auth | Which one for machine clients versus users? |
| Authorization | ACL, consumer groups | How do you allow only some consumers on a route? |
| Traffic control | Rate Limiting, Rate Limiting Advanced, Request Size Limiting, Request Termination, Proxy Cache | How do you keep limits accurate on five nodes? |
| Security | IP Restriction, CORS, Bot Detection | How do you block an abusive client fast? |
| Transformation | Request Transformer, Response Transformer, Correlation ID | How do you add a header for the upstream? |
| Observability | Prometheus, OpenTelemetry, HTTP Log, File Log | How do you trace a request through Kong? |
Some plugins, such as OpenID Connect, mTLS Auth and Rate Limiting Advanced, are Enterprise or Konnect features. Check the badge on each plugin's page in the Kong Plugin Hub before claiming one is free.
Freshers: plugin basics
1. What is a Kong plugin?
A module that runs inside the request and response lifecycle to add behaviour such as authentication, rate limiting, transformation or logging. Plugins are written in Lua, or in Go, Python or JavaScript through plugin servers, and attach to Kong entities.
2. Which entities can a plugin attach to?
Globally, or scoped to a Service, Route, Consumer or Consumer Group, and combinations of these. A global plugin runs on every request.
3. How do you enable a plugin on a service with the Admin API?
curl -X POST http://localhost:8001/services/orders/plugins \
--data name=rate-limiting \
--data config.minute=60 \
--data config.policy=local
The Admin API listens on 8001 (HTTP) and 8444 (HTTPS) by default; proxy traffic uses 8000 and 8443.
4. How do you enable the same plugin declaratively?
_format_version: "3.0"
services:
- name: orders
url: http://orders.internal:8080
routes:
- name: orders-route
paths:
- /orders
plugins:
- name: key-auth
- name: rate-limiting
config:
minute: 60
policy: local
Apply it with deck gateway sync kong.yaml, or load it at startup in DB-less mode.
5. What is a Consumer?
An entity representing a client of your APIs, such as an app, partner or team. Credentials (keys, JWT secrets, basic auth users) belong to Consumers, and plugins can be scoped to them for per-client behaviour.
6. How does Key Auth work?
The client sends an API key, by default in a header or query parameter named apikey. Kong looks up the key, identifies the Consumer and forwards the request with consumer headers. Header lookup and query lookup are on by default; body lookup is off.
7. Why is sending API keys in the query string risky?
Query strings end up in access logs, proxy logs and browser history. Kong's docs recommend headers for service-to-service calls. Disable key_in_query when clients can use headers.
8. What does the ACL plugin do?
It allows or denies Consumers based on group names attached to them. It needs an authentication plugin first, because ACL decisions depend on knowing the Consumer.
9. What does the CORS plugin do?
It answers browser preflight requests and adds CORS headers, so a front end on one origin can call an API on another. Set explicit origins rather than * when credentials are involved.
10. What does Request Termination do?
It returns a fixed status and message without calling the upstream. Teams use it for maintenance windows or to block a route temporarily.
2 to 5 years: precedence, ordering and rate limiting
11. If the same plugin is configured globally and on a route, which runs?
Only one instance runs per request: the most specific match. The order, highest first, is Consumer plus Route plus Service, then Consumer Group plus Service plus Route, Consumer plus Route, Consumer plus Service, Consumer Group plus Route, Consumer Group plus Service, Route plus Service, Consumer, Consumer Group, Route, Service, and finally global (Plugin entity docs).
12. How is the order between different plugins decided?
Each plugin's handler has a PRIORITY number and higher runs first. In Gateway 3.16 docs, Pre-Function is 1000000, Key Auth 1250, Rate Limiting 910, Request Transformer 801, Proxy Cache 100, Prometheus 13 and Post-Function -1000 (handler reference).
13. Why does that ordering matter for rate limiting?
Because authentication runs first, Rate Limiting already knows the Consumer and can limit per Consumer. If no auth plugin is present, it falls back to the client IP.
14. Can you change plugin order?
Kong supports dynamic plugin ordering through an ordering field with before and after lists per phase. It is documented as an Enterprise capability, so confirm your edition before relying on it.
15. Which request phases do plugins run in?
certificate, rewrite, access, then response or header_filter and body_filter, and log. rewrite runs before Kong has identified the Service or Consumer, so only global plugins run there.
16. Compare the Rate Limiting policies.
local keeps counters in each node's memory: fastest, least accurate across nodes. cluster stores counters in Kong's database: accurate, highest cost, and not supported in hybrid mode or Konnect. redis stores counters in Redis: accurate with moderate cost (Rate Limiting docs).
17. What does a client see when it hits the limit?
HTTP 429 with {"message":"API rate limit exceeded"}, plus headers such as RateLimit-Limit, RateLimit-Remaining, RateLimit-Reset and Retry-After. You can hide limit headers with hide_client_headers.
18. How do you give premium clients higher limits?
Put them in a Consumer Group or scope a Rate Limiting instance to their Consumer. Because Consumer-scoped instances outrank Service or global ones, the higher limit applies to them only.
19. JWT versus Key Auth?
Key Auth checks an opaque key Kong stores. JWT verifies a signed token against a secret or public key attached to a Consumer and can check claims such as exp. JWT suits tokens issued by another system; Key Auth suits simple partner integrations.
20. When would you use OpenID Connect instead?
When users log in through an identity provider such as Okta, Entra ID or Keycloak and you want Kong to validate tokens, run authorization code flows and map claims to consumers. It is an Enterprise plugin.
21. How do you allow anonymous access with optional authentication?
Set the auth plugin's anonymous option to a Consumer used for unauthenticated traffic, then give that Consumer stricter rate limits. Kong adds X-Anonymous-Consumer: true upstream when it falls back.
22. How do you combine several auth methods on one route?
Enable each plugin with the same anonymous Consumer configured, then add Request Termination scoped to that anonymous Consumer so requests that fail every method are rejected. This gives "any one of" behaviour.
23. How do you strip credentials before they reach the upstream?
Set hide_credentials: true on the auth plugin. The upstream then never sees the API key or Authorization header.
24. How do you block a set of IP ranges?
Use the IP Restriction plugin with deny CIDRs, scoped to the routes concerned. If Kong sits behind a load balancer, configure trusted_ips and real_ip_header so Kong sees the real client address.
25. How do you add a header to every upstream request?
Request Transformer with add.headers, for example x-request-source:kong. Use the Correlation ID plugin to add a request ID that also helps tracing.
Senior: securing Kong itself
26. How should the Admin API be protected?
Bind admin_listen to 127.0.0.1 or a private interface, never a public one. If remote access is needed, put it behind a protected gateway route or network controls, and in Enterprise use RBAC. In Kubernetes, manage Kong through the ingress controller instead of exposing Admin.
27. How do you keep secrets out of plugin configs?
Use vault references such as {vault://env/redis-password} in fields that support referenceable values. Kong resolves the value at runtime from environment variables, the Konnect Config Store or a supported external vault, depending on edition. See the Vault entity docs.
28. How is the control plane to data plane link secured in hybrid mode?
With mutual TLS using cluster_cert, cluster_cert_key and, in PKI mode, cluster_ca_cert. Data planes do not need database credentials, which shrinks the attack surface at the edge.
29. How do you enforce TLS to clients and upstreams?
Set route protocols to https only and use https_redirect_status_code for HTTP clients. For upstreams, use https service URLs with tls_verify enabled and a CA certificate configured.
30. How do you govern plugin configuration across teams?
Keep declarative config in Git, split by team with decK tags or workspaces, review changes through pull requests, and run deck gateway diff in CI. Global security plugins stay owned by the platform team.
31. How do you audit who changed what?
Git history for declarative config. In Enterprise, Admin API audit logging records requests and entity changes. In Konnect, use its audit logs.
32. How do you write a custom plugin safely?
Implement only the phases you need, choose a PRIORITY that places it correctly relative to auth and rate limiting, avoid blocking I/O in hot phases, validate config with a schema, and test with Pongo. Prefer existing plugins first.
33. How do you trace a request through Kong?
Enable the OpenTelemetry plugin to export spans with W3C trace context, and the Prometheus plugin for metrics. Correlation IDs tie Kong logs to upstream logs.
34. What is the risk of Pre-Function and Post-Function plugins?
They run arbitrary Lua supplied in config. Anyone who can write plugin config can run code in the gateway. Restrict them, review them like code, and avoid them for logic that a standard plugin covers.
Scenario questions
35. Rate limits are inconsistent: clients get more requests than allowed. Why?
Probably the local policy with several nodes behind a round-robin load balancer, so each node counts separately. Switch to redis with sync_rate set for synchronous counting, or use consistent hashing on the load balancer.
36. After enabling a global Key Auth plugin, health checks from the load balancer fail. Fix?
The health route now requires a key. Add an anonymous fallback scoped to that route, or exclude it by scoping Key Auth to Services instead of globally, or configure a dedicated status endpoint outside the proxy.
37. A partner's key leaked. What do you do?
Delete or rotate the credential on their Consumer through the Admin API or decK, issue a new key, check logs for misuse by Consumer, and tighten that Consumer's rate limit until the investigation ends.
38. Users get 401 even with a valid JWT. What do you check?
That the token's iss (or configured key claim) matches a JWT credential's key on a Consumer, the algorithm matches, the secret or public key is correct, and clock skew is not failing exp or nbf checks.
39. A route-level plugin seems to be ignored. Why?
A more specific instance of the same plugin, such as one scoped to the Consumer and Route, takes precedence. List plugins for the route and the Consumer to see every instance.
40. Browser calls fail with CORS errors only on POST. What is wrong?
The preflight OPTIONS request is blocked, often because an auth plugin rejects it or the CORS plugin's methods or headers lists do not include what the browser asks for. Check preflight_continue and the allowed headers.
41. Kong fails to start after adding a vault reference to kong.conf. Why?
If a reference in kong.conf cannot be resolved at startup, Kong does not start. Check the vault configuration and that the environment variable or secret exists. Konnect Config Store references cannot be used in kong.conf.
42. You need to throttle one abusive client immediately without a deploy. How?
Add a Consumer-scoped Rate Limiting or Request Termination plugin through the Admin API or Konnect, then capture the change in declarative config so the next sync does not remove it.
Preparation checklist
- Run Kong in Docker in DB-less mode and in database mode.
- Configure Key Auth, ACL and Rate Limiting on one route and test precedence with a Consumer-scoped override.
- Break rate limiting with two nodes and
local, then fix it with Redis. - Use decK to export, diff and sync config.
- Read the scenario-based Kong questions and the Kong FAQs for quick revision.
Kong often runs on Kubernetes, so cluster skills help. The CKA training covers the platform side, in our Kharadi, Pune classroom or live online.
Frequently asked questions
What are the most asked Kong interview topics?
Plugin scope and precedence, authentication plugins such as Key Auth and JWT, ACLs, rate limiting policies, Admin API security, declarative config with decK, and debugging 401 and 429 responses.
Which plugin runs first, authentication or rate limiting?
Authentication. Key Auth has priority 1250 and Rate Limiting 910, and higher priority runs first, so rate limiting can count per Consumer.
Which Rate Limiting policy should I use with several nodes?
Redis for accurate shared counters. Local is fastest but approximate, and cluster is not supported in hybrid mode or Konnect.
What is plugin precedence in Kong?
When several instances of the same plugin match a request, the one scoped to the most entities wins, from Consumer plus Route plus Service down to global.
Which Kong auth plugins are Enterprise only?
Examples include OpenID Connect and mTLS Auth. Each plugin page in the Plugin Hub shows its availability; check there before you answer.
How do I protect the Kong Admin API?
Bind it to localhost or a private network, never expose it publicly, use RBAC in Enterprise, and manage config through decK or the ingress controller.
How should secrets be stored in Kong config?
As vault references resolved at runtime from environment variables or an external vault, not as plain values in declarative files.
References
What's Your Reaction?
Like
0
Dislike
0
Love
0
Funny
0
Angry
0
Sad
0
Wow
0