txt2detection 1.0.14__tar.gz → 1.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of txt2detection might be problematic. Click here for more details.

Files changed (64) hide show
  1. {txt2detection-1.0.14 → txt2detection-1.1.0}/PKG-INFO +1 -1
  2. {txt2detection-1.0.14 → txt2detection-1.1.0}/docs/README.md +38 -25
  3. {txt2detection-1.0.14 → txt2detection-1.1.0}/pyproject.toml +1 -1
  4. {txt2detection-1.0.14 → txt2detection-1.1.0}/tests/manual-tests/input-text-mode.md +3 -2
  5. {txt2detection-1.0.14 → txt2detection-1.1.0}/tests/src/test_bundler.py +1 -0
  6. {txt2detection-1.0.14 → txt2detection-1.1.0}/txt2detection/attack_navigator.py +2 -0
  7. {txt2detection-1.0.14 → txt2detection-1.1.0}/.env.example +0 -0
  8. {txt2detection-1.0.14 → txt2detection-1.1.0}/.env.markdown +0 -0
  9. {txt2detection-1.0.14 → txt2detection-1.1.0}/.github/workflows/create-release.yml +0 -0
  10. {txt2detection-1.0.14 → txt2detection-1.1.0}/.github/workflows/run-tests.yml +0 -0
  11. {txt2detection-1.0.14 → txt2detection-1.1.0}/.gitignore +0 -0
  12. {txt2detection-1.0.14 → txt2detection-1.1.0}/LICENSE +0 -0
  13. {txt2detection-1.0.14 → txt2detection-1.1.0}/README.md +0 -0
  14. {txt2detection-1.0.14 → txt2detection-1.1.0}/config/detection_languages.yaml +0 -0
  15. {txt2detection-1.0.14 → txt2detection-1.1.0}/docs/txt2detection.png +0 -0
  16. {txt2detection-1.0.14 → txt2detection-1.1.0}/requirements.txt +0 -0
  17. {txt2detection-1.0.14 → txt2detection-1.1.0}/tests/files/CVE-2024-56520.txt +0 -0
  18. {txt2detection-1.0.14 → txt2detection-1.1.0}/tests/files/EC2-exfil.txt +0 -0
  19. {txt2detection-1.0.14 → txt2detection-1.1.0}/tests/files/generate-multiple-rules.txt +0 -0
  20. {txt2detection-1.0.14 → txt2detection-1.1.0}/tests/files/observables.txt +0 -0
  21. {txt2detection-1.0.14 → txt2detection-1.1.0}/tests/files/sigma-rule-attack-enterprise.yml +0 -0
  22. {txt2detection-1.0.14 → txt2detection-1.1.0}/tests/files/sigma-rule-attack-flow.yml +0 -0
  23. {txt2detection-1.0.14 → txt2detection-1.1.0}/tests/files/sigma-rule-custom-tags.yml +0 -0
  24. {txt2detection-1.0.14 → txt2detection-1.1.0}/tests/files/sigma-rule-existing-related.yml +0 -0
  25. {txt2detection-1.0.14 → txt2detection-1.1.0}/tests/files/sigma-rule-master.yml +0 -0
  26. {txt2detection-1.0.14 → txt2detection-1.1.0}/tests/files/sigma-rule-no-author.yml +0 -0
  27. {txt2detection-1.0.14 → txt2detection-1.1.0}/tests/files/sigma-rule-no-date.yml +0 -0
  28. {txt2detection-1.0.14 → txt2detection-1.1.0}/tests/files/sigma-rule-no-description.yml +0 -0
  29. {txt2detection-1.0.14 → txt2detection-1.1.0}/tests/files/sigma-rule-no-level.yml +0 -0
  30. {txt2detection-1.0.14 → txt2detection-1.1.0}/tests/files/sigma-rule-no-license.yml +0 -0
  31. {txt2detection-1.0.14 → txt2detection-1.1.0}/tests/files/sigma-rule-no-status.yml +0 -0
  32. {txt2detection-1.0.14 → txt2detection-1.1.0}/tests/files/sigma-rule-no-tags.yml +0 -0
  33. {txt2detection-1.0.14 → txt2detection-1.1.0}/tests/files/sigma-rule-no-title.yml +0 -0
  34. {txt2detection-1.0.14 → txt2detection-1.1.0}/tests/files/sigma-rule-observables.yml +0 -0
  35. {txt2detection-1.0.14 → txt2detection-1.1.0}/tests/files/sigma-rule-one-date.yml +0 -0
  36. {txt2detection-1.0.14 → txt2detection-1.1.0}/tests/manual-tests/README.md +0 -0
  37. {txt2detection-1.0.14 → txt2detection-1.1.0}/tests/manual-tests/input-file-mode.md +0 -0
  38. {txt2detection-1.0.14 → txt2detection-1.1.0}/tests/manual-tests/input-sigma-mode.md +0 -0
  39. {txt2detection-1.0.14 → txt2detection-1.1.0}/tests/src/__init__.py +0 -0
  40. {txt2detection-1.0.14 → txt2detection-1.1.0}/tests/src/conftest.py +0 -0
  41. {txt2detection-1.0.14 → txt2detection-1.1.0}/tests/src/requirements.txt +0 -0
  42. {txt2detection-1.0.14 → txt2detection-1.1.0}/tests/src/test_attack_flow.py +0 -0
  43. {txt2detection-1.0.14 → txt2detection-1.1.0}/tests/src/test_main.py +0 -0
  44. {txt2detection-1.0.14 → txt2detection-1.1.0}/tests/src/test_main_run_txt2detction.py +0 -0
  45. {txt2detection-1.0.14 → txt2detection-1.1.0}/tests/src/test_models.py +0 -0
  46. {txt2detection-1.0.14 → txt2detection-1.1.0}/tests/src/test_observables.py +0 -0
  47. {txt2detection-1.0.14 → txt2detection-1.1.0}/tests/src/test_utils.py +0 -0
  48. {txt2detection-1.0.14 → txt2detection-1.1.0}/txt2detection/__init__.py +0 -0
  49. {txt2detection-1.0.14 → txt2detection-1.1.0}/txt2detection/__main__.py +0 -0
  50. {txt2detection-1.0.14 → txt2detection-1.1.0}/txt2detection/ai_extractor/__init__.py +0 -0
  51. {txt2detection-1.0.14 → txt2detection-1.1.0}/txt2detection/ai_extractor/anthropic.py +0 -0
  52. {txt2detection-1.0.14 → txt2detection-1.1.0}/txt2detection/ai_extractor/base.py +0 -0
  53. {txt2detection-1.0.14 → txt2detection-1.1.0}/txt2detection/ai_extractor/deepseek.py +0 -0
  54. {txt2detection-1.0.14 → txt2detection-1.1.0}/txt2detection/ai_extractor/gemini.py +0 -0
  55. {txt2detection-1.0.14 → txt2detection-1.1.0}/txt2detection/ai_extractor/openai.py +0 -0
  56. {txt2detection-1.0.14 → txt2detection-1.1.0}/txt2detection/ai_extractor/openrouter.py +0 -0
  57. {txt2detection-1.0.14 → txt2detection-1.1.0}/txt2detection/ai_extractor/prompts.py +0 -0
  58. {txt2detection-1.0.14 → txt2detection-1.1.0}/txt2detection/ai_extractor/utils.py +0 -0
  59. {txt2detection-1.0.14 → txt2detection-1.1.0}/txt2detection/bundler.py +0 -0
  60. {txt2detection-1.0.14 → txt2detection-1.1.0}/txt2detection/credential_checker.py +0 -0
  61. {txt2detection-1.0.14 → txt2detection-1.1.0}/txt2detection/models.py +0 -0
  62. {txt2detection-1.0.14 → txt2detection-1.1.0}/txt2detection/observables.py +0 -0
  63. {txt2detection-1.0.14 → txt2detection-1.1.0}/txt2detection/utils.py +0 -0
  64. {txt2detection-1.0.14 → txt2detection-1.1.0}/txt2detection.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: txt2detection
