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.
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
Go to app.akto.io and open Quick Start > Hybrid SaaS Connector > Connect.
Copy the database abstractor token. The same value is used for
DATABASE_ABSTRACTOR_SERVICE_TOKENandAKTO_THREAT_PROTECTION_BACKEND_TOKEN.Use an ECS cluster whose tasks can reach the internet. Mini-runtime calls
https://ultron.akto.io. Threat detection callshttps://tbs.akto.io.Create two security groups.
Load balancer: inbound TCP
9092from your traffic connectors.Task: inbound TCP
9092from 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.
Create a target group. Target type is
ip. Leave it empty. The ECS service registers the task.
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>.
Turn on cross-zone load balancing so connectors in any subnet reach the task.
Forward TCP
9092to 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
When ECS replaces the task, it registers the new IP on the same load balancer. Connectors keep the same
AKTO_KAFKA_BROKER_MAL.Broker log data does not survive a new task.
In a closed network, allow outbound HTTPS to
https://ultron.akto.ioandhttps://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:
In-app
intercomsupport. Message us with your query on intercom in Akto dashboard and someone will reply.Join our discord channel for community support.
Contact
help@akto.iofor email support.Contact us here.
Last updated