Connect Akto with Docker

Introduction

You can add akto-traffic-collector service to your docker-compose file. Your APIs from this traffic will show up in Akto dashboard.

Creating AWS Policy

1. Go to Quick Start on your Akto dashboard and expand the Connect traffic data section.

2. Scroll down to Data processors setup section.

3. Copy the policy json and click on the Akto Dashboard role link.

4. Click on the JSON tab and paste the policy

5. Click on Review policy button.

6. Enter AktoDashboardPolicy as the policy name and click on Create Policy button

8. Once the policy is created, go back to the dashboard.

Setting up Data processors

1. Click on Setup traffic processors button.

2. This will bring up infra that will process your traffic.

3. Check that you have AKTO_NLB and AKTO_MONGO_IP vars once setup is complete.

Adding Akto docker service

1. Create a file docker-akto-collector.env with the following content. Replace <AKTO_NLB> and AKTO_MONGO_IP by the values shown on the dashboard.

AKTO_TRAFFIC_BATCH_TIME_SECS=10
AKTO_TRAFFIC_BATCH_SIZE=100
AKTO_INFRA_MIRRORING_MODE=gcp
AKTO_KAFKA_BROKER_MAL=<AKTO_NLB>:9092
AKTO_MONGO_CONN=<AKTO_MONGO_IP>
  1. Add the following service to your docker-compose file. Adjust the mem_limit accordingly.

  akto-api-security-traffic-collector:
    image: aktosecurity/mirror-api-logging:k8s_agent
    env_file: ./docker-akto-collector.env
    mem_limit: 300m    
    restart: always
    network_mode: host

Last updated