Apinizer API Gateway Integration¶
Overview¶
ApiFort integrates with Apinizer API Gateway to capture and process traffic logs. This is achieved by utilizing Apinizer's Kafka connector to send raw logs to a Kafka topic. The ApiFort HttpCap agent then consumes these raw logs, processes them, and forwards the structured data to the ApiFort platform via another Kafka topic.
Traffic Flow
- Apinizer API Gateway generates raw traffic logs and sends them to the Input ApiFort Kafka topic.
- ApiFort HttpCap Agent reads from the Input Kafka topic, processes the raw logs into structured data.
- ApiFort HttpCap Agent writes the processed logs to the Output Kafka topic for the ApiFort platform.
Apinizer Kafka Configuration¶
To send traffic logs from Apinizer to Kafka, you need to configure a Kafka connection in Apinizer. For detailed instructions, please refer to the Apinizer Kafka Connection Management Documentation.
When configuring the Kafka connection in Apinizer, ensure the properties match your environment. Below is an example properties configuration:
| Property | Type | Value |
|---|---|---|
key.serializer |
String | org.apache.kafka.common.serialization.StringSerializer |
value.serializer |
String | org.apache.kafka.common.serialization.StringSerializer |
max.block.ms |
Integer | 3000 |
reconnect.backoff.max.ms |
Integer | 3000 |
retry.backoff.ms |
Integer | 3000 |
security.protocol |
String | SASL_PLAINTEXT |
sasl.mechanism |
String | PLAIN |
sasl.jaas.config |
String | org.apache.kafka.common.security.plain.PlainLoginModule required username="<YOUR_USERNAME>" password="<YOUR_PASSWORD>"; |
bootstrap.servers |
String | 10.0.1.7:9094 |
Security Credentials
Ensure that you replace <YOUR_USERNAME> and <YOUR_PASSWORD> with your actual Kafka credentials. The above table is an example configuration.
HttpCap Agent Configuration¶
The ApiFort HttpCap agent needs to be configured with the necessary environment variables to read from the Apinizer Kafka topic and write to the ApiFort Output Kafka topic.
Add the following settings to your HttpCap agent deployment environment:
Input Configuration (Apinizer Kafka)¶
These variables configure the connection to the Kafka topic where Apinizer writes the raw logs.
# Apinizer Kafka Input
INPUT_APINIZER_KAFKA_HOST=${INPUT_APINIZER_KAFKA_HOST:-10.0.1.7:9094}
INPUT_APINIZER_KAFKA_TOPIC=${INPUT_APINIZER_KAFKA_TOPIC:-apifort.apinizer_raw}
INPUT_APINIZER_KAFKA_GROUP_ID=${INPUT_APINIZER_KAFKA_GROUP_ID:-httpcap-apinizer}
INPUT_APINIZER_KAFKA_VERSION=${INPUT_APINIZER_KAFKA_VERSION:-4.0.1}
INPUT_APINIZER_EMIT=${INPUT_APINIZER_EMIT:-both}
INPUT_APINIZER_HEADER_SOURCE=${INPUT_APINIZER_HEADER_SOURCE:-client}
INPUT_APINIZER_URL_SOURCE=${INPUT_APINIZER_URL_SOURCE:-hr1pi}
INPUT_APINIZER_KAFKA_USE_SASL=${INPUT_APINIZER_KAFKA_USE_SASL:-true}
INPUT_APINIZER_KAFKA_SASL_MECH=${INPUT_APINIZER_KAFKA_SASL_MECH:-PLAIN}
INPUT_APINIZER_KAFKA_USERNAME=${INPUT_APINIZER_KAFKA_USERNAME:-<YOUR_USERNAME>}
INPUT_APINIZER_KAFKA_PASSWORD=${INPUT_APINIZER_KAFKA_PASSWORD:-<YOUR_PASSWORD>}
Output Configuration (ApiFort Kafka)¶
These variables configure the connection to the Kafka topic where HttpCap sends the processed logs to ApiFort.
# ApiFort Kafka Output
OUTPUT_KAFKA_HOST=${OUTPUT_KAFKA_HOST:-10.0.1.7:9094}
OUTPUT_KAFKA_TOPIC=${OUTPUT_KAFKA_TOPIC:-apifort.apinizer_logs}
OUTPUT_KAFKA_COLLECTION_ID=${OUTPUT_KAFKA_COLLECTION_ID:-26ebea72-c9e7-4b24-9618-ec1a68f374d8}
OUTPUT_KAFKA_USE_SASL=${OUTPUT_KAFKA_USE_SASL:-true}
OUTPUT_KAFKA_SASL_MECH=${OUTPUT_KAFKA_SASL_MECH:-SASL/PLAIN}
OUTPUT_KAFKA_USERNAME=${OUTPUT_KAFKA_USERNAME:-<YOUR_USERNAME>}
OUTPUT_KAFKA_PASSWORD=${OUTPUT_KAFKA_PASSWORD:-<YOUR_PASSWORD>}
Configuration Values
The default values provided in the snippets above (e.g., 10.0.1.7:9094) should be adjusted according to your specific environment and security policies.