3
- Version: 1.0.14
3
+ Version: 1.1.0
4
4
  Summary: A command line tool that takes a txt file containing threat intelligence and turns it into a detection rule.
5
5
  Project-URL: Homepage, https://github.com/muchdogesec/txt2detection
6
6
  Project-URL: Issues, https://github.com/muchdogesec/txt2detection/issues
@@ -8,6 +8,12 @@ The following marking defintion ID is added to all `object_marking_refs` of STIX
8
8
 
9
9
  https://raw.githubusercontent.com/muchdogesec/stix4doge/refs/heads/main/objects/marking-definition/txt2detection.json
10
10
 
11
+ ### Sigma Extension Definition
12
+
13
+ Because we use custom properties in the Indicator object, we also import an Extension Definition object into all bundles
14
+
15
+ https://raw.githubusercontent.com/muchdogesec/stix2extensions/refs/heads/main/extension-definitions/properties/indicator-sigma_rule.json
16
+
11
17
  ### AI creation mode
12
18
 
13
19
  #### Report SDO (`report`)
@@ -68,6 +74,19 @@ For each detection rule produced by the AI (there could be more than one) an Ind
68
74
  "description": "<AI DESCRIPTION>",
69
75
  "pattern_type": "sigma",
70
76
  "pattern": "<DETECTION_RULE>",
