+
+ #!/bin/bash
+
+ echo "METLO_ADDR=http://{"<"}YOUR_METLO_HOST{">"}
+ :8081" {">>"} /opt/metlo/credentials
+
+
+ echo "METLO_KEY={"<"}YOUR_METLO_API_KEY{">"}"{">>"}
+ /opt/metlo/credentials
+
+ sudo systemctl enable metlo-ingestor.service
+ sudo systemctl start metlo-ingestor.service
+
+
+
+ $ npm i -g @metlo/cli
+
+
+
+ $ metlo traffic-mirror aws
+ ✔ Select your AWS region · us-west-2 ✔
+
+ Enter your AWS Access Key ID · {""}
+
+
+ ✔ Enter your AWS Secret Access Key ·
+ {" "}
+
+ Verifying Keys...
+ Success!
+
+ ✔ What type of source do you want to mirror? · instance
+
+
+ ✔ Enter the id of your source ·i-xxxxxxxxxxxxxxxxx
+
+ Finding Source...
+ Success!
+
+ ✔ Enter the id of your Metlo Mirroring Instance: ·
+ i-xxxxxxxxxxxxxxxxx
+
+ Creating Mirror Session
+ ... Success!
+
+
+
+
+
+ $ export PROJECT_ID={'"<'}YOUR_PROJECT_ID{'>"'}
+
+
+ $ gcloud compute instances create metlo-api-security
+ --image-family=metlo-api-security --image-project=metlo-security
+ --project=$PROJECT_ID --machine-type e2-standard-2
+
+
+
+
+ {" "}
+ $ sudo metlo start
+
+
+ $ npm i -g @metlo/cli
+
+
+
+ $ metlo traffic-mirror gcp
+ ✔ GCP Project Name · metlo-security
+ ✔ GCP Network to mirror · default
+ ✔ Select your GCP zone · us-central1-a
+
+ ✔ Path to GCP key file ·{"<"}PATH TO GCP KEY FILE{">"}
+
+ ✔ Validated account details
+ Validated account details succesfully
+ ✔ Select your mirror source type · SUBNET
+
+ ✔ Enter the mirror source subnet name · default
+
+ ✔ Verified mirror source details
+ ✔ Created destination subnet
+ ✔ Created Firewall rule
+ ✔ Obtained router details
+ ✔ Mirror Instance Type · e2-standard-2
+
+ ✔ Metlo URL · {"<"}METLO_URL_HERE{">"}
+
+
+ ✔ Metlo API Key · {"<"}METLO_API_KEY_HERE{">"}
+
+ ✔ Created MIG for metlo
+ ✔ Created health check
+
+ ✔ Creating Backend service for packet mirroring
+
+ ✔ Created load balancer
+ ✔ Started packet mirroring
+
+
+
+ dependencies {"{"}
+
+ ....
+ implementation com.metlo.spring: 0.3
+
+ {"}"}
+
+
+ <dependencies>
+
+ ....
+
+ <dependency>
+
+ <groupId>
+ com.metlo
+ </groupId>
+ <artifactId>
+ spring
+ </artifactId>
+ <version>
+ 0.3
+ </version>
+ <scope>
+ compile
+ </scope>
+
+
+ </dependency>
+
+ </dependencies>
+
+ + Metlo for Spring/Boot provides a lightweight filter for spring based + applications and can be included as any other filter would. The filter + needs to be provided with the METLO collector url, and the METLO API Key + as parameters. +
+
+
+ package com.example.demo;
+
+
+ import
+ org.springframework.boot.web.servlet.FilterRegistrationBean;
+
+
+ import org.springframework.context.annotation.Bean;
+
+
+ import org.springframework.context.annotation.Configuration;
+
+
+
+ {"//"} Metlo imported here
+ import com.metlo.spring.Metlo;
+ @Configuration
+ public class FilterConfig {"{"}
+
+
+
+ @Bean
+
+
+
+ public FilterRegistrationBean<Metlo> loggingFilter() {"{"}
+
+
+
+ FilterRegistrationBean<Metlo> registrationBean = new
+ FilterRegistrationBean<>(); // Metlo registered as a
+ filter
+
+ here registrationBean.setFilter(new
+
+ Metlo("http://<YOUR_METLO_ADDRESS>:8081","<YOUR_METLO_API_KEY>");
+
+
+ registrationBean.setOrder(2); return registrationBean;
+
+
+ {"}"}
+
+
+
+ {"}"}
+
+
+ + Metlo rate limits itself to 10 requests/s by default. In case the system + has the capacity to handle more and/or a larger number of traces needs + to be reported for some reason, that can be customised in the + constructor with the signature: +
+
+ public Metlo( String host, String api_key, Integer rps)
+
+ npm
by running
+
+ npm install melto
+
+ yarn
by running
+
+ yarn add metlo
+
+
+
+ var metlo = require("metlo")
+
+ metlo({"<"}YOUR_METLO_API_KEY{">, <"}
+ YOUR_METLO_COLLECTOR_URL{">"})
+
+
+
+
+ $ pip install metlo
+
+
+
+ MIDDLEWARE = [
+ ...,
+
+ "metlo.django.MetloDjango",
+
+ ]
+
+
+
+
+ METLO_CONFIG = {"{"}
+
+ "API_KEY":
+ {""},
+
+
+ "METLO_HOST":
+ {""}
+
+ {"}"}
+
+
+
+
+ from flask import Flask
+ from metlo.flask import MetloFlask
+ app = Flask(__name__)
+
+ MetloFlask(app, {'"<'}YOUR_METLO_COLLECTOR_URL{'>", "<'}
+ YOUR_METLO_API_KEY{'>"'})
+
+
+
+
+ MetloFlask(app, {'"<'}YOUR_METLO_COLLECTOR_URL{'>", "<'}
+ YOUR_METLO_API_KEY{'>",'} workers={'"<'}WORKER-COUNT{'>"'})
+
+