Whoever can reach the Kong Admin API can reroute every API behind the gateway, disable its authentication plugins and read or mint the credentials of every consumer. Kong Gateway is a widely deployed open source and enterprise API gateway built on NGINX and OpenResty, and in most estates it sits in front of the APIs that partners, mobile apps and internal services depend on. This guide covers how identity works in Kong (the Admin API, RBAC, Kong Manager and Consumers), the admin roles that need privileged access controls, consumer credentials as non-human identities, secrets and keyring, hybrid mode certificates, audit logging, and a hardening baseline. It is for platform engineers and API security teams running Kong Gateway on premises or in Kubernetes. It goes deeper than the general API Gateway Security Guide on Kong specifics. Behaviour was checked against Kong's developer documentation on 27 October 2026; several features (RBAC, audit logs, keyring, external vaults) are Kong Gateway Enterprise only.
Key takeaways
- The Admin API is the crown jewel. Kong binds it to the local interface on port 8001 by default and warns that exposing it, especially on
0.0.0.0:8001, can seriously compromise the whole cluster. Only the proxy ports 8000 and 8443 should face clients. - Open source Kong has no Admin API login. Protection comes from network restriction, or from proxying the Admin API through Kong itself with authentication and IP restriction plugins. Enterprise adds RBAC with
enforce_rbac. - Consumer credentials are non-human identities. API keys, Basic Auth, HMAC, JWT and OAuth 2.0 credentials attached to Consumers belong to partner systems and apps. Give each an owner, a scope (ACL groups) and a rotation plan.
- Keys in query strings leak. The key-auth plugin accepts keys in the query string by default; Kong notes these can appear in logs and browser bars. Turn off
key_in_queryfor service traffic. - Audit logging is off by default. Enterprise audit logs record Admin API requests and database changes, can be signed with an RSA key, and need
audit_log = onand export before the TTL purges them.
How identity and access work in Kong Gateway
Kong has two separate identity planes: the administrators and automation that configure the gateway, and the Consumers whose requests it authenticates.
| Plane | Identity | How it authenticates | Where it is defined |
|---|---|---|---|
| Management | Admin API caller (person, decK, CI pipeline, Kubernetes ingress controller) | Open source: none built in, network controls only. Enterprise: RBAC user token sent as the Kong-Admin-Token header | admin_listen, RBAC users and roles |
| Management | Kong Manager user | Configured by admin_gui_auth (for example basic-auth, LDAP or OpenID Connect) with session settings; requires RBAC | Admins and RBAC roles |
| Management | Data plane node (hybrid mode) | mTLS to the control plane on cluster_listen (port 8005) | cluster_mtls, cluster_cert |
| Traffic | Consumer or principal (partner, app, service) | Authentication plugin on the Service or Route: key-auth, basic-auth, hmac-auth, jwt, oauth2, openid-connect, mtls-auth and others | Consumers and their credentials |
| Traffic | Anonymous | Requests that fail authentication when an anonymous Consumer is configured; upstream sees X-Anonymous-Consumer: true | Plugin anonymous setting |
Default ports
| Port | Setting | Purpose | Who should reach it |
|---|---|---|---|
| 8000 / 8443 | proxy_listen | Client traffic (HTTP / HTTPS) | Clients; the only ports Kong says should be exposed to them |
| 8001 / 8444 | admin_listen | Admin API (HTTP / HTTPS) | Localhost, or a management network and named automation hosts |
| 8002 / 8445 | admin_gui_listen | Kong Manager | Administrators on a management network |
| 8005 | cluster_listen | Hybrid mode: data planes to control plane (mTLS) | Data plane nodes only |
| 8006 | cluster_telemetry_listen | Hybrid mode telemetry | Data plane nodes only |
| 8007 | status_listen | Status listener (3.6 and later) | Monitoring systems only |
Admin roles and privileged access
In Kong Gateway Enterprise, RBAC is enabled with enforce_rbac = on plus admin_gui_auth and admin_gui_session_conf for Kong Manager. You must set KONG_PASSWORD at first start or no super admin is created and the gateway is locked. Kong's documentation is direct: Kong Manager authentication requires RBAC, otherwise anyone who can log in can perform any Admin API operation.
| Role | Scope | What it allows | Who should hold it |
|---|---|---|---|
super-admin | Gateway | Full access including RBAC changes | Break-glass only; vault the password |
admin | Gateway | Full access except the RBAC Admin API | A small platform team |
read-only | Gateway | Read access | Auditors, support |
workspace-super-admin / workspace-admin | One Workspace | Manage that Workspace's entities (and RBAC for super admin) | Team leads for that API domain |
workspace-read-only | One Workspace | Read that Workspace | Developers needing visibility |
workspace-portal-admin | One Workspace | Dev Portal endpoints only | Developer portal owners |
| Custom roles | Endpoints and entities | Specific actions on specific paths or entity IDs | Automation identities (decK, CI) per Workspace |
- Deny by default: RBAC checks rules from most to least specific and denies if nothing matches. Wildcards replace a single URL segment and are not globs, so
/rbac/*does not cover nested RBAC paths; test permissions rather than assuming. - Workspace inheritance: roles assigned in the
defaultWorkspace carry into later Workspaces unless those Workspaces assign their own. Avoid granting broad roles indefault. - Separate the super admin: the super admin only manages RBAC. Create named admins for day-to-day work so audit records show real identities.
- Open source deployments: keep
admin_listenon127.0.0.1, restrict with host firewall rules, and if remote access is needed, create a Service and Route in Kong that points to the local Admin API and protect it with an authentication plugin, the IP Restriction plugin and the ACL plugin, as Kong's own guide describes.
Admin API access is privileged access to every API behind the gateway. See the PAM Maturity Model.
Integrations, API tokens and service accounts
Consumer credentials
| Plugin | Credential | Main risk | Control |
|---|---|---|---|
| key-auth | Static API key per Consumer | Keys in query strings (on by default) end up in logs; keys never rotated | Set key_in_query false, keep key_in_header, set hide_credentials so the key is not forwarded upstream, rotate with overlapping keys |
| key-auth-enc (Enterprise) | API key stored encrypted at rest | Same as key-auth, but database theft exposes less | Prefer over key-auth where licensed |
| basic-auth | Username and password per Consumer | Password reuse, brute force | Use only for legacy clients; pair with rate limiting |
| hmac-auth | Shared secret used to sign requests | Shared secret theft | Clock skew limits, secret rotation |
| jwt | Consumer JWT credentials (key and secret or RSA public key) | HS256 shared secrets copied widely | Asymmetric keys, short token lifetimes |
| openid-connect (Enterprise) | Tokens from an external IdP | Misconfigured issuer or audience checks | Pin issuer and audience, use client credentials for services |
| mtls-auth (Enterprise) | Client certificate | Weak CA hygiene | Dedicated CA, revocation checks |
- Authorisation after authentication: any Consumer with a valid credential can reach the Service or Route the plugin protects. Kong recommends the ACL plugin with allow or deny groups to restrict which Consumers reach which APIs.
- Anonymous fallback: configuring an anonymous Consumer turns failed authentication into anonymous access. Only use it with a downstream plugin or upstream logic that treats
X-Anonymous-Consumeras untrusted. - Inventory and ownership: each Consumer should map to a named partner, application or service, with a technical owner and a review date. Unused Consumers with live keys are orphaned non-human identities. See the API Key Management Guide and the API Keys vs OAuth Tokens Guide.
Gateway secrets
- Vault references: Kong resolves references of the form
{vault://backend/key}inkong.confand referenceable plugin fields. Open source supports environment variables only; Enterprise adds AWS Secrets Manager, Google Cloud Secret Manager, HashiCorp Vault (token, Kubernetes and AppRole auth), Azure Key Vault, CyberArk Conjur (3.11+), file system (3.15+) and Konnect Config Store. Rotation is driven by TTLs on the Vault entity. - Keyring (Enterprise, on premises): with
keyring_enabled = onandkeyring_strategy = cluster, Kong encrypts certificate private keys and plugin fields marked encrypted before storing them. Admin API responses still show these values in plain text, so keyring protects the database, not the API. Disable swap on Kong hosts so keys are not written to disk, and protect the recovery private key. - Automation identities: decK, CI pipelines and the Kubernetes Ingress Controller all hold Admin API access. Give each its own RBAC user and custom role limited to its Workspace, store its token in the CI secret store, and never reuse the super admin token. See the GitOps Security Guide.
Hybrid mode
In hybrid mode only control plane nodes hold the database and serve the Admin API; data plane nodes receive configuration over mTLS and cache it in a local dbless.lmdb file, which is unencrypted by default. The default cluster_mtls = shared uses one certificate and key on every node, so stealing it from any data plane lets an attacker impersonate any node. Prefer pki or pki_check_cn (which also checks the certificate common name against cluster_allowed_common_names) so each data plane has its own certificate, and enable cache encryption. See the mTLS Guide.
Logging and detection
| Source | What it records | Configuration |
|---|---|---|
| Audit logs (Enterprise) | Admin API requests (/audit/requests) and database entity changes (/audit/objects), with rbac_user_id, rbac_user_name, Workspace, request_id and payload | audit_log = on; optional audit_log_signing_key (RSA) to sign entries; audit_log_ignore_methods, _paths, _tables; audit_log_record_ttl sets purge age |
| NGINX access and error logs | Admin API and proxy requests, source IPs, status codes | Ship off-host; strip sensitive fields per Kong's guidance on excluding sensitive log data |
| Logging plugins (http-log, file-log, tcp-log, syslog and others) | Per-request proxy logs including authenticated Consumer | Attach globally; ensure keys and tokens are not logged |
| Control plane connection logs (hybrid) | Data plane connections and certificate errors | Alert on unknown data plane nodes |
What to alert on
- Any Admin API request from an unexpected source: the Admin API should only be called from localhost, named automation hosts or the management network. Requests from elsewhere suggest exposure (T1190 Exploit Public-Facing Application).
- Plugin removal or disablement on Routes and Services, especially authentication, ACL, IP restriction and rate limiting plugins.
- New Consumers or credentials outside the provisioning pipeline, and new credentials on existing high-value Consumers (similar to T1098.001 Additional Cloud Credentials in effect).
- Route or upstream changes that point a Service at an unfamiliar host, a classic way to intercept traffic (T1557 Adversary-in-the-Middle).
- RBAC changes: new admins, new role assignments, super admin logins.
- Consumer behaviour: one key used from many IPs or countries, spikes in 401 responses per source (T1110.004 Credential Stuffing), or keys appearing in query strings in logs.
Metrics
- Admin exposure: gateway nodes with
admin_listenor Kong Manager reachable outside the management network (target 0). - Consumer ownership: Consumers with a recorded owner and review date (target 100 percent).
- Credential age: API keys and secrets older than the rotation policy.
- Query-string keys: share of key-auth plugin instances with
key_in_queryenabled (target 0 for service traffic). - Change attribution: share of configuration changes made by a named identity or pipeline rather than a shared token.
- Patch lag: days from a Kong security release to deployment, against Kong's version support policy.
Hardening baseline
- Network first: expose only 8000 and 8443 to clients. Bind
admin_listenandadmin_gui_listento localhost or a management interface, enforce with host and network firewall rules, and allow 8005 and 8006 only from data plane nodes. Test with an external port scan. - Admin authentication: on Enterprise, enable RBAC with
KONG_PASSWORDset, configure Kong Manager with SSO through OpenID Connect or LDAP, and create named admins and per-pipeline RBAC users. On open source, proxy the Admin API through Kong with authentication and IP restriction, or keep it local only. - Configuration as code: manage entities with decK or the Kubernetes Ingress Controller from a reviewed repository so every change has a commit and reviewer; treat manual Admin API changes as exceptions that alert.
- Consumer credentials: disable query-string keys, hide credentials from upstreams, prefer key-auth-enc, JWT with asymmetric keys, OpenID Connect or mTLS for new integrations, and apply ACL groups to every authenticated Route.
- Secrets: move
pg_password, plugin secrets and certificates to vault references; enable keyring where on premises; disable swap. - Hybrid mode: switch from
sharedtopkiorpki_check_cncertificates, encrypt the data plane cache, and protect control plane hosts as tier 0. - Logging: enable and sign audit logs, forward them and access logs to the SIEM before
audit_log_record_ttlpurges them, and scrub credentials from logs. - Patching: follow Kong's vulnerability and patching policy and version support policy; stage upgrades in a non-production cluster with the same plugins, keep the previous image and database backup for rollback.
Open source or Enterprise, small or large
- Open source, single team: no RBAC or audit logs, so the Admin API must stay on localhost, changes should only come through decK in CI, and the CI token for the proxied Admin API is the most sensitive secret you hold.
- Enterprise, many teams: Workspaces per API domain, Workspace-scoped roles, per-pipeline RBAC users, signed audit logs and hybrid mode with PKI certificates. Review RBAC grants quarterly.
Common misconfigurations
- Admin API on 0.0.0.0: often from container examples or Helm values copied into production, leaving full gateway control one request away. AI and LLM gateways show the same pattern: the LiteLLM MCP auth bypass exposed provider API keys, and a scan found internet-facing gateways still accepting a default master key.
- Kong Manager without RBAC: anyone who can log in can do anything through the Admin API.
- Keys in URLs: key-auth left with
key_in_queryon, so partner keys appear in proxy logs, analytics and browser history. - Authentication without ACL: every valid Consumer can call every API behind a Route that only has an authentication plugin.
- One super admin token for all automation: shared across CI, scripts and engineers, never rotated, and with no attribution in audit logs.
- Shared hybrid certificate: the same
cluster_certand key on every data plane, including those in less trusted networks.
Framework mapping
| Control area | NIST SP 800-53 Rev 5 | NIST CSF 2.0 | CIS Controls v8.1 | ISO/IEC 27001:2022 Annex A |
|---|---|---|---|---|
| Admin API exposure and RBAC | AC-3, AC-6, SC-7 | PR.AA-05 | 4.4, 6.8 | A.8.2, A.8.20 |
| Consumer credentials | IA-5, IA-9 | PR.AA-01 | 5.2, 6.3 | A.5.17 |
| Node certificates and keyring | IA-3, SC-12 | PR.DS-01 | 3.11 | A.8.24 |
| Audit logging | AU-2, AU-9 | DE.CM-09 | 8.2 | A.8.15 |
| Configuration management | CM-2, CM-3 | PR.PS-01 | 4.1 | A.8.9, A.8.32 |
Practitioner checklist
- Confirm only ports 8000 and 8443 are reachable by clients and that the Admin API and Kong Manager are not reachable from outside the management network.
- On Enterprise, enable RBAC with
KONG_PASSWORD, vault the super admin credential and create named admins. - On open source, keep
admin_listenon localhost or proxy it through Kong with authentication and IP restriction. - Give decK, CI and the ingress controller separate, Workspace-scoped RBAC identities.
- Disable
key_in_query, enablehide_credentialsand add ACL groups to every authenticated Route. - Record an owner and review date for every Consumer and remove unused credentials.
- Move gateway secrets to vault references and enable keyring on premises.
- Use
pkiorpki_check_cnfor hybrid mode and encrypt the data plane cache. - Enable signed audit logs and export them before the TTL purge, with alerts on plugin, route, Consumer and RBAC changes.
- Track Kong security releases and stage upgrades with a tested rollback.
Standards and references
- Kong: Secure the Admin API
- Kong: Gateway RBAC
- Kong: Gateway network and default ports
- Kong: Key Authentication plugin
- Kong: Gateway audit logs
- Kong: Secrets management
- Kong: Hybrid mode
- OWASP: API2:2023 Broken Authentication
Related NHI Mgmt Group resources: API Gateway Security Guide · API Key Management Guide · mTLS Guide · Rate Limiting and API Abuse Guide