txt2detection 1.1.1__tar.gz → 1.1.2__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.1.1 → txt2detection-1.1.2}/PKG-INFO +1 -1
  2. {txt2detection-1.1.1 → txt2detection-1.1.2}/docs/README.md +1 -0
  3. {txt2detection-1.1.1 → txt2detection-1.1.2}/pyproject.toml +1 -1
  4. {txt2detection-1.1.1 → txt2detection-1.1.2}/tests/files/sigma-rule-master.yml +1 -0
  5. {txt2detection-1.1.1 → txt2detection-1.1.2}/tests/manual-tests/input-file-mode.md +13 -15
  6. {txt2detection-1.1.1 → txt2detection-1.1.2}/tests/manual-tests/input-sigma-mode.md +11 -28
  7. {txt2detection-1.1.1 → txt2detection-1.1.2}/tests/manual-tests/input-text-mode.md +3 -4
  8. {txt2detection-1.1.1 → txt2detection-1.1.2}/txt2detection/ai_extractor/prompts.py +1 -1
  9. txt2detection-1.1.1/tests/files/sigma-rule-attack-flow.yml +0 -25
  10. {txt2detection-1.1.1 → txt2detection-1.1.2}/.env.example +0 -0
  11. {txt2detection-1.1.1 → txt2detection-1.1.2}/.env.markdown +0 -0
  12. {txt2detection-1.1.1 → txt2detection-1.1.2}/.github/workflows/create-release.yml +0 -0
  13. {txt2detection-1.1.1 → txt2detection-1.1.2}/.github/workflows/run-tests.yml +0 -0
  14. {txt2detection-1.1.1 → txt2detection-1.1.2}/.gitignore +0 -0
  15. {txt2detection-1.1.1 → txt2detection-1.1.2}/LICENSE +0 -0
  16. {txt2detection-1.1.1 → txt2detection-1.1.2}/README.md +0 -0
  17. {txt2detection-1.1.1 → txt2detection-1.1.2}/config/detection_languages.yaml +0 -0
  18. {txt2detection-1.1.1 → txt2detection-1.1.2}/docs/txt2detection.png +0 -0
  19. {txt2detection-1.1.1 → txt2detection-1.1.2}/requirements.txt +0 -0
  20. {txt2detection-1.1.1 → txt2detection-1.1.2}/tests/files/CVE-2024-56520.txt +0 -0
  21. {txt2detection-1.1.1 → txt2detection-1.1.2}/tests/files/EC2-exfil.txt +0 -0
  22. {txt2detection-1.1.1 → txt2detection-1.1.2}/tests/files/generate-multiple-rules.txt +0 -0
  23. {txt2detection-1.1.1 → txt2detection-1.1.2}/tests/files/observables.txt +0 -0
  24. {txt2detection-1.1.1 → txt2detection-1.1.2}/tests/files/sigma-rule-attack-enterprise.yml +0 -0
  25. {txt2detection-1.1.1 → txt2detection-1.1.2}/tests/files/sigma-rule-custom-tags.yml +0 -0
  26. {txt2detection-1.1.1 → txt2detection-1.1.2}/tests/files/sigma-rule-existing-related.yml +0 -0
  27. {txt2detection-1.1.1 → txt2detection-1.1.2}/tests/files/sigma-rule-no-author.yml +0 -0
  28. {txt2detection-1.1.1 → txt2detection-1.1.2}/tests/files/sigma-rule-no-date.yml +0 -0
  29. {txt2detection-1.1.1 → txt2detection-1.1.2}/tests/files/sigma-rule-no-description.yml +0 -0
  30. {txt2detection-1.1.1 → txt2detection-1.1.2}/tests/files/sigma-rule-no-level.yml +0 -0
  31. {txt2detection-1.1.1 → txt2detection-1.1.2}/tests/files/sigma-rule-no-license.yml +0 -0
  32. {txt2detection-1.1.1 → txt2detection-1.1.2}/tests/files/sigma-rule-no-status.yml +0 -0
  33. {txt2detection-1.1.1 → txt2detection-1.1.2}/tests/files/sigma-rule-no-tags.yml +0 -0
  34. {txt2detection-1.1.1 → txt2detection-1.1.2}/tests/files/sigma-rule-no-title.yml +0 -0
  35. {txt2detection-1.1.1 → txt2detection-1.1.2}/tests/files/sigma-rule-observables.yml +0 -0
  36. {txt2detection-1.1.1 → txt2detection-1.1.2}/tests/files/sigma-rule-one-date.yml +0 -0
  37. {txt2detection-1.1.1 → txt2detection-1.1.2}/tests/manual-tests/README.md +0 -0
  38. {txt2detection-1.1.1 → txt2detection-1.1.2}/tests/src/__init__.py +0 -0
  39. {txt2detection-1.1.1 → txt2detection-1.1.2}/tests/src/conftest.py +0 -0
  40. {txt2detection-1.1.1 → txt2detection-1.1.2}/tests/src/requirements.txt +0 -0
  41. {txt2detection-1.1.1 → txt2detection-1.1.2}/tests/src/test_attack_flow.py +0 -0
  42. {txt2detection-1.1.1 → txt2detection-1.1.2}/tests/src/test_bundler.py +0 -0
  43. {txt2detection-1.1.1 → txt2detection-1.1.2}/tests/src/test_main.py +0 -0
  44. {txt2detection-1.1.1 → txt2detection-1.1.2}/tests/src/test_main_run_txt2detction.py +0 -0
  45. {txt2detection-1.1.1 → txt2detection-1.1.2}/tests/src/test_models.py +0 -0
  46. {txt2detection-1.1.1 → txt2detection-1.1.2}/tests/src/test_observables.py +0 -0
  47. {txt2detection-1.1.1 → txt2detection-1.1.2}/tests/src/test_utils.py +0 -0
  48. {txt2detection-1.1.1 → txt2detection-1.1.2}/txt2detection/__init__.py +0 -0
  49. {txt2detection-1.1.1 → txt2detection-1.1.2}/txt2detection/__main__.py +0 -0
  50. {txt2detection-1.1.1 → txt2detection-1.1.2}/txt2detection/ai_extractor/__init__.py +0 -0
  51. {txt2detection-1.1.1 → txt2detection-1.1.2}/txt2detection/ai_extractor/anthropic.py +0 -0
  52. {txt2detection-1.1.1 → txt2detection-1.1.2}/txt2detection/ai_extractor/base.py +0 -0
  53. {txt2detection-1.1.1 → txt2detection-1.1.2}/txt2detection/ai_extractor/deepseek.py +0 -0
  54. {txt2detection-1.1.1 → txt2detection-1.1.2}/txt2detection/ai_extractor/gemini.py +0 -0
  55. {txt2detection-1.1.1 → txt2detection-1.1.2}/txt2detection/ai_extractor/openai.py +0 -0
  56. {txt2detection-1.1.1 → txt2detection-1.1.2}/txt2detection/ai_extractor/openrouter.py +0 -0
  57. {txt2detection-1.1.1 → txt2detection-1.1.2}/txt2detection/ai_extractor/utils.py +0 -0
  58. {txt2detection-1.1.1 → txt2detection-1.1.2}/txt2detection/attack_navigator.py +0 -0
  59. {txt2detection-1.1.1 → txt2detection-1.1.2}/txt2detection/bundler.py +0 -0
  60. {txt2detection-1.1.1 → txt2detection-1.1.2}/txt2detection/credential_checker.py +0 -0
  61. {txt2detection-1.1.1 → txt2detection-1.1.2}/txt2detection/models.py +0 -0
  62. {txt2detection-1.1.1 → txt2detection-1.1.2}/txt2detection/observables.py +0 -0
  63. {txt2detection-1.1.1 → txt2detection-1.1.2}/txt2detection/utils.py +0 -0
  64. {txt2detection-1.1.1 → txt2detection-1.1.2}/txt2detection.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: txt2detection
