For the complete documentation index, see llms.txt. This page is also available as Markdown.

Deploy mini-runtime and Kafka on ECS

Deploy the Akto mini-runtime, Kafka, and threat detection on Amazon ECS.

Deploy the Hybrid SaaS traffic aggregator as one ECS service. The task runs Kafka, mini-runtime, threat detection, and Redis.

Run one task. Each extra task starts another Kafka broker with its own disk, and the load balancer can send the next client connection to a different task. Mini-runtime only reads the Kafka inside its own task, so that traffic is lost.

Container
Image
Role

kafka

public.ecr.aws/aktosecurity/confluentinc-cp-kafka:8.2.0-1-ubi9

Receives API logs from traffic connectors

akto-mini-runtime

public.ecr.aws/aktosecurity/akto-api-security-mini-runtime:latest

Reads Kafka and sends traffic to Akto Cloud

threat-detection

public.ecr.aws/aktosecurity/akto-threat-detection:latest

Threat detection for the hybrid runtime

redis

public.ecr.aws/aktosecurity/redis:latest

Local store for threat detection

Containers in the task share one network namespace. Mini-runtime, threat detection, and Redis use 127.0.0.1. Traffic connectors use the load balancer DNS name.

Prerequisites

  1. Go to app.akto.io and open Quick Start > Hybrid SaaS Connector > Connect.

  2. Copy the database abstractor token. The same value is used for DATABASE_ABSTRACTOR_SERVICE_TOKEN and AKTO_THREAT_PROTECTION_BACKEND_TOKEN.

  3. Use an ECS cluster whose tasks can reach the internet. Mini-runtime calls https://ultron.akto.io. Threat detection calls https://tbs.akto.io.

  4. Create two security groups.

    1. Load balancer: inbound TCP 9092 from your traffic connectors.

    2. Task: inbound TCP 9092 from the load balancer security group, and outbound traffic so the task can reach Akto Cloud.

Create the load balancer

Create an internal Network Load Balancer before the task. Its DNS name is what Kafka advertises, and connectors keep using that name when ECS replaces the task.

  1. Create a target group. Target type is ip. Leave it empty. The ECS service registers the task.

  1. Create the load balancer in the subnets the service will use. Use at least two Availability Zones. Copy the DNS name. That value is <NLB_DNS>.

  1. Turn on cross-zone load balancing so connectors in any subnet reach the task.

  1. Forward TCP 9092 to the target group.

Register the task definition

AmazonECSTaskExecutionRolePolicy cannot create a log group. Add that permission once. The task creates /ecs/akto-mini-runtime on startup.

In the JSON below, replace <NLB_DNS> with the load balancer DNS name, <DATABASE_ABSTRACTOR_SERVICE_TOKEN> with the dashboard token, <aws-region>, and <ecsTaskExecutionRoleArn>. Replace <your_mini_runtime_name> with a name such as staging_runtime, or delete that environment entry.

The Kafka command starts the broker, then creates the akto.api.logs topic. Kafka advertises <NLB_DNS>:9092. The other containers use 127.0.0.1:19092.

Register it with the AWS CLI or paste it into the ECS console as a new task definition revision:

Create the service

Create an ECS service from the akto-mini-runtime task definition and attach the kafka container to the target group. Leave the desired count at 1. The grace period gives Kafka time to open port 9092 before a failed health check fails the deployment.

Set assignPublicIp to ENABLED when the subnets have no NAT gateway. Without a public IP or a NAT gateway, Fargate cannot pull the images or reach Akto Cloud.

Wait until the target group is healthy and all four containers are running.

Send traffic to this Kafka broker

On each traffic connector, set:

Example: akto-kafka-a1b2c3.elb.ap-south-1.amazonaws.com:9092.

Notes

  1. When ECS replaces the task, it registers the new IP on the same load balancer. Connectors keep the same AKTO_KAFKA_BROKER_MAL.

  2. Broker log data does not survive a new task.

  3. In a closed network, allow outbound HTTPS to https://ultron.akto.io and https://tbs.akto.io.

Get Support for your Akto setup

There are multiple ways to request support from Akto. We are 24X7 available on the following:

  1. In-app intercom support. Message us with your query on intercom in Akto dashboard and someone will reply.

  2. Join our discord channel for community support.

  3. Contact help@akto.io for email support.

  4. Contact us here.

Last updated