Blog
  • AI Gateway
  • AI Security
  • AIOps
  • API Security
  • API Gateway
|
    • API Management
    • API Development
    • API Design
    • Automation
    • Service Mesh
    • Insomnia
    • View All Blogs
  1. Home
  2. Blog
  3. Engineering
  4. 3 Ways to Protect Your APIs With Kong Konnect and Fastly (Signal Sciences)
Engineering
April 27, 2021
6 min read

3 Ways to Protect Your APIs With Kong Konnect and Fastly (Signal Sciences)

Claudio Acquaviva
Principal Architect, Kong

Fastly's next-gen WAF (formerly Signal Sciences) integrates with Kong Konnect to block malicious requests to your services. Kong Gateway provides a robust and secure enterprise API management platform to front web traffic. In partnership, Fastly focuses on Layer 7 application security for that traffic. This article will explain how Kong Konnect and Fastly work together.

Fastly's Cloud Engine Architecture (Formerly Signal Sciences)

The above diagram shows a high-level view of the Fastly Cloud Engine architecture. On the left, you would have a Kong Gateway connected to the Fastly plugin. Once connected, Fastly runs an agent as a sidecar container. Whenever Kong Gateway gets an incoming request, the Fastly plugin will immediately get invoked and pass that request over to that agent.

In 1-3 milliseconds, the agent will inspect the request locally. During that time, if the agent sees a request that contains some sort of attack, such as an SQL injection, it’s going to sanitize it by redacting any sensitive fields. By default, the agent redacts usernames, passwords, credit card numbers, etc. Asynchronously, the agent pushes the metadata of that request to the cloud agent to aggregate that attack data across all the different agents in your environment.

In addition to that, Fastly pulls in feeds of information (middle of the diagram above).

  • External Sources include anything from data center IPs, known malicious IPs and Tor nodes.
  • Customer Sources will be specific to the customer, including IPs or countries you may want to block.
  • Fastly NLX (Network Learning Exchange) is the threat intelligence feed.

All this information is made available through the Fastly management console on the right side of the above diagram. In the UI, you can see all this data, edit rules and modify lists. Or you can also do all of this through the Fastly API.

Kong Konnect and Fastly Architecture

Before I dive into some use cases, look at the above diagram, which shows my demo environment's topology. I have installed Kong Konnect and the Fastly Cloud Engine at the admin layer, where admins can define policies. My Kong data plane is going to receive requests from our external consumers.

Konnect will be responsible for some policies related to the API gateway layer. The Fastly agent will be responsible for some other policies, therefore connecting to the cloud engine to ensure that the request is good to be routed upstream.

The steps from a high level go like this:

  1. Kong Gateway and Fastly create policies.
  2. The control plane publishes policies to the data plane.
  3. A consumer sends requests to the data plane.
  4. The data plane applies the Kong Gateway policies.
  5. The Fastly agent enforces the specific policies defined in the Fastly Cloud Engine.

If both policies are OK, Kong Gateway will pass along the request of the upstream microservices.

Now that I've explained how Kong Konnect and Fastly work together to protect your APIs and services, let's go into a few practical use cases.

Kong Konnect and Fastly Use Case #1: Malicious SQL Injection

In my example, I have multiple routes already defined. I use these routes to expose some paths to my external customers. Consumers will use this path to send requests to the API gateway.

Kong Konnect and Fastly Routes

I've already set up the Fastly plugin and applied it globally. That means Kong Gateway and Fastly will confirm all requests are good to route upstream.

Kong Konnect and Fastly Plugins

To start sending requests to Kong Gateway, you can use Insomnia, our API spec editor.

To set up a simple use case, you could try the API key policy. To consume a route, you'll have to inject an API key inside the request. Once you send a request, you should get a 200. If you don't inject the API key first, you should receive a 401, meaning the API gateway won't allow you to consume the upstream.

Kong Konnect API Key Testing in Insomnia

What if your query push on the request received a malicious SQL injection request to the API gateway? Somehow you must identify the type of threat and prevent these requests from being consumed by your API gateway and services. If you have the Fastly plugin, it should take care of this and give you a 406, meaning Fastly recognizes that the request is malicious and will not allow your gateway or applications to consume it.

Kong Konnect and Fastly: Testing a Malicious SQL Injection in Insomnia

In the Fastly Next-Gen WAF management console, you should see a site rule defined to prevent this exact SQL injection threat. More than that, you should see reports of the other threats that Fastly have identified.

Fastly prevent SQL injection threat

Kong Konnect and Fastly Use Case #2: FinTech Account Enumeration

In the following example, I have a module running in Kong Konnect and an agent plugged in. I also have an app that might handle transferring of funds or payments.

Kong Konnect and Fastly API spike for fund transfers

In Fastly, you can set up rules around those APIs to look for a spike in fund transfers. For example, in eCommerce, you may have a credit card validation endpoint. An attacker can enumerate through different credit card numbers, trying to validate them against your API. Fastly stops those types of attacks.

Fastly Site Rules dashboard

To demonstrate this, I have a FinTech workspace. In this app, I can view my account summary, transfer funds, login, etc.

Under site rules, I set up various use cases with the rules builder. Here you can specify conditions based on the HTTP request, including the IP address, method, POST or GET, etc. You can use all these different parameters to define a custom rule and choose to block, allow, get visibility or rate limit actions.

In my FinTech example, this endpoint shows me my account summary, and it’s a GET request to this endpoint. There’s a query parameter involved. And we’re checking the response codes to see if it’s a 200 or 500. I'm rate limiting this activity after six queries in one minute.

