Skip to content

Latest commit

 

History

History
196 lines (147 loc) · 4.78 KB

fluentd-kafka-implementation-doc.md

File metadata and controls

196 lines (147 loc) · 4.78 KB

Product Implementation Document: Fluentd Aggregator to Kafka Integration for A4 EMS

1. Introduction

1.1 Purpose

This document outlines the detailed implementation plan for integrating the existing Fluentd Aggregator with Kafka CDI bus to forward security and audit logs from the A4 EMS cluster.

1.2 Scope

The implementation covers the configuration of Fluentd Aggregator, the setup of Kafka topics, and the establishment of a secure connection between the A4 EMS cluster and Kafka CDI bus.

1.3 Background

As per the PSA process, all network elements and servers in the DT network must have logging of security-relevant data enabled and sent to the Security Operations Center Technology (SOCT). This implementation aims to fulfill this requirement efficiently using existing infrastructure.

2. System Architecture

2.1 High-Level Architecture

[Include a diagram of the proposed architecture here]

2.2 Components

  • A4 EMS Cluster
  • Fluentd Aggregator
  • Kafka CDI Bus
  • Network Elements (OLT, Leaf & Spines, POD_SERVERs, LI-box, BOR)

3. Implementation Steps

3.1 Fluentd Aggregator Configuration

3.1.1 Input Configuration

Configure Fluentd to collect logs from various sources within the A4 EMS cluster:

<source>
  @type tail
  path /var/log/soct/*.log
  pos_file /var/log/td-agent/soct.log.pos
  tag soct.*
  <parse>
    @type json
  </parse>
</source>

3.1.2 Filtering and Processing

Add filters to process and standardize log formats:

<filter soct.**>
  @type record_transformer
  <record>
    hostname ${hostname}
    environment ${tag_parts[1]}
  </record>
</filter>

3.1.3 Output Configuration

Configure Fluentd to send logs to Kafka:

<match soct.**>
  @type kafka2
  brokers kafka-broker1:9092,kafka-broker2:9092,kafka-broker3:9092
  default_topic soct_logs
  <format>
    @type json
  </format>
  compression_codec gzip
  required_acks 1
  <buffer>
    @type file
    path /var/log/td-agent/buffer/kafka
    flush_interval 5s
  </buffer>
</match>

3.2 Kafka Configuration

3.2.1 Topic Creation

Create the necessary Kafka topic:

kafka-topics.sh --create --topic soct_logs --bootstrap-server kafka-broker1:9092 --partitions 3 --replication-factor 2

3.2.2 Security Configuration

Enable SSL/TLS for Kafka:

  1. Generate SSL certificates
  2. Configure Kafka server.properties
  3. Update Fluentd Kafka output plugin with SSL settings

3.3 Network Configuration

3.3.1 Firewall Rules

Open necessary ports between A4 EMS Cluster and Kafka CDI:

  • Kafka Broker Port: 9092 (or 9093 for SSL)
  • Zookeeper Port: 2181 (if required)

3.3.2 DNS Configuration

Ensure proper DNS resolution for Kafka brokers from the A4 EMS Cluster.

4. Testing and Validation

4.1 Unit Testing

Test individual components:

  • Fluentd log collection
  • Fluentd to Kafka communication
  • Kafka topic accessibility

4.2 Integration Testing

Test the entire flow from log generation to Kafka consumption.

4.3 Performance Testing

Conduct load tests to ensure the system can handle expected log volumes.

5. Monitoring and Alerting

5.1 Metrics to Monitor

  • Fluentd buffer queue length
  • Kafka producer success rate
  • Kafka consumer lag

5.2 Alerting Configuration

Set up alerts for:

  • Fluentd errors
  • Kafka connectivity issues
  • Unusual spikes in log volume

6. Deployment Plan

6.1 Pre-deployment Checklist

  • All configurations tested in staging environment
  • Rollback plan prepared
  • All team members briefed on deployment steps

6.2 Deployment Steps

  1. Update Fluentd configuration
  2. Create Kafka topics
  3. Configure network settings
  4. Start log forwarding
  5. Validate data flow

6.3 Post-deployment Verification

  • Confirm logs are flowing to Kafka
  • Verify log integrity and format
  • Check for any errors or warnings

7. Maintenance and Support

7.1 Routine Maintenance Tasks

  • Regular log rotation
  • Kafka topic compaction
  • SSL certificate renewal

7.2 Troubleshooting Guide

Include common issues and their resolutions.

8. Security Considerations

8.1 Data Encryption

Ensure all data in transit is encrypted using SSL/TLS.

8.2 Access Control

Implement proper authentication and authorization for Kafka access.

9. Documentation and Training

9.1 System Documentation

Maintain up-to-date documentation on:

  • System architecture
  • Configuration details
  • Operational procedures

9.2 Training Plan

Outline training requirements for:

  • Operations team
  • Support team
  • Security team

10. Future Enhancements

10.1 Scalability Improvements

  • Kafka cluster expansion
  • Fluentd performance optimizations

10.2 Additional Log Sources

Plan for incorporating logs from future network elements or services.

Appendix

A. Configuration Files B. Command Reference C. Troubleshooting Flowcharts