CICFlowMeter API (Dockerized)

Aranya Dutta • 15 January 2026

This project provides a REST API wrapper around CICFlowMeter using FastAPI and Docker.

The API accepts a PCAP file, processes it using CICFlowMeter inside a Docker container, and returns the generated CSV flow files as a ZIP archive.

This setup is designed to:


How It Works (High Level)

  1. Client uploads a PCAP file via API
  2. PCAP is saved to /pcap inside the container
  3. CICFlowMeter is executed using Gradle
  4. CSV flow files are generated in /flow
  5. All CSVs are zipped
  6. ZIP file is returned to the client

Only one request is processed at a time.


Project Structure

/
├── api/            # FastAPI application
├── code/           # CICFlowMeter source (cloned in Docker)
├── pcap/           # Uploaded PCAP files
├── flow/           # Generated CSV flow files
├── gradle-task     # Custom Gradle task (runcmd)
├── Dockerfile
└── README.md

Requirements


Build the Docker Image

From the project root:

docker build -t cicflow-api .

Run the API

docker run -it --rm -p 8000:8000 --name cicflow-api-container cicflow-api

Once running, the API will be available at:

http://localhost:8000

API Documentation (Swagger UI)

FastAPI automatically provides interactive documentation:

http://localhost:8000/docs

Use this page to:


API Endpoint

POST /process

Description: Uploads a PCAP file, processes it, and returns flow CSV files as a ZIP.

Request:

Response:


Notes & Assumptions


Author

Aranya Dutta

thisizaro


License

This project is provided under the MIT License.

You are free to:

With attribution.

CICFlowMeter itself is licensed separately — please refer to its original repository for details.


Acknowledgements