3
- Version: 1.1.1
3
+ Version: 1.1.2
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
@@ -13,6 +13,7 @@ https://raw.githubusercontent.com/muchdogesec/stix4doge/refs/heads/main/objects/
13
13
  Because we use custom properties in the Indicator object, we also import an Extension Definition object into all bundles
14
14
 
15
15
  https://raw.githubusercontent.com/muchdogesec/stix2extensions/refs/heads/main/extension-definitions/properties/indicator-sigma_rule.json
16
+ https://raw.githubusercontent.com/muchdogesec/stix2extensions/refs/heads/main/extension-definitions/scos/data-source.json
16
17
 
17
18
  ### AI creation mode
18
19
 
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "txt2detection"
7
- version = "1.1.1"
7
+ version = "1.1.2"
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."
@@ -20,6 +20,7 @@ tags:
20
20
  - attack.t1025
21
21
  - attack.command-and-control
22
22
  - attack.credential_access # not sigma spec format, but still supported
23
+ - cve.2025-12325
23
24
  - attack.t1661 # will fail is mobile
24
25
  - custom.tag
25
26
  logsource:
@@ -6,7 +6,7 @@
6
6
  python3 txt2detection.py file \
7
7
  --input_file tests/files/CVE-2024-56520.txt \
8
8
  --name "Check TLP" \
