Skip to main content

Test Runner

Running Security Tests with Levo.ai

Levo provides you with the ability to run security tests on your application endpoints. These tests can be executed in the following environments:

  • On the Cloud
  • On Premises

Requirements for Running Security Tests

To successfully run security tests, you need:

  1. A target service URL that is reachable.
  2. A valid configuration for authenticated endpoints.
  3. Valid API endpoint parameters.

Testing Publicly Reachable Services

If your target service is publicly accessible, you can directly run security tests from the Levo Cloud.

Testing Internal Services

For internal services that are not publicly reachable, you can use the Levo Testrunner. The testrunner is a service that can be installed on your premises.

Once you initiate security tests from the Levo UI, the testrunner will:

  • Pull the tests to your premises.
  • Execute them internally.

This approach ensures secure testing of internal APIs.


Installation

You can install the testrunner

Prerequisites

Before installation, ensure the following:

  1. Levo Authorization Token: Refer to Generating CLI Authorization Keys.
  2. Organization ID: Refer to Accessing Organization IDs.
  3. Helm or Docker: Install the appropriate tool based on your chosen installation method.

Install Testrunner via Helm on Kubernetes

Follow these steps to install the testrunner in a Kubernetes environment:

  1. Add Levo Helm Repository:
helm repo add levoai https://levoai.github.io/helm-charts/
  1. Install the Testrunner Helm Chart:
helm install \
--set key="auth-key" \
--set orgId="organization id" \
--set levoBaseUrl="https://api.levo.ai" \
testrunner levoai/testrunner
info

For apps hosted in different regions, update the levoBaseUrl. For example, if the testrunner is used with app.india-1.levo.ai:

helm install \
--set key="auth-key" \
--set orgId="organization id" \
--set levoBaseUrl="https://api.india-1.levo.ai" \
testrunner levoai/testrunner

Install Testrunner via Docker

If Docker is installed on your machine, follow these steps to start the testrunner:

  1. Download the
    Loading...
    script.
  2. Make the script executable:
chmod +x levoai-testrunner.sh
  1. Set the required environment variables:
export LEVOAI_AUTH_KEY='<your-auth-key>'
export LEVOAI_ORG_ID='<your-organization-id>'
  1. Start the testrunner:
./levoai-testrunner.sh start
note

If you are running the script with sudo, ensure that the environment variables are also set with sudo. Otherwise, the script will not have access to these variables.

Alternatively, you can use the -E flag with sudo to preserve the user-defined environment variables, like this:

sudo -E ./levoai-testrunner.sh start

This ensures the script can access the required environment variables without explicitly redefining them under sudo.

  1. Stop the testrunner:
./levoai-testrunner.sh stop
info

For apps hosted in different regions, set the environment variable LEVOAI_BASE_URL.

export LEVOAI_BASE_URL='https://api.india-1.levo.ai'

Need Help?

For further assistance, please reach out to Levo.ai Support.