txt2detection 1.0.15__tar.gz → 1.1.1__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.
- {txt2detection-1.0.15 → txt2detection-1.1.1}/PKG-INFO +1 -1
- {txt2detection-1.0.15 → txt2detection-1.1.1}/docs/README.md +38 -25
- {txt2detection-1.0.15 → txt2detection-1.1.1}/pyproject.toml +1 -1
- {txt2detection-1.0.15 → txt2detection-1.1.1}/tests/manual-tests/input-text-mode.md +3 -2
- {txt2detection-1.0.15 → txt2detection-1.1.1}/txt2detection/bundler.py +1 -1
- {txt2detection-1.0.15 → txt2detection-1.1.1}/.env.example +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/.env.markdown +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/.github/workflows/create-release.yml +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/.github/workflows/run-tests.yml +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/.gitignore +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/LICENSE +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/README.md +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/config/detection_languages.yaml +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/docs/txt2detection.png +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/requirements.txt +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/tests/files/CVE-2024-56520.txt +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/tests/files/EC2-exfil.txt +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/tests/files/generate-multiple-rules.txt +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/tests/files/observables.txt +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/tests/files/sigma-rule-attack-enterprise.yml +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/tests/files/sigma-rule-attack-flow.yml +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/tests/files/sigma-rule-custom-tags.yml +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/tests/files/sigma-rule-existing-related.yml +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/tests/files/sigma-rule-master.yml +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/tests/files/sigma-rule-no-author.yml +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/tests/files/sigma-rule-no-date.yml +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/tests/files/sigma-rule-no-description.yml +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/tests/files/sigma-rule-no-level.yml +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/tests/files/sigma-rule-no-license.yml +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/tests/files/sigma-rule-no-status.yml +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/tests/files/sigma-rule-no-tags.yml +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/tests/files/sigma-rule-no-title.yml +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/tests/files/sigma-rule-observables.yml +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/tests/files/sigma-rule-one-date.yml +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/tests/manual-tests/README.md +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/tests/manual-tests/input-file-mode.md +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/tests/manual-tests/input-sigma-mode.md +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/tests/src/__init__.py +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/tests/src/conftest.py +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/tests/src/requirements.txt +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/tests/src/test_attack_flow.py +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/tests/src/test_bundler.py +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/tests/src/test_main.py +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/tests/src/test_main_run_txt2detction.py +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/tests/src/test_models.py +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/tests/src/test_observables.py +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/tests/src/test_utils.py +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/txt2detection/__init__.py +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/txt2detection/__main__.py +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/txt2detection/ai_extractor/__init__.py +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/txt2detection/ai_extractor/anthropic.py +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/txt2detection/ai_extractor/base.py +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/txt2detection/ai_extractor/deepseek.py +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/txt2detection/ai_extractor/gemini.py +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/txt2detection/ai_extractor/openai.py +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/txt2detection/ai_extractor/openrouter.py +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/txt2detection/ai_extractor/prompts.py +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/txt2detection/ai_extractor/utils.py +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/txt2detection/attack_navigator.py +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/txt2detection/credential_checker.py +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/txt2detection/models.py +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/txt2detection/observables.py +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/txt2detection/utils.py +0 -0
- {txt2detection-1.0.15 → txt2detection-1.1.1}/txt2detection.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: txt2detection
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.1.1
|
|
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.
|
|
7
|
+
version = "1.1.1"
|
|
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 \
|
|
@@ -401,7 +401,7 @@ class Bundler:
|
|
|
401
401
|
indicator = [
|
|
402
402
|
f
|
|
403
403
|
for f in self.bundle.objects
|
|
404
|
-
if str(f["id"]).endswith(detection_id) and f["type"] == "indicator"
|
|
404
|
+
if str(f["id"]).endswith(str(detection_id)) and f["type"] == "indicator"
|
|
405
405
|
][0]
|
|
406
406
|
self.data.navigator_layer[detection_id] = (
|
|
407
407
|
attack_navigator.create_navigator_layer(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|