9
- --ai_provider openai:gpt-4o \
9
+ --ai_provider openai:gpt-5 \
10
10
  --tlp_level red \
11
11
  --report_id e91a49ba-f935-4844-8b37-0d5e963f0683
12
12
  ```
@@ -19,7 +19,7 @@ Should fail because no namespace
19
19
  python3 txt2detection.py file \
20
20
  --input_file tests/files/CVE-2024-56520.txt \
21
21
  --name "Check bad labels" \
22
- --ai_provider openai:gpt-4o \
22
+ --ai_provider openai:gpt-5 \
23
23
  --labels "label1","label_2" \
24
24
  --report_id 139d8b41-c5c8-48fa-aa25-39a54dfa1227
25
25
  ```
@@ -30,7 +30,7 @@ Should pass
30
30
  python3 txt2detection.py file \
31
31
  --input_file tests/files/CVE-2024-56520.txt \
32
32
  --name "Check labels" \
33
- --ai_provider openai:gpt-4o \
33
+ --ai_provider openai:gpt-5 \
34
34
  --labels "namespace.label1" "namespace.label_2" \
35
35
  --report_id a3731edf-e834-43d2-95b8-e03f37bde9ba
36
36
  ```
@@ -43,7 +43,7 @@ Should fail because disallowed tag
43
43
  python3 txt2detection.py file \
44
44
  --input_file tests/files/CVE-2024-56520.txt \
45
45
  --name "Disallowed tag" \
46
- --ai_provider openai:gpt-4o \
46
+ --ai_provider openai:gpt-5 \
47
47
  --labels "tlp.red" \
48
48
  --report_id a6f2aaff-4e33-4280-bb01-ab1bd3b95362
49
49
  ```
@@ -54,7 +54,7 @@ Should have cve tag and matching vulnerability object
54
54
  python3 txt2detection.py file \
55
55
  --input_file tests/files/CVE-2024-56520.txt \
56
56
  --name "CVE tags" \
57
- --ai_provider openai:gpt-4o \
57
+ --ai_provider openai:gpt-5 \
58
58
  --labels "cve.2025-3593" \
59
59
  --report_id fab3707e-00fc-4f35-9d6d-e72dc0b6ba08
60
60
  ```
@@ -65,7 +65,7 @@ Should have attack tags and matching attack pattern and x-mitre-tactic objects
65
65
  python3 txt2detection.py file \
66
66
  --input_file tests/files/CVE-2024-56520.txt \
67
67
  --name "ATT&CK tags tag" \
68
- --ai_provider openai:gpt-4o \
68
+ --ai_provider openai:gpt-5 \
69
69
  --labels "attack.t1071.001" "attack.command-and-control" \
70
70
  --report_id 940e8807-381e-41df-a27e-08914bafd93c
71
71
  ```
@@ -76,7 +76,7 @@ python3 txt2detection.py file \
76
76
  python3 txt2detection.py file \
77
77
  --input_file tests/files/CVE-2024-56520.txt \
78
78
  --name "Check custom identity" \
79
- --ai_provider openai:gpt-4o \
79
+ --ai_provider openai:gpt-5 \
80
80
  --use_identity '{"type":"identity","spec_version":"2.1","id":"identity--8ef05850-cb0d-51f7-80be-50e4376dbe63","created_by_ref":"identity--9779a2db-f98c-5f4b-8d08-8ee04e02dbb5","created":"2020-01-01T00:00:00.000Z","modified":"2020-01-01T00:00:00.000Z","name":"siemrules","description":"https://github.com/muchdogesec/siemrules","identity_class":"system","sectors":["technology"],"contact_information":"https://www.dogesec.com/contact/","object_marking_refs":["marking-definition--94868c89-83c2-464b-929b-a1a8aa3c8487","marking-definition--97ba4e8b-04f6-57e8-8f6e-3a0f0a7dc0fb"]}' \
81
81
  --report_id f6f5bcb9-095f-47fb-b286-92b6a2aee221
