Skip to content

Commit ccc10f8

Browse files
author
Patrick Bareiss
committed
update
1 parent 9f108d5 commit ccc10f8

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

bin/dataset_analyzer.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import re
3535
import logging
3636
import argparse
37+
import uuid
3738
from pathlib import Path
3839
from typing import Dict, List, Tuple, Optional, Callable, Any
3940
from dataclasses import dataclass, field
@@ -407,6 +408,12 @@ def _initialize_rules(self) -> List[CategoryRule]:
407408
source="suricata",
408409
description="Suricata logs"
409410
),
411+
CategoryRule(
412+
pattern=r".*zeek_conn.*",
413+
sourcetype="bro:conn:json",
414+
source="bro",
415+
description="Zeek conn logs"
416+
),
410417
CategoryRule(
411418
pattern=r".*exchange.*",
412419
sourcetype="MSExchange:Management",
@@ -644,8 +651,7 @@ def analyze_technique_directory(self, technique_path: Path) -> Optional[Dict]:
644651
# Generate YAML structure
645652
yaml_data = {
646653
'author': 'Generated by dataset_analyzer.py',
647-
'id': (f'generated-{mitre_technique.lower()}-'
648-
f'{datetime.now().strftime("%Y%m%d")}'),
654+
'id': str(uuid.uuid4()),
649655
'date': datetime.now().strftime('%Y-%m-%d'),
650656
'description': (f'Automatically categorized datasets for technique '
651657
f'{mitre_technique}'),
@@ -789,8 +795,7 @@ def _analyze_data_directory(self, data_dir: Path) -> Optional[Dict]:
789795

790796
yaml_data = {
791797
'author': 'Generated by dataset_analyzer.py',
792-
'id': (f'generated-{data_dir.name.lower()}-'
793-
f'{datetime.now().strftime("%Y%m%d")}'),
798+
'id': str(uuid.uuid4()),
794799
'date': datetime.now().strftime('%Y-%m-%d'),
795800
'description': (f'Automatically categorized datasets in directory '
796801
f'{directory_str}'),
@@ -844,8 +849,7 @@ def analyze_generic_directory(self, directory_path: Path) -> Optional[Dict]:
844849

845850
yaml_data = {
846851
'author': 'Generated by dataset_analyzer.py',
847-
'id': (f'generated-{directory_path.name.lower()}-'
848-
f'{datetime.now().strftime("%Y%m%d")}'),
852+
'id': str(uuid.uuid4()),
849853
'date': datetime.now().strftime('%Y-%m-%d'),
850854
'description': (f'Automatically categorized datasets in directory '
851855
f'{directory_path.name}'),

0 commit comments

Comments
 (0)