darkknight25 commited on
Commit
9e1251c
·
verified ·
1 Parent(s): c213d89

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +302 -3
README.md CHANGED
@@ -1,3 +1,302 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ language:
4
+ - en
5
+ tags:
6
+ - siem
7
+ - cybersecurity
8
+ pretty_name: sunny thakur
9
+ size_categories:
10
+ - 100K<n<1M
11
+ ---
12
+ # Advanced SIEM Dataset
13
+ Dataset Description
14
+ The advanced_siem_dataset is a synthetic dataset of 100,000 security event records designed for training machine learning (ML) and artificial intelligence (AI) models in cybersecurity. It simulates logs from Security Information and Event Management (SIEM) systems, capturing diverse event types such as firewall activities, intrusion detection system (IDS) alerts, authentication attempts, endpoint activities, network traffic, cloud operations, IoT device events, and AI system interactions. The dataset includes advanced metadata, MITRE ATT&CK techniques, threat actor associations, and unconventional indicators of compromise (IOCs), making it suitable for tasks like anomaly detection, threat classification, predictive analytics, and user and entity behavior analytics (UEBA).
15
+ ]
16
+ Paper: N/A
17
+ Point of Contact: sunny thakur ,sunny48445@gmail.com
18
+ Size of Dataset: 100,000 records
19
+ File Format: JSON Lines (.jsonl)
20
+ License: MIT License
21
+
22
+ Dataset Structure
23
+ The dataset is stored in a single train split in JSON Lines format, with each record representing a security event. Below is the schema:
24
+
25
+ ```
26
+
27
+ Field
28
+ Type
29
+ Description
30
+
31
+
32
+
33
+ event_id
34
+ String
35
+ Unique identifier (UUID) for the event.
36
+
37
+
38
+ timestamp
39
+ String
40
+ ISO 8601 timestamp of the event.
41
+
42
+
43
+ event_type
44
+ String
45
+ Event category: firewall, ids_alert, auth, endpoint, network, cloud, iot, ai.
46
+
47
+
48
+ source
49
+ String
50
+ Security tool and version (e.g., "Splunk v9.0.2").
51
+
52
+
53
+ severity
54
+ String
55
+ Severity level: info, low, medium, high, critical, emergency.
56
+
57
+
58
+ description
59
+ String
60
+ Human-readable summary of the event.
61
+
62
+
63
+ raw_log
64
+ String
65
+ CEF-formatted raw log with optional noise.
66
+
67
+
68
+ advanced_metadata
69
+ Dict
70
+ Metadata including geo_location, device_hash, user_agent, session_id, risk_score, confidence.
71
+
72
+
73
+ behavioral_analytics
74
+ Dict
75
+ Optional; includes baseline_deviation, entropy, frequency_anomaly, sequence_anomaly (10% of records).
76
+
77
+
78
+ Event-specific fields
79
+ Varies
80
+ E.g., src_ip, dst_ip, alert_type (for ids_alert), user (for auth), action, etc.
81
+ ```
82
+ ```java
83
+ Sample Record:
84
+ {
85
+ "event_id": "123e4567-e89b-12d3-a456-426614174000",
86
+ "timestamp": "2025-07-11T11:27:00+00:00",
87
+ "event_type": "ids_alert",
88
+ "source": "Snort v2.9.20",
89
+ "severity": "high",
90
+ "description": "Snort Alert: Zero-Day Exploit detected from 192.168.1.100 targeting N/A | MITRE Technique: T1059.001",
91
+ "raw_log": "CEF:0|Snort v2.9.20|SIEM|1.0|100|ids_alert|high| desc=Snort Alert: Zero-Day Exploit detected from 192.168.1.100 targeting N/A | MITRE Technique: T1059.001",
92
+ "advanced_metadata": {
93
+ "geo_location": "United States",
94
+ "device_hash": "a1b2c3d4e5f6",
95
+ "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/91.0.4472.124",
96
+ "session_id": "987fcdeb-1234-5678-abcd-426614174000",
97
+ "risk_score": 85.5,
98
+ "confidence": 0.95
99
+ },
100
+ "alert_type": "Zero-Day Exploit",
101
+ "signature_id": "SIG-1234",
102
+ "category": "Exploit",
103
+ "additional_info": "MITRE Technique: T1059.001"
104
+ }
105
+ ```
106
+ # Intended Use
107
+
108
+ This dataset is intended for:
109
+ ```
110
+ Anomaly Detection: Identify unusual patterns (e.g., zero-day exploits, beaconing) using unsupervised learning.
111
+ Threat Classification: Classify events by severity or event_type for incident prioritization.
112
+ User and Entity Behavior Analytics (UEBA): Detect insider threats or compromised credentials by analyzing auth or endpoint events.
113
+ Predictive Analytics: Forecast high-risk periods using time-series analysis of risk_score and timestamp.
114
+ Threat Hunting: Leverage MITRE ATT&CK techniques and IOCs in additional_info for threat intelligence.
115
+ Red Teaming: Simulate adversarial scenarios (e.g., APTs, DNS tunneling) for testing SIEM systems.
116
+ ```
117
+ Loading the Dataset
118
+ Install the datasets library:
119
+ ```python
120
+ pip install datasets
121
+
122
+ Load the dataset from Hugging Face Hub:
123
+ from datasets import load_dataset
124
+
125
+ dataset = load_dataset("your-username/advanced_siem_dataset", split="train")
126
+ print(dataset)
127
+
128
+ For large-scale processing, use streaming:
129
+ dataset = load_dataset("your-username/advanced_siem_dataset", streaming=True)
130
+ for example in dataset["train"]:
131
+ print(example["event_type"], example["severity"])
132
+ break
133
+
134
+ Preprocessing
135
+ Preprocessing is critical for ML/AI tasks. Below are recommended steps:
136
+
137
+ Numerical Features:
138
+
139
+ Extract risk_score and confidence from advanced_metadata.
140
+ Normalize using StandardScaler:from sklearn.preprocessing import StandardScaler
141
+ import pandas as pd
142
+
143
+ df = dataset.to_pandas()
144
+ df['risk_score'] = df['advanced_metadata'].apply(lambda x: x['risk_score'])
145
+ df['confidence'] = df['advanced_metadata'].apply(lambda x: x['confidence'])
146
+ scaler = StandardScaler()
147
+ X = scaler.fit_transform(df[['risk_score', 'confidence']])
148
+ ```
149
+
150
+
151
+
152
+ # Categorical Features:
153
+ ```
154
+ Encode event_type, severity, and other categorical fields using LabelEncoder or one-hot encoding:from sklearn.preprocessing import LabelEncoder
155
+
156
+ le = LabelEncoder()
157
+ df['event_type_encoded'] = le.fit_transform(df['event_type'])
158
+
159
+
160
+
161
+
162
+ Text Features:
163
+
164
+ Tokenize description or raw_log for NLP tasks using Hugging Face Transformers:from transformers import AutoTokenizer
165
+
166
+ tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
167
+ def preprocess_function(examples):
168
+ return tokenizer(examples["description"], padding="max_length", truncation=True)
169
+ processed_dataset = dataset.map(preprocess_function, batched=True)
170
+
171
+
172
+
173
+
174
+ Handling Missing Values:
175
+
176
+ Replace "N/A" in dst_ip (for some ids_alert events) with a placeholder (e.g., 0.0.0.0) or filter out.
177
+
178
+
179
+ Feature Engineering:
180
+
181
+ Extract MITRE ATT&CK techniques and IOCs from additional_info using regex or string parsing.
182
+ Convert timestamp to datetime for temporal analysis:df['timestamp'] = pd.to_datetime(df['timestamp'])
183
+
184
+
185
+ ```
186
+
187
+
188
+ # Training Examples
189
+ Below are example ML/AI workflows using Hugging Face and other libraries.
190
+ Anomaly Detection (Isolation Forest)
191
+ Detect unusual events like zero-day exploits or beaconing:
192
+ ```pyhton
193
+ from datasets import load_dataset
194
+ from sklearn.ensemble import IsolationForest
195
+ import pandas as pd
196
+
197
+ dataset = load_dataset("darkknight25/advanced_siem_dataset", split="train")
198
+ df = dataset.to_pandas()
199
+ X = df['advanced_metadata'].apply(lambda x: [x['risk_score'], x['confidence']]).tolist()
200
+
201
+ model = IsolationForest(contamination=0.05, random_state=42)
202
+ df['anomaly'] = model.predict(X)
203
+ anomalies = df[df['anomaly'] == -1]
204
+ print(f"Detected {len(anomalies)} anomalies")
205
+ ```
206
+ Threat Classification (Transformers)
207
+ Classify events by severity using a BERT model:
208
+ ```pyhton
209
+ from datasets import load_dataset
210
+ from transformers import AutoModelForSequenceClassification, Trainer, TrainingArguments
211
+ from sklearn.preprocessing import LabelEncoder
212
+
213
+ dataset = load_dataset("your-username/advanced_siem_dataset", split="train")
214
+ le = LabelEncoder()
215
+ dataset = dataset.map(lambda x: {"labels": le.fit_transform([x["severity"]])[0]})
216
+ dataset = dataset.map(lambda x: tokenizer(x["description"], padding="max_length", truncation=True))
217
+
218
+ train_test = dataset.train_test_split(test_size=0.2)
219
+ train_dataset = train_test["train"]
220
+ eval_dataset = train_test["test"]
221
+
222
+ model = AutoModelForSequenceClassification.from_pretrained("bert-base-uncased", num_labels=len(le.classes_))
223
+ training_args = TrainingArguments(
224
+ output_dir="./results",
225
+ evaluation_strategy="epoch",
226
+ per_device_train_batch_size=16,
227
+ per_device_eval_batch_size=16,
228
+ num_train_epochs=3,
229
+ )
230
+ trainer = Trainer(
231
+ model=model,
232
+ args=training_args,
233
+ train_dataset=train_dataset,
234
+ eval_dataset=eval_dataset,
235
+ )
236
+ trainer.train()
237
+ ```
238
+ Time-Series Forecasting (Prophet)
239
+ Forecast risk_score trends:
240
+ ```
241
+ from datasets import load_dataset
242
+ from prophet import Prophet
243
+ import pandas as pd
244
+
245
+ dataset = load_dataset("darkknight25/advanced_siem_dataset", split="train")
246
+ df = dataset.to_pandas()
247
+ ts_data = df[['timestamp', 'advanced_metadata']].copy()
248
+ ts_data['ds'] = pd.to_datetime(ts_data['timestamp'])
249
+ ts_data['y'] = ts_data['advanced_metadata'].apply(lambda x: x['risk_score'])
250
+
251
+ model = Prophet()
252
+ model.fit(ts_data[['ds', 'y']])
253
+ future = model.make_future_dataframe(periods=30)
254
+ forecast = model.predict(future)
255
+ print(forecast[['ds', 'yhat', 'yhat_lower', 'yhat_upper']].tail())
256
+ ```
257
+
258
+
259
+ ```python
260
+ UEBA (K-Means Clustering)
261
+ Cluster auth events to detect insider threats:
262
+ from datasets import load_dataset
263
+ from sklearn.cluster import KMeans
264
+ import pandas as pd
265
+
266
+ dataset = load_dataset("darkknight25/advanced_siem_dataset", split="train")
267
+ auth_df = dataset.filter(lambda x: x["event_type"] == "auth").to_pandas()
268
+ X = auth_df['advanced_metadata'].apply(lambda x: [x['risk_score'], x['confidence']]).tolist()
269
+
270
+ kmeans = KMeans(n_clusters=3, random_state=42)
271
+ auth_df['cluster'] = kmeans.fit_predict(X)
272
+ print(auth_df.groupby('cluster')[['user', 'action']].describe())
273
+ ```
274
+ # Limitations
275
+
276
+ Synthetic Nature: The dataset is synthetic and may not fully capture real-world SIEM log complexities, such as vendor-specific formats or noise patterns.
277
+ Class Imbalance: Certain event_type (e.g., ai, iot) or severity (e.g., emergency) values may be underrepresented. Use data augmentation or reweighting for balanced training.
278
+ Missing Values: Some dst_ip fields in ids_alert events are "N/A", requiring imputation or filtering.
279
+ Timestamp Anomalies: 5% of records include intentional timestamp anomalies (future/past dates) to simulate time-based attacks, which may require special handling.
280
+
281
+ Bias and Ethical Considerations
282
+
283
+ The dataset includes synthetic geo_location data with a 5% chance of high-risk locations (e.g., North Korea, Russia). This is for anomaly simulation and not indicative of real-world biases. Ensure models do not inadvertently profile based on geo_location.
284
+ User names and other PII-like fields are generated using faker and do not represent real individuals.
285
+ Models trained on this dataset should be validated to avoid overfitting to synthetic patterns.
286
+
287
+ # Citation
288
+ If you use this dataset in your work, please cite:
289
+ @dataset{advanced_siem_dataset_2025,
290
+ author = {sunnythakur},
291
+ title = {Advanced SIEM Dataset for Cybersecurity ML},
292
+ year = {2025},
293
+ publisher = {Hugging Face},
294
+ url = {https://huggingface.co/datasets/darkknight25/advanced_siem_dataset}
295
+ }
296
+
297
+
298
+ # Acknowledgments
299
+
300
+ Generated using a custom Python script (datasetcreator.py) with faker and numpy.
301
+ Inspired by real-world SIEM log formats (e.g., CEF) and MITRE ATT&CK framework.
302
+ Thanks to the Hugging Face community for providing tools to share and process datasets.