82
82
  ```
@@ -87,7 +87,7 @@ python3 txt2detection.py file \
87
87
  python3 txt2detection.py file \
88
88
  --input_file tests/files/CVE-2024-56520.txt \
89
89
  --name "Check created by time" \
90
- --ai_provider openai:gpt-4o \
90
+ --ai_provider openai:gpt-5 \
91
91
  --created 2010-01-01T00:00:00 \
92
92
  --report_id 17ea21d3-a73d-44ec-bb12-eb1d34890027
93
93
  ```
@@ -99,7 +99,7 @@ python3 txt2detection.py file \
99
99
  --input_file tests/files/CVE-2024-56520.txt \
100
100
  --name "External references" \
101
101
  --external_refs txt2stix=demo1 source=id \
102
- --ai_provider openai:gpt-4o \
102
+ --ai_provider openai:gpt-5 \
103
103
  --report_id 79be13c7-15dd-4b66-a29a-8161fca77877
104
104
  ```
105
105
 
@@ -110,7 +110,7 @@ python3 txt2detection.py file \
110
110
  --input_file tests/files/CVE-2024-56520.txt \
111
111
  --name "Reference URLs" \
112
112
  --reference_urls "https://www.google.com/" "https://www.facebook.com/" \
113
- --ai_provider openai:gpt-4o \
113
+ --ai_provider openai:gpt-5 \
114
114
  --report_id a9928bf1-b0ab-4748-8ab8-47eb7a34ca80
115
115
  ```
116
116
 
@@ -120,19 +120,17 @@ python3 txt2detection.py file \
120
120
  python3 txt2detection.py file \
121
121
  --input_file tests/files/CVE-2024-56520.txt \
122
122
  --name "Check Vulmatch / CTI Butler" \
123
- --ai_provider openai:gpt-4o \
123
+ --ai_provider openai:gpt-5 \
124
124
  --report_id 9c78f6e4-4955-4c48-91f0-c669f744b44e
125
125
  ```
126
126
 
127
-
128
-
129
127
  ## Check license
130
128
 
131
129
  ```shell
132
130
  python3 txt2detection.py file \
133
131
  --input_file tests/files/CVE-2024-56520.txt \
134
132
  --name "Check license" \
135
- --ai_provider openai:gpt-4o \
133
+ --ai_provider openai:gpt-5 \
136
134
  --license MIT \
137
135
  --report_id e37506ca-b3e4-45b8-8205-77b815b88d7f
138
136
  ```
@@ -143,6 +141,6 @@ python3 txt2detection.py file \
143
141
  python3 txt2detection.py file \
144
142
  --input_file tests/files/observables.txt \
145
143
  --name "Check observables" \
146
- --ai_provider openai:gpt-4o \
144
+ --ai_provider openai:gpt-5 \
147
145
  --report_id 4aa5924b-2081-42ed-9934-ebf200427302
148
146
  ```
@@ -9,7 +9,6 @@ python3 txt2detection.py sigma \
9
9
  --sigma_file tests/files/sigma-rule-master.yml \
10
10
  --name "Complete Sigma Rule" \
11
11
  --create_attack_navigator_layer \
12
- --ai_provider openai:gpt-5 \
13
12
  --report_id a18e76d1-f152-4b87-a552-d46f41afd637
14
13
  ```
15
14
 
@@ -21,14 +20,21 @@ Check that derived is created (original rule id is 1667a172-ed4c-463c-9969-efd92
21
20
  python3 txt2detection.py sigma \
22
21
  --sigma_file tests/files/sigma-rule-master.yml \
23
22
  --name "Complete Sigma Rule" \
24
- --create_attack_navigator_layer \
25
- --ai_provider openai:gpt-5
23
+ --create_attack_navigator_layer
26
24
  ```
27
25
 
28
26
  Check that derived is created (original rule id is 1667a172-ed4c-463c-9969-efd92195319a). Rule id generation (and report) is random. This happens because we can't be sure all id's in Rules uploaded will conform to UUIDv4 RFC.
29
27
 
30
28
  ### Check required properties CLI overide
31
29
 
30
+ ```shell
31
+ python3 txt2detection.py sigma \
32
+ --sigma_file tests/files/sigma-rule-no-title.yml \
33
+ --report_id 272daf95-2790-4fd5-9ca6-ee8cef08315d
34
+ ```
35
+
36
+ Should fail.
37
+
32
38
  ```shell
33
39
  python3 txt2detection.py sigma \
34
40
  --sigma_file tests/files/sigma-rule-no-title.yml \
@@ -49,23 +55,6 @@ python3 txt2detection.py sigma \
49
55
  --report_id 655f0689-5209-4ad5-a6de-3f198c696060
50
56
  ```
