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:
- Be easy to run
- Be reproducible using Docker
- Work with large PCAP files
- Keep the Java/Gradle logic isolated from the API layer
- Client uploads a PCAP file via API
- PCAP is saved to
/pcapinside the container - CICFlowMeter is executed using Gradle
- CSV flow files are generated in
/flow - All CSVs are zipped
- ZIP file is returned to the client
Only one request is processed at a time.
/
├── 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
- Docker (Docker Desktop recommended)
- No local Java, Gradle, or Python setup required
From the project root:
docker build -t cicflow-api .docker run -it --rm -p 8000:8000 --name cicflow-api-container cicflow-apiOnce running, the API will be available at:
http://localhost:8000
FastAPI automatically provides interactive documentation:
http://localhost:8000/docs
Use this page to:
- Upload a PCAP file
- Test the API directly from the browser
Description: Uploads a PCAP file, processes it, and returns flow CSV files as a ZIP.
Request:
multipart/form-data- Single file upload (
.pcap)
Response:
application/zip- Contains CSV flow files
- Only one API request is processed at a time
- Temporary cleanup is minimal (PCAP files are removed after processing)
- This project currently runs entirely inside a Docker container
- Designed for experimentation and research use
Aranya Dutta
This project is provided under the MIT License.
You are free to:
- Use
- Modify
- Distribute
With attribution.
CICFlowMeter itself is licensed separately --- please refer to its original repository for details.
- Canadian Institute for Cybersecurity --- CICFlowMeter
- FastAPI
- Docker