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

Install testing module in your Cloud

Introduction

API Security testing involves sending malicious API requests to your (staging) server. By default, these malicious testing requests are sent from the Testing module installed within Akto Cloud.

There could be multiple reasons why you'd want to install testing module within your Cloud.

  1. Whitelisting Akto's IP in Security Group or WAF isn't an option

  2. The staging server isn't reachable from public domain

  3. The WAF would block most requests (or block Akto's IP)

  4. The API domain isn't resolvable from public domain

  5. The API is completely internal

Testing from Customer Cloud

  1. Login to Akto dashboard at app.akto.io

  2. Go to Quick Start > Hybrid Saas > Click on “Connect” button

  3. Copy the JWT token (marked in red) [ Also referred as Database Abstractor Token later]

You can now use a Helm-chart to install Akto Security Testing module in your cloud or install manually

Terraform

  1. To install using Terraform, use the Terraform script here.

    1. Please make sure you install it in a private subnet from your application VPC.

    2. This private subnet should also have network connectivity (typically via NAT).

  2. For Database Abstractor Service Token input in the terraform script specify the JWT token copied in the earlier step.

  3. Once the terraform script has finished running, you should be able to see a new autoscaling group created with 1 Akto Testing EC2 instance running.

Helm-chart

Akto's helm chart installation

  1. Add akto helm repository.

Note: If you've already added akto helm repository, update the helm repository using:

  1. Using the dashboard abstractor token saved in the above steps, deploy the helm chart below.

Note: If you want to modify the helm chart according to your needs, you can clone the same from mini-testing-helm-chart

Setup Autoscaling for Testing Module Pods

If you don't need autoscaling, skip this section.

Autoscaling enables parallel test runs via multiple Kubernetes pods that scale based on workload.

The steps below use Prometheus and KEDA. If you can't install those in your cluster, see Autoscaling without Prometheus or KEDA.

Step 1: Verify Prometheus is Installed

Autoscaling requires Prometheus to collect and query metrics. Choose one of the following options:

Option A: In-Cluster Prometheus (kube-prometheus-stack)

If you have kube-prometheus-stack installed in your cluster, identify these details:

You'll need:

  • Namespace (e.g., monitoring)

  • Service name (e.g., prometheus-kube-prometheus-prometheus)

  • Port (e.g., 9090)

Option B: Grafana Cloud Prometheus

If using Grafana Cloud, you'll need:

  • Query URL (e.g., https://prometheus-prod-XX.grafana.net/api/prom)

  • Username (numeric instance ID)

  • Read API token

Note: For Grafana Cloud, you'll also need to deploy a metrics collector in your cluster. Contact Akto support for assistance with Grafana Cloud setup.

Important - Metrics Collection Configuration:

When configuring your metrics collector (e.g., Grafana Alloy) for Grafana Cloud, ensure you do not add container labels to scraped metrics. This is critical to prevent metric duplication.

Technical context:

  • Pods are scraped at the pod IP level (all containers in a pod share the same network namespace)

  • Only ONE container per pod serves metrics on the specified port

  • Adding container labels artificially creates duplicate time series for all containers in the pod, even though metrics originate from a single container

Example issue: A pod with 4 containers (app, sidecar, kafka, zookeeper) would generate 4 time series per metric instead of 1, causing incorrect aggregations like avg().

Before deploying to production, verify:

  1. Only ONE container per pod exposes metrics on the annotated port (e.g., port 9400)

  2. The prometheus.io/port annotation matches the actual metrics endpoint port

  3. Your metrics queries do not filter by container label (use pod or namespace labels instead)

  4. Your metrics collector configuration does NOT include rules that add container labels

Example of what to AVOID in your collector configuration:

If you need per-container metrics, configure your collector to scrape at the container level with unique ports for each container.

Step 2: Install KEDA

KEDA monitors Prometheus metrics and automatically scales pods based on workload.

Note: If you get an error Error: UPGRADE FAILED: no RoleBinding with the name "keda-operator" found, simply re-run the upgrade command.

Step 3: Install/Upgrade Akto Mini-Testing

Option A: With In-Cluster Prometheus

Example:

Option B: With Grafana Cloud Prometheus

Example:

Note: For Grafana Cloud setup, contact Akto support for assistance with metrics collection and obtaining credentials.

Verify Autoscaling

Autoscaling without Prometheus or KEDA (orchestrator mode)

If Prometheus and KEDA can't be installed in your cluster, use orchestrator mode instead. The chart then runs mini-testing-orchestrator, one small Deployment in the release namespace. It needs no CRDs, no cluster-wide RBAC and no metrics stack, only a Role in that namespace.

The orchestrator checks each mini-testing pod for whether it is running a test:

  • Scale up: while every pod is busy, it adds a pod (scaleUpStep per check), up to maxReplicas.

  • Scale down: pods that have been idle for scaleDownDelay are told to stop taking tests, then removed. A pod running a test is never removed. While any test is running, one idle pod is kept ready for the next one.

  • If something goes wrong: the replica count never drops below minReplicas. If the orchestrator stops, the mini-testing pods keep running and testing at their current count.

Install

In this mode:

  • The mini-testing pods use the local image tag (testing.autoScaling.orchestrator.testingImageTag), because the orchestrator needs a recent mini-testing release.

  • The orchestrator image is public.ecr.aws/aktosecurity/akto-mini-testing-orchestrator:1.0.0.

  • The kubePrometheus and grafanaCloud values are ignored, and no ScaledObject or ServiceMonitor is created.

Moving an existing install from KEDA: run the upgrade above while no tests are running. The chart stops setting the replica count, so Kubernetes resets it to 1 once, and the orchestrator scales up from there. Afterwards, uninstall KEDA if nothing else uses it.

Settings

Optional, under testing.autoScaling.orchestrator:

Value
Default
Meaning

pollInterval

15s

How often pods are checked

scaleDownDelay

5m

How long a pod must be idle before it is removed

scaleUpStep

1

Pods added per check while all pods are busy

notReadyGrace

10m

A pod not ready for longer than this is treated as broken and can be removed, so one crashlooping pod can't keep extra pods running

stuckAfter

10m

Scaling that stays held for longer than this (for example, a pod not answering, or every pod busy at maxReplicas) is reported, with a hint

reportToAkto

true

Send scaling events, held-scaling warnings and errors to the Akto dashboard, using the module's token

heartbeat

false

Show the orchestrator under Settings → Module Info, with its last heartbeat and current scaling state

testingImageTag

local

mini-testing image tag used in this mode. Set it to "" to use testing.aktoApiSecurityTesting.image.tag instead.

image.tag

1.0.0

Orchestrator image tag

controlToken.existingSecret

""

Secret holding the token the mini-testing pods require from the orchestrator. If empty, the chart generates one and keeps it across upgrades. Set this when deploying with Argo CD or another tool that can't run Helm lookup.

Check it

  • In the Akto dashboard: go to Settings → Logs and choose Mini Testing Orchestrator. It shows each scale up and down, held scaling with a hint, errors, and a status summary every 5 minutes.

  • In the cluster:

Uninstalling

IMPORTANT: Always uninstall Helm releases BEFORE deleting the namespace. Deleting the namespace first will leave orphaned cluster-scoped resources that will cause conflicts when reinstalling.

Correct Uninstall Order

Troubleshooting: Recovering from Incorrect Uninstall

If you deleted the namespace before uninstalling KEDA, you'll encounter errors when trying to reinstall. Follow these steps to recover:

1. Namespace Stuck in Terminating State

2. Clean Up Orphaned KEDA Resources

When a namespace is deleted before uninstalling KEDA, cluster-scoped resources remain with old namespace annotations, causing installation failures.

3. Reinstall KEDA Cleanly

4. Reinstall Mini-Testing

Follow the installation steps from Step 3: Install/Upgrade Akto Mini-Testing above.

Linux VM

  1. Create a new instance with the following requirements

    1. Platform

      1. Linux

    2. Spec

      1. 2 vCPU

      2. 4GB RAM

      3. 20GB Hard disk

      4. Don’t use burstable instances

    3. Network

      1. Private subnet

      2. connectivity to internet (typically via NAT)

      3. connectivity to your staging service

    4. Security groups

      1. Inbound - No ports required

      2. Outbound - Open all

  2. SSH into this new instance in your Cloud

  3. Run sudo su -

  4. Install docker and docker-compose.

  5. Paste the following in docker-compose-testing.yml file. Use token from step(3) for DATABASE_ABSTRACTOR_SERVICE_TOKEN value. Don't use double-quotes

  6. Run docker-compose -f docker-compose-testing.yml up -d .

  7. Run systemctl enable /usr/lib/systemd/system/docker.service to ensure Docker starts up in case of instance restarts

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