# Secure Self-Service Custom Domains for Dev Portals
Vincent Le Goff
Software Engineer, Kong
In the Dev Portal world, offering users the ability to use their own domain is a milestone on our way to fully customized Dev Portals. Since Konnect-hosted portals are fronted by a Kong gateway, we looked to use our own plugins to achieve this feature.
## Leveraging the Open-Source ACME Plugin at SaaS Scale
When we first looked at the plugin, it had a couple of drawbacks that made it fall short of our needs. The first issue was a guardrail put in place by the plugin authors to prevent some cases of abuse, limiting it to function with only a small handful of common top-level domains (TLDs).
In our case, with a global and creative customer base, we need this list to be either dynamically configured or disabled completely since we don't want to limit our customers' choice about what TLD they could use for their Konnect Dev Portals – not to mention the performance issues when parsing a large allow-list of TLD patterns. [This pull request](https://github.com/Kong/kong/pull/9047)This pull request was implemented to disable the allow-list check.
A second drawback with the plugin and the implementation disabling the allowed TLD check is that it would allow certificates using the IPv4 address as the certificate common name, and some providers don't support this. Some Kong users, like us, would not want this to be possible with the ACME plugin. [This pull request](https://github.com/Kong/kong/pull/9183)This pull request added an option to deny these types of certificates, by matching on the SNI to determine if it is an IPv4 address, which we enable on our Kong gateway fronting our Konnect Dev Portals.
## Guarding Against Certificate Issuing Abuses
While these changes to the ACME plugin make it very flexible for our requirements, in this configuration it also opens up the possibility of a malicious user deliberately misusing the gateway to flood our certificate provider with requests and ACME challenges, surely resulting in bad outcomes for our relationship with our certificate provider. For example:
#!/bin/bash
# Get the addr for the Konnect portal gateway
IP=$(dig us.portal.konghq.com +short | tail -1)
# Many TLS connections with different domain names
for i in {1..1000}do
curl -L https://foo$i.com \ --resolve foo$i.com:443:$IP \
--verbose
done
With the current state and configuration of the ACME plugin, this script would cause the gateway to provision certificates for the fake domains and would likely disrupt service for legitimate traffic in the process. This attack cannot be mitigated by application logic in the upstream implementation either, since the ACME plugin intervenes using SNI while the TLS connection is still being negotiated – all in the gateway.
function beforeTLSHandshakePlugin:certificate(conf)
- plugin logic
local host, err = ngx_ssl.server_name()
If not lookupUrl(host) then
return ngx.exit(ngx.HTTP_NOT_FOUND)
end
end
This function runs if the SNI is not cached in the `certificate` phase, before the ACME plugin thanks to our priority setting. It simply checks the SNI with `lookupUrl` which verifies the name exists in our Konnect database. If the customer configured things correctly, the entry will exist and this function will return with no effect, allowing the ACME plugin to proceed and cache the SNI and associated certificate. Otherwise, we close the connection without any HTTP error code because no TLS connection was ever fully established.
Plugin logic:
How it looks in the end:
In this case what happens if I try to request a non-existing portal?
In this example we try to access a non-existing portal and, with the verbose argument, we can see that the TLS handshake is initiated by the client with “hello” and fails with an error because the server does not answer properly. This happens because we call the “ngx.exit” routine after `lookupUrl` fails. So we break the handshake and then the connection.
## End User Tasks
Now, with all the above features implemented, the service administrator has only two tasks:
- Add a CNAME in the the domain's DNS configuration to resolve to the Konnect-generated portal URL which is found in the "Portal URL" settings page for the Dev Portal (allowing the URL to resolve to the Konnect IP):
$ dig portal.my-awesome-api.com +noall +answer 16:45:41; <<>> DiG 9.10.6 <<>> portal.my-awesome-api.com +noall +answer
;; global options: +cmd
portal.my-awesome-api.com. 14400 IN CNAME konghq-vincent2d386ab7.portal.konghq.com.
konghq-vincent2d386ab7.portal.konghq.com.300INCNAMEus-east-2.portal.origin.konghq.com.
us-east-2.portal.origin.konghq.com. 60 IN A3.21.8.6us-east-2.portal.origin.konghq.com. 60 IN A3.12.223.251us-east-2.portal.origin.konghq.com. 60 IN A3.143.85.249
- Enter the custom domain in the "Portal URL" setting for the Dev Portal (allowing `lookupUrl` to work and the certificate to be provisioned):
Once the DNS settings are propagated, the custom portal is accessible!
How Kong Gateway 3.14 closes the consistency gap in IAM-based authentication across AWS, Azure and GCP — and what it means for your production deployments
Starting with 3.13 (which addressed Redis support) and completed in 3.14, Kong now presents
Traditional APIs are, in a word, predictable. You know what you're getting: Compute costs that don't surprise you Traffic patterns that behave themselves Clean, well-defined request and response cycles AI APIs, especially anything that runs on LLMs
Running Kong in front of your Solace Broker adds real benefits: Authentication & Access Control – protect your broker from unauthorized publishers. Validation & Transformation – enforce schemas, sanitize data, and map REST calls into event topics.
MCP is an open standard that defines how AI clients communicate with remote servers. It provides a standardized protocol for clients like Claude, Cursor, or VS Code to access tools, resources, and capabilities from external systems. Currently, MCP
Free collaboration with Postman — a myth On March 1st, 2026, Postman discontinued free collaboration for small teams. Now , Git or Cloud-native collaboration requires a Team plan starting at $19 per person per month. That means even a 3-person team
The widespread adoption of Kafka and event streaming platforms is evident across several enterprises, where they serve as the backbone of critical operations, ranging from financial transactions to AI inference pipelines. However, in the domains of
🚧 The challenge: Scaling GenAI with governance While building a GenAI-powered agent for one of our company websites, I integrated components like LLM APIs, embedding models, and a RAG (Retrieval-Augmented Generation) pipeline. The application was d