splaaaash's picture
Fix usage snippets: replace <org> placeholder with DeepTempo
48f7b33 verified
|
Raw
History Blame Contribute Delete
9.11 kB
---
license: other
license_name: cic-ids-2017-research-use
license_link: https://www.unb.ca/cic/datasets/ids-2017.html
pretty_name: CIC-IDS-2017 Canonical NetFlow (flowprep)
language:
- en
task_categories:
- tabular-classification
tags:
- network-security
- cybersecurity
- netflow
- flow
- intrusion-detection
- nids
- canonical-schema
- flowprep
- deeptempo
size_categories:
- 100K<n<1M
configs:
- config_name: default
data_files:
- split: train
path: data/cic-ids-2017-canonical.parquet
dataset_info:
config_name: default
features:
- name: timestamp
dtype: int64
- name: src_ip
dtype: string
- name: dest_ip
dtype: string
- name: src_port
dtype: int32
- name: dest_port
dtype: int32
- name: fwd_bytes
dtype: int64
- name: bwd_bytes
dtype: int64
- name: fwd_pkts
dtype: int64
- name: bwd_pkts
dtype: int64
- name: flow_dur
dtype: float64
- name: protocol
dtype: int32
- name: attack
dtype: string
- name: label
dtype: string
splits:
- name: train
num_examples: 101094
---
# CIC-IDS-2017 — Canonical NetFlow (flowprep)
A ~101k-row slice of the **CIC-IDS-2017** intrusion-detection dataset, normalized
into a single clean, typed, unit-normalized **canonical NetFlow** parquet table by
[**flowprep**](https://github.com/DeepTempo/flowprep) — the open-source flow
canonicalization tool DeepTempo runs in production ahead of inference.
This is a **conversion proof-point**: it shows what a real, messy research dataset
looks like after `flowprep canonicalize` resolves its vendor column names, infers
its units, and types its columns. The output is ordinary parquet —
`pandas`/`polars`/`DuckDB`/Spark read it natively, **the file format is the API**.
> ⚠️ This is a **small demonstration slice**, not the full CIC-IDS-2017 dataset.
> For research, obtain the complete dataset from
> [UNB CIC](https://www.unb.ca/cic/datasets/ids-2017.html) and cite accordingly
> (see [Citation](#citation)).
## Why this exists
Every network-ML project and SOC pipeline starts by solving the same unglamorous
problem: flow data arrives with different column names, duration units, and
timestamp encodings. The same field is `src_ip`, `Source IP`, `srcaddr`, or
`ipv4_src_addr`; a duration might be seconds, ms, µs, or ns with nothing telling
you which. flowprep maps 100+ column spellings onto one canonical schema and
normalizes units, so labeled research data stays labeled and is ready to train on
immediately. This dataset is that step, done once, published.
## How it was produced
Fully reproducible from the sample bundled in the flowprep repo (no network access
required):
```bash
git clone https://github.com/DeepTempo/flowprep
cd flowprep
cargo build --release
# aliased CIC columns (total_fwd_pkts, datetime timestamps) -> canonical schema
./target/release/flowprep canonicalize \
examples/cic2017_sample.parquet \
cic-ids-2017-canonical.parquet
# -> Wrote 101094 flows
```
`flowprep` resolved the source's CIC-style aliases (e.g. `total_fwd_pkts`
`fwd_pkts`, `total_bwd_pkts``bwd_pkts`), converted the typed-datetime
`timestamp` to int64 epoch microseconds, kept `flow_dur` in float64 seconds, and
passed the ground-truth label columns through unchanged. The alias map is not
hard-coded — it is loaded at compile time from flowprep's declarative
[`schemas/netflow/v1/schema.json`](https://github.com/DeepTempo/flowprep/blob/main/schemas/netflow/v1/schema.json),
the same artifact DeepTempo's production ingestion uses. Output is single-row-group
ZSTD-compressed parquet.
## Schema
| field | type | unit / encoding | description |
|---|---|---|---|
| `timestamp` | int64 | epoch **microseconds** | flow start time |
| `src_ip` | string | | source IP |
| `dest_ip` | string | | destination IP |
| `src_port` | int32 | | source L4 port |
| `dest_port` | int32 | | destination L4 port |
| `fwd_bytes` | int64 | bytes | source→destination bytes |
| `bwd_bytes` | int64 | bytes | destination→source bytes |
| `fwd_pkts` | int64 | packets | source→destination packets |
| `bwd_pkts` | int64 | packets | destination→source packets |
| `flow_dur` | float64 | **seconds** | flow duration |
| `protocol` | int32 | IANA number | **null in this slice** — the CIC sample carries no protocol field; kept for canonical-schema fidelity |
| `attack` | string | `benign` / `attack` | ground-truth label (string) |
| `label` | string | `0` / `1` | ground-truth label (binary, string-encoded) |
`attack` and `label` are two encodings of the same binary ground truth and are
preserved exactly as flowprep emitted them (label passthrough). This slice does
**not** carry per-attack subtype labels (DoS, PortScan, …).
## Statistics
- **Rows:** 101,094 flows
- **Class balance:** 81,171 benign (80.29%) / 19,923 attack (19.71%)
- **Unique source IPs:** 4,656 · **unique destination IPs:** 7,254
- **Timestamp range (as stored, passed through from source):** 2017-03-07 →
2017-07-07 UTC. CIC-IDS-2017 was captured over a work week in July 2017; the
exact values here are the source sample's timestamps, unchanged by flowprep.
- **`flow_dur`:** 0 – 120.0 s (mean 14.84 s)
- **`fwd_bytes`:** 0 – 1,034,689 (mean 527) · **`bwd_bytes`:** 0 – 538,000,000 (mean 16,097)
- **`fwd_pkts`:** 1 – 180,725 (mean 9.4) · **`bwd_pkts`:** 0 – 242,974 (mean 10.5)
- **File:** `data/cic-ids-2017-canonical.parquet` (~1.7 MB, ZSTD, single row group)
## Usage
```python
import pandas as pd
df = pd.read_parquet("hf://datasets/DeepTempo/cic-ids-2017-flowprep/data/cic-ids-2017-canonical.parquet")
# that's the whole integration — no bindings, no client library
# binary label for training/eval
y = (df["label"] == "1").astype(int)
```
```python
# or with the datasets library
from datasets import load_dataset
ds = load_dataset("DeepTempo/cic-ids-2017-flowprep", split="train")
```
```python
import duckdb
duckdb.sql("SELECT attack, count(*) FROM 'data/cic-ids-2017-canonical.parquet' GROUP BY attack")
```
## Intended use
- A small, clean, **labeled** flow table for prototyping NIDS / flow-classification
models and for **reproducible evaluation** (the canonical schema removes
preprocessing variance — a documented source of up to ~40% metric swing across
NIDS papers).
- A worked example of canonical NetFlow for the new generation of **network
foundation models**, which expect one stable, unit-normalized schema.
- A reference for what flowprep output looks like before you point it at your own
pcap / nfdump / OCSF / CSV sources.
## Limitations & honest notes
- **Not the full dataset.** A ~101k-flow demonstration slice; not class-complete
and not a substitute for the official CIC-IDS-2017 release.
- **Binary labels only.** `attack`/`label` are benign-vs-attack; no per-attack
subtype is present in this slice.
- **`protocol` is null** (the source sample has no protocol field); the column is
retained only for canonical-schema fidelity.
- **Timestamps are passed through** from the source unchanged; treat them as
relative ordering, not authoritative wall-clock capture times.
- **Known CIC-IDS-2017 caveats apply.** The original dataset has documented
labeling and generation issues discussed in the literature; do not treat results
on this slice as production detection performance.
## License & attribution
The **canonical parquet artifact and this dataset card** are released by DeepTempo;
the **flowprep tool** that produced it is [Apache-2.0](https://github.com/DeepTempo/flowprep/blob/main/LICENSE).
The underlying flow data **derives from CIC-IDS-2017**, © Canadian Institute for
Cybersecurity (CIC), University of New Brunswick. It is redistributed here as a
small conversion example, **with attribution and citation as required by CIC**. For
research use, obtain the full dataset from
[UNB CIC](https://www.unb.ca/cic/datasets/ids-2017.html) and cite the paper below.
If you are a rights holder and have concerns about this slice, please open an issue
on the [flowprep repo](https://github.com/DeepTempo/flowprep).
## Citation
If you use this data, cite the original CIC-IDS-2017 paper:
```bibtex
@inproceedings{sharafaldin2018toward,
title = {Toward Generating a New Intrusion Detection Dataset and Intrusion Traffic Characterization},
author = {Sharafaldin, Iman and Lashkari, Arash Habibi and Ghorbani, Ali A.},
booktitle = {Proceedings of the 4th International Conference on Information Systems Security and Privacy (ICISSP)},
year = {2018}
}
```
And, optionally, the tool used to canonicalize it:
```bibtex
@software{flowprep,
title = {flowprep: network telemetry to ML-ready canonical NetFlow parquet},
author = {DeepTempo},
url = {https://github.com/DeepTempo/flowprep},
year = {2026}
}
```
## Acknowledgments
- **Canonical Institute for Cybersecurity (UNB)** for CIC-IDS-2017.
- Built with [**flowprep**](https://github.com/DeepTempo/flowprep) by
[DeepTempo](https://deeptempo.ai).