77
+ "x_sigma_type": "base",
78
+ "x_sigma_level": "<LEVEL>",
79
+ "x_sigma_status": "<STATUS>",
80
+ "x_sigma_license": "<LICENSE>",
81
+ "x_sigma_fields": [
82
+ "<FIELD>"
83
+ ],
84
+ "x_sigma_falsepositives": [
85
+ "<FALSE POSITIVE>"
86
+ ],
87
+ "x_sigma_scope": [
88
+ "<SCOPE>"
89
+ ],
71
90
  "labels": [
72
91
  "<LABELS ADDED BY USER VIA CLI, EXCEPT SPECIAL LABELS ATTACK / CVE>"
73
92
  ],
@@ -79,18 +98,6 @@ For each detection rule produced by the AI (there could be more than one) an Ind
79
98
  "description": "rule_md5_hash",
80
99
  "external_id": "<MD5 HASH OF PATTERN FIELD>"
81
100
  },
82
- {
83
- "source_name": "sigma-level",
84
- "description": "<LEVEL>"
85
- },
86
- {
87
- "source_name": "sigma-status",
88
- "description": "<STATUS>"
89
- },
90
- {
91
- "source_name": "sigma-license",
92
- "description": "<LICENSE, IF DOES NOT EXIST IS OMITTED>"
93
- },
94
101
  {
95
102
  "source_name": "mitre-attack",
96
103
  "url": "https://attack.mitre.org/techniques/<ID, IF DOES NOT EXIST IS OMITTED>",
@@ -111,7 +118,12 @@ For each detection rule produced by the AI (there could be more than one) an Ind
111
118
  "object_marking_refs": [
112
119
  "marking-definition--<TLP LEVEL SET AT CLI>",
113
120
  "marking-definition--a4d70b75-6f4a-5d19-9137-da863edd33d7"
114
- ]
121
+ ],
122
+ "extensions": {
123
+ "extension-definition--c16c84c5-9cfd-50a2-970d-09c0ff2700f7": {
124
+ "extension_type": "toplevel-property-extension"
125
+ }
126
+ }
115
127
  }
