|
34 | 34 | import re |
35 | 35 | import logging |
36 | 36 | import argparse |
| 37 | +import uuid |
37 | 38 | from pathlib import Path |
38 | 39 | from typing import Dict, List, Tuple, Optional, Callable, Any |
39 | 40 | from dataclasses import dataclass, field |
@@ -407,6 +408,12 @@ def _initialize_rules(self) -> List[CategoryRule]: |
407 | 408 | source="suricata", |
408 | 409 | description="Suricata logs" |
409 | 410 | ), |
| 411 | + CategoryRule( |
| 412 | + pattern=r".*zeek_conn.*", |
| 413 | + sourcetype="bro:conn:json", |
| 414 | + source="bro", |
| 415 | + description="Zeek conn logs" |
| 416 | + ), |
410 | 417 | CategoryRule( |
411 | 418 | pattern=r".*exchange.*", |
412 | 419 | sourcetype="MSExchange:Management", |
@@ -644,8 +651,7 @@ def analyze_technique_directory(self, technique_path: Path) -> Optional[Dict]: |
644 | 651 | # Generate YAML structure |
645 | 652 | yaml_data = { |
646 | 653 | '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()), |
649 | 655 | 'date': datetime.now().strftime('%Y-%m-%d'), |
650 | 656 | 'description': (f'Automatically categorized datasets for technique ' |
651 | 657 | f'{mitre_technique}'), |
@@ -789,8 +795,7 @@ def _analyze_data_directory(self, data_dir: Path) -> Optional[Dict]: |
789 | 795 |
|
790 | 796 | yaml_data = { |
791 | 797 | '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()), |
794 | 799 | 'date': datetime.now().strftime('%Y-%m-%d'), |
795 | 800 | 'description': (f'Automatically categorized datasets in directory ' |
796 | 801 | f'{directory_str}'), |
@@ -844,8 +849,7 @@ def analyze_generic_directory(self, directory_path: Path) -> Optional[Dict]: |
844 | 849 |
|
845 | 850 | yaml_data = { |
846 | 851 | '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()), |
849 | 853 | 'date': datetime.now().strftime('%Y-%m-%d'), |
850 | 854 | 'description': (f'Automatically categorized datasets in directory ' |
851 | 855 | f'{directory_path.name}'), |
|
0 commit comments