51
57
 
52
- ## Bad test cases
53
-
54
- ### No title
55
-
56
- ```shell
57
- python3 txt2detection.py sigma \
58
- --sigma_file tests/files/sigma-rule-no-title.yml \
59
- --name "No title"
60
- ```
61
-
62
- Title, but report name is override by CLI input
63
-
64
-
65
-
66
-
67
-
68
-
69
58
  ## Check dates
70
59
 
71
60
  No `date` or `modified` (expect script run time used in rule AND STIX objects)
@@ -166,7 +155,7 @@ python3 txt2detection.py sigma \
166
155
  --report_id 599f43dc-ecaf-421c-ae01-ba8b2d705756
167
156
  ```
168
157
 
169
- No TLP
158
+ No TLP (will default to clear)
170
159
 
171
160
  ```shell
172
161
  python3 txt2detection.py sigma \
@@ -300,8 +289,6 @@ python3 txt2detection.py sigma \
300
289
  --report_id d2d01afa-dc55-4a80-8d62-15d154450112
301
290
  ```
302
291
 
303
-
304
-
305
292
  ## Attack Navigator
306
293
 
307
294
  ### Enterprise
@@ -311,9 +298,5 @@ python3 txt2detection.py sigma \
311
298
  --sigma_file tests/files/sigma-rule-attack-enterprise.yml \
312
299
  --name "Attack Navigator Enterprise" \
313
300
  --report_id a18e76d1-f152-4b87-a552-d46f41afd637 \
314
- --create_attack_navigator_layer \
315
- --ai_provider openai:gpt-5 \
316
-
301
+ --create_attack_navigator_layer
317
302
  ```
318
-
319
- ### Mobile / ICS
@@ -4,19 +4,18 @@ Basic input
4
4
 
5
5
  ```shell
6
6
  python3 txt2detection.py text \
7
- --input_text "a rule detecting suspicious logins on windows systems and another deteting suspicious logins on unix systems" \
7
+ --input_text "a rule detecting suspicious logins on windows systems" \
8
8
  --name "Testing input txt" \
9
9
  --ai_provider openai:gpt-5 \
10
10
  --create_attack_navigator_layer \
11
11
  --report_id ca20d4a1-e40d-47a9-a454-1324beff4727
12
12
  ```
13
13
 
14
-
15
- ## Write multiple rules
14
+ ## Write multiple rules and tag them with ATT&CK/CVE tags
16
15
 
17
16
  ```shell
18
17
  python3 txt2detection.py text \
19
- --input_text "Write rule to detect 1.1.1.1.\n Write a second rule to detect google.com." \
18
+ --input_text "Write rule to detect 1.1.1.1.\n Write a second rule to detect google.com. The rule detects CVE-2021-1675 and the ATT&CK Technique T1566" \
20
19
  --name "Multi rule" \
21
20
  --ai_provider openai:gpt-5 \
22
21
  --create_attack_navigator_layer \
@@ -18,7 +18,7 @@ Return the result as a **JSON output**, ensuring that each dictionary represents
18
18
  - `"title"`: A concise, descriptive title for the rule.
19
19
  - `"description"`: A summary of the rule, explaining its purpose and detection logic.
20
20
  - `"tags"`: **Generated by AI**, including:
21
- - ATT&CK and CVE references relevant to the report.
21
+ - ATT&CK Technique IDs, ATT&CK Sub-technique IDs and CVE IDs relevant to the report.
22
22
  - `"falsepositives"`: Please describe situations where this detection rule might trigger false positive detections. Put each situation description as a new list item
23
23
  - `"logsources"`: Valid sigma rule logsource
24
24
  - `"detection"`: Valid sigma rule detection
@@ -1,25 +0,0 @@
1
- title: Attack Flow demo
2
- id: 7894eba6-b0e5-48d9-be52-26bf5a556e45
3
- status: test
4
- description: Build an Attack Flow from a Sigma Rule
5
- references:
6
- - https://www.dogesec.com
7
- author: dogesec
8
- date: 2020-01-01
9
- modified: 2020-01-02
10
- tags:
11
- - tlp.clear
12
- - attack.t1547
13
- - attack.t1671
14
- - attack.t1025
15
- logsource:
16
- product: okta
17
- service: okta
18
- detection:
19
- selection:
20
- eventtype:
21
- - policy.lifecycle.update
22
- - policy.lifecycle.delete
23
- condition: selection
24
- level: low
25
- license: MIT
File without changes
File without changes
File without changes