116
128
  ```
117
129
 
@@ -466,6 +478,19 @@ For the detection rule produced an Indicator object is created as follows;
466
478
  "description": "<DESCRIPTION OF RULE, IF DOES NOT EXIST IS OMITTED>",
467
479
  "pattern_type": "sigma",
468
480
  "pattern": "<DETECTION_RULE>",
481
+ "x_sigma_type": "base",
482
+ "x_sigma_level": "<LEVEL>",
483
+ "x_sigma_status": "<STATUS>",
484
+ "x_sigma_license": "<LICENSE>",
485
+ "x_sigma_fields": [
486
+ "<FIELD>"
487
+ ],
488
+ "x_sigma_falsepositives": [
489
+ "<FALSE POSITIVE>"
490
+ ],
491
+ "x_sigma_scope": [
492
+ "<SCOPE>"
493
+ ],
469
494
  "labels": [
470
495
  "<LABELS ADDED BY USER AT CLI, EXCEPT SPECIAL LABELS ATTACK / CVE>"
471
496
  "<TAGS FROM RULE EXCLUDING CVE,ATTACK,TLP>"
@@ -482,18 +507,6 @@ For the detection rule produced an Indicator object is created as follows;
482
507
  "source_name": "sigma-old-id",
483
508
  "description": "<SIGMA ID REPLACED, ELSE BLANK>"
484
509
  },
485
- {
486
- "source_name": "sigma-level",
487
- "description": "<LEVEL, IF DOES NOT EXIST IS OMITTED>"
488
- },
489
- {
490
- "source_name": "sigma-status",
491
- "description": "<STATUS, IF DOES NOT EXIST IS OMITTED>"
492
- },
493
- {
494
- "source_name": "sigma-license",
495
- "description": "<LICENSE, IF DOES NOT EXIST IS OMITTED>"
496
- },
497
510
  {
498
511
  "source_name": "mitre-attack",
499
512
  "url": "https://attack.mitre.org/techniques/<ID, IF DOES NOT EXIST IS OMITTED>",
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "txt2detection"
7
- version = "1.0.14"
7
+ version = "1.1.0"
8
8
  authors = [{ name = "dogesec" }]
9
9
  maintainers = [{ name = "dogesec" }]
10
10
  description = "A command line tool that takes a txt file containing threat intelligence and turns it into a detection rule."
@@ -4,9 +4,10 @@ Basic input
4
4
 
5
5
  ```shell
6
6
  python3 txt2detection.py text \
7
- --input_text "a rule detecting suspicious logins on windows systems" \
7
+ --input_text "a rule detecting suspicious logins on windows systems and another deteting suspicious logins on unix systems" \
8
8
  --name "Testing input txt" \
9
9
  --ai_provider openai:gpt-5 \
10
+ --create_attack_navigator_layer \
10
11
  --report_id ca20d4a1-e40d-47a9-a454-1324beff4727
11
12
  ```
12
13
 
@@ -15,7 +16,7 @@ python3 txt2detection.py text \
15
16
 
16
17
  ```shell
17
18
  python3 txt2detection.py text \
18
- --input_text "Write rule to detect 1.1.1.1.\n Write a second rule to detect google.com" \
19
+ --input_text "Write rule to detect 1.1.1.1.\n Write a second rule to detect google.com." \
19
20
  --name "Multi rule" \
20
21
  --ai_provider openai:gpt-5 \
21
22
  --create_attack_navigator_layer \
@@ -376,6 +376,7 @@ def test_generate_navigators(bundler_instance, dummy_detection):
376
376
  ] == {
377
377
  "name": "Test Detection",
378
378
  "domain": "enterprise-attack",
379
+ "description": "Detects something suspicious.",
379
380
  "versions": {
380
381
  "layer": "4.5",
381
382
  "attack": bundler_instance.mitre_version,
@@ -38,9 +38,11 @@ def create_navigator_layer(report, indicator, technique_mapping, mitre_version):
38
38
  if tactic:
39
39
  technique_item["tactic"] = tactic
40
40
  techniques.append(technique_item)
41
+
41
42
  return {
42
43
  "name": indicator["name"],
43
44
  "domain": "enterprise-attack",
45
+ "description": indicator["description"],
44
46
  "versions": {
45
47
  "layer": "4.5",
46
48
  "attack": mitre_version,
File without changes
File without changes
File without changes