Suppose somebody is enumerating through different account numbers at a velocity greater than six in a minute. In that case, the system will block that activity and that IP from viewing any account information.

Fastly View or Edit Site Rules Dashboard

To test this, I'll try transferring $300 within my purposely vulnerable demo application. I can change this account number in the URL and see other users' accounts that aren't necessarily mine. I can enumerate through different accounts and get back the information that I really shouldn’t be getting.

Fastly protects against this type of attack. After the third request, you should stop getting 200 responses and start getting 406 responses, meaning Fastly started to block after reaching that threshold.

Fastly Account Enumeration Protection

In the Fastly console, you should see those account summaries and the requests that Fastly stopped. You could dive deeper and see the request, user agent and IP that it came from and complete metadata.

Kong Konnect and Fastly Fintech Example

Kong Konnect and Fastly Use Case #3: FinTech Account Takeover

My final example takes a look at account takeover. Here I ran the same script as I did in use case #2 with one exception. This time I can run it for the login failure use case. That means making many login attempts with an incorrect username and password.

Eventually, this should trip a threshold and start getting blocked. Initially, you would get back 200s, but after the tenth request, you should start getting back a 406. That means the system failed to log in too many times and had too high a request velocity. If I try to log in to the application now, I get blocked.

Kong Konnect and Fastly fintech account takeover example

In each of these use cases, we were able to customize Fastly rules and define them based on the application and the business logic.

Request a demo to learn more about the Fastly plugin for Kong Konnect.

Kong KonnectAPI Security

More on this topic

Videos

PEXA’s Resilient API Platform on Kong Konnect

Webinars

Quarterly Platform Updates & Roadmap Webinar

See Kong in action

Accelerate deployments, reduce vulnerabilities, and gain real-time visibility. 

Get a Demo
Topics
Kong KonnectAPI Security
Share on Social
Claudio Acquaviva
Principal Architect, Kong

Recommended posts

Kong Cloud Gateways: A Year in Review

Kong Logo
Product ReleasesDecember 17, 2025

A quick refresher: Kong Cloud Gateways Kong Cloud Gateways are fully managed, high-performance data planes running on customer-dedicated infrastructure, orchestrated and operated by Kong through Kong Konnect . Customers can choose between: Serverle

Josh Wigginton

Ensuring Tenant Scoping in Kong Konnect Using Row-Level Security

Kong Logo
EngineeringApril 22, 2025

In the SaaS world, providers must offer tenant isolations for their customers and their data. This is a key requirement when offering services at scale. At Kong, we've invested a lot of time to provide a scalable and seamless approach for developers

Vincent Le Goff

APISecOps Tutorial: Delivering APIs Securely Together with Kong Konnect and Red Hat OpenShift Service on AWS (ROSA)

Kong Logo
EngineeringFebruary 23, 2023

Red Hat OpenShift is the industry's leading enterprise Kubernetes platform that runs ubiquitously across on-prem, and the cloud. With Red Hat OpenShift Service on AWS (ROSA) , a managed Red Hat OpenShift platform that runs natively on AWS, it is

Danny Freese

AI Voice Agents with Kong AI Gateway and Cerebras

Kong Logo
EngineeringNovember 24, 2025

Kong Gateway is an API gateway and a core component of the Kong Konnect platform . Built on a plugin-based extensibility model, it centralizes essential functions such as proxying, routing, load balancing, and health checking, efficiently manag

Claudio Acquaviva

Farewell Ingress NGINX: Explore a Better Path Forward with Kong

Kong Logo
EngineeringNovember 14, 2025

"To prioritize the safety and security of the ecosystem, Kubernetes SIG Network and the Security Response Committee are announcing the upcoming retirement of Ingress NGINX . Best-effort maintenance will continue until March 2026. Afterward, there w

Justin Davies

Merge API Management & Identity to Unlock Your API Platform's Potential

Kong Logo
EnterpriseOctober 7, 2025

The challenge: A disconnected world Consider the typical enterprise architecture in a relatively mature organization, an API management layer defines and deploys services to an API gateway, an Identity Provider (IDP) manages human user identities, a

Dan Temkin

Enable Enterprise-Wide Agentic Access to APIs

Kong Logo
EnterpriseOctober 3, 2025

Feed Agents (and humans, too) with *all* of your APIs While multi-gateway vendor deployments have been found to be lacking as a long-term strategy, the reality is that every large organization is — at some point — going to struggle with trying to wr

Alex Drag

Ready to see Kong in action?

Get a personalized walkthrough of Kong's platform tailored to your architecture, use cases, and scale requirements.

Get a Demo
Powering the API world

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

Sign up for Kong newsletter

    • Platform
    • Kong Konnect
    • Kong Gateway
    • Kong AI Gateway
    • Kong Insomnia
    • Developer Portal
    • Gateway Manager
    • Cloud Gateway
    • Get a Demo
    • Explore More
    • Open Banking API Solutions
    • API Governance Solutions
    • Istio API Gateway Integration
    • Kubernetes API Management
    • API Gateway: Build vs Buy
    • Kong vs Postman
    • Kong vs MuleSoft
    • Kong vs Apigee
    • Documentation
    • Kong Konnect Docs
    • Kong Gateway Docs
    • Kong Mesh Docs
    • Kong AI Gateway
    • Kong Insomnia Docs
    • Kong Plugin Hub
    • Open Source
    • Kong Gateway
    • Kuma
    • Insomnia
    • Kong Community
    • Company
    • About Kong
    • Customers
    • Careers
    • Press
    • Events
    • Contact
    • Pricing
  • Terms
  • Privacy
  • Trust and Compliance
  • © Kong Inc. 2025