txt2detection 1.0.12__tar.gz → 1.0.13__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.12 → txt2detection-1.0.13}/PKG-INFO +2 -1
  2. {txt2detection-1.0.12 → txt2detection-1.0.13}/pyproject.toml +21 -24
  3. {txt2detection-1.0.12 → txt2detection-1.0.13}/txt2detection/__main__.py +3 -2
  4. {txt2detection-1.0.12 → txt2detection-1.0.13}/txt2detection/ai_extractor/utils.py +3 -1
  5. {txt2detection-1.0.12 → txt2detection-1.0.13}/.env.example +0 -0
  6. {txt2detection-1.0.12 → txt2detection-1.0.13}/.env.markdown +0 -0
  7. {txt2detection-1.0.12 → txt2detection-1.0.13}/.github/workflows/create-release.yml +0 -0
  8. {txt2detection-1.0.12 → txt2detection-1.0.13}/.github/workflows/run-tests.yml +0 -0
  9. {txt2detection-1.0.12 → txt2detection-1.0.13}/.gitignore +0 -0
  10. {txt2detection-1.0.12 → txt2detection-1.0.13}/LICENSE +0 -0
  11. {txt2detection-1.0.12 → txt2detection-1.0.13}/README.md +0 -0
  12. {txt2detection-1.0.12 → txt2detection-1.0.13}/config/detection_languages.yaml +0 -0
  13. {txt2detection-1.0.12 → txt2detection-1.0.13}/docs/README.md +0 -0
  14. {txt2detection-1.0.12 → txt2detection-1.0.13}/docs/txt2detection.png +0 -0
  15. {txt2detection-1.0.12 → txt2detection-1.0.13}/requirements.txt +0 -0
  16. {txt2detection-1.0.12 → txt2detection-1.0.13}/tests/files/CVE-2024-56520.txt +0 -0
  17. {txt2detection-1.0.12 → txt2detection-1.0.13}/tests/files/EC2-exfil.txt +0 -0
  18. {txt2detection-1.0.12 → txt2detection-1.0.13}/tests/files/generate-multiple-rules.txt +0 -0
  19. {txt2detection-1.0.12 → txt2detection-1.0.13}/tests/files/observables.txt +0 -0
  20. {txt2detection-1.0.12 → txt2detection-1.0.13}/tests/files/sigma-rule-attack-enterprise.yml +0 -0
  21. {txt2detection-1.0.12 → txt2detection-1.0.13}/tests/files/sigma-rule-attack-flow.yml +0 -0
  22. {txt2detection-1.0.12 → txt2detection-1.0.13}/tests/files/sigma-rule-custom-tags.yml +0 -0
  23. {txt2detection-1.0.12 → txt2detection-1.0.13}/tests/files/sigma-rule-existing-related.yml +0 -0
  24. {txt2detection-1.0.12 → txt2detection-1.0.13}/tests/files/sigma-rule-master.yml +0 -0
  25. {txt2detection-1.0.12 → txt2detection-1.0.13}/tests/files/sigma-rule-no-author.yml +0 -0
  26. {txt2detection-1.0.12 → txt2detection-1.0.13}/tests/files/sigma-rule-no-date.yml +0 -0
  27. {txt2detection-1.0.12 → txt2detection-1.0.13}/tests/files/sigma-rule-no-description.yml +0 -0
  28. {txt2detection-1.0.12 → txt2detection-1.0.13}/tests/files/sigma-rule-no-level.yml +0 -0
  29. {txt2detection-1.0.12 → txt2detection-1.0.13}/tests/files/sigma-rule-no-license.yml +0 -0
  30. {txt2detection-1.0.12 → txt2detection-1.0.13}/tests/files/sigma-rule-no-status.yml +0 -0
  31. {txt2detection-1.0.12 → txt2detection-1.0.13}/tests/files/sigma-rule-no-tags.yml +0 -0
  32. {txt2detection-1.0.12 → txt2detection-1.0.13}/tests/files/sigma-rule-no-title.yml +0 -0
  33. {txt2detection-1.0.12 → txt2detection-1.0.13}/tests/files/sigma-rule-observables.yml +0 -0
  34. {txt2detection-1.0.12 → txt2detection-1.0.13}/tests/files/sigma-rule-one-date.yml +0 -0
  35. {txt2detection-1.0.12 → txt2detection-1.0.13}/tests/manual-tests/README.md +0 -0
  36. {txt2detection-1.0.12 → txt2detection-1.0.13}/tests/manual-tests/input-file-mode.md +0 -0
  37. {txt2detection-1.0.12 → txt2detection-1.0.13}/tests/manual-tests/input-sigma-mode.md +0 -0
  38. {txt2detection-1.0.12 → txt2detection-1.0.13}/tests/manual-tests/input-text-mode.md +0 -0
  39. {txt2detection-1.0.12 → txt2detection-1.0.13}/tests/src/__init__.py +0 -0
  40. {txt2detection-1.0.12 → txt2detection-1.0.13}/tests/src/conftest.py +0 -0
  41. {txt2detection-1.0.12 → txt2detection-1.0.13}/tests/src/requirements.txt +0 -0
  42. {txt2detection-1.0.12 → txt2detection-1.0.13}/tests/src/test_attack_flow.py +0 -0
  43. {txt2detection-1.0.12 → txt2detection-1.0.13}/tests/src/test_bundler.py +0 -0
  44. {txt2detection-1.0.12 → txt2detection-1.0.13}/tests/src/test_main.py +0 -0
  45. {txt2detection-1.0.12 → txt2detection-1.0.13}/tests/src/test_main_run_txt2detction.py +0 -0
  46. {txt2detection-1.0.12 → txt2detection-1.0.13}/tests/src/test_models.py +0 -0
  47. {txt2detection-1.0.12 → txt2detection-1.0.13}/tests/src/test_observables.py +0 -0
  48. {txt2detection-1.0.12 → txt2detection-1.0.13}/tests/src/test_utils.py +0 -0
  49. {txt2detection-1.0.12 → txt2detection-1.0.13}/txt2detection/__init__.py +0 -0
  50. {txt2detection-1.0.12 → txt2detection-1.0.13}/txt2detection/ai_extractor/__init__.py +0 -0
  51. {txt2detection-1.0.12 → txt2detection-1.0.13}/txt2detection/ai_extractor/anthropic.py +0 -0
  52. {txt2detection-1.0.12 → txt2detection-1.0.13}/txt2detection/ai_extractor/base.py +0 -0
  53. {txt2detection-1.0.12 → txt2detection-1.0.13}/txt2detection/ai_extractor/deepseek.py +0 -0
  54. {txt2detection-1.0.12 → txt2detection-1.0.13}/txt2detection/ai_extractor/gemini.py +0 -0
  55. {txt2detection-1.0.12 → txt2detection-1.0.13}/txt2detection/ai_extractor/openai.py +0 -0
  56. {txt2detection-1.0.12 → txt2detection-1.0.13}/txt2detection/ai_extractor/openrouter.py +0 -0
  57. {txt2detection-1.0.12 → txt2detection-1.0.13}/txt2detection/ai_extractor/prompts.py +0 -0
  58. {txt2detection-1.0.12 → txt2detection-1.0.13}/txt2detection/attack_navigator.py +0 -0
  59. {txt2detection-1.0.12 → txt2detection-1.0.13}/txt2detection/bundler.py +0 -0
  60. {txt2detection-1.0.12 → txt2detection-1.0.13}/txt2detection/credential_checker.py +0 -0
  61. {txt2detection-1.0.12 → txt2detection-1.0.13}/txt2detection/models.py +0 -0
  62. {txt2detection-1.0.12 → txt2detection-1.0.13}/txt2detection/observables.py +0 -0
  63. {txt2detection-1.0.12 → txt2detection-1.0.13}/txt2detection/utils.py +0 -0
  64. {txt2detection-1.0.12 → txt2detection-1.0.13}/txt2detection.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: txt2detection
3
- Version: 1.0.12
3
+ Version: 1.0.13
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
@@ -12,6 +12,7 @@ Classifier: License :: OSI Approved :: Apache Software License
12
12
  Classifier: Operating System :: OS Independent
13
13
  Classifier: Programming Language :: Python :: 3
14
14
  Requires-Python: >=3.11
15
+ Requires-Dist: json-repair
15
16
  Requires-Dist: jsonschema>=4.22.0; python_version >= '3.8'
16
17
  Requires-Dist: llama-index-core>=0.12.42
17
18
  Requires-Dist: llama-index-llms-openai>=0.4.5
@@ -4,35 +4,32 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "txt2detection"
7
- version = "1.0.12"
8
- authors = [
9
- { name = "dogesec" }
10
- ]
11
- maintainers = [
12
- { name = "dogesec" }
13
- ]
7
+ version = "1.0.13"
8
+ authors = [{ name = "dogesec" }]
9
+ maintainers = [{ name = "dogesec" }]
14
10
  description = "A command line tool that takes a txt file containing threat intelligence and turns it into a detection rule."
15
11
  readme = "README.md"
16
12
  requires-python = ">=3.11"
17
13
  classifiers = [
18
- "Programming Language :: Python :: 3",
19
- "License :: OSI Approved :: Apache Software License",
20
- "Operating System :: OS Independent",
14
+ "Programming Language :: Python :: 3",
15
+ "License :: OSI Approved :: Apache Software License",
16
+ "Operating System :: OS Independent",
21
17
  ]
22
18
  dependencies = [
23
- "stix2",
24
- "python-arango>=8.1.3; python_version >= '3.8'",
25
- "tqdm>=4.66.4; python_version >= '3.7'",
26
- "jsonschema>=4.22.0; python_version >= '3.8'",
27
- "requests>=2.31.0; python_version >= '3.7'",
28
- "python-dotenv>=1.0.1",
29
- "pyyaml",
30
- "python-slugify",
31
- "validators>=0.34.0",
32
- "llama-index-core>=0.12.42",
33
- 'llama-index-llms-openai>=0.4.5',
34
- 'stix2extensions',
35
- ]
19
+ "stix2",
20
+ "python-arango>=8.1.3; python_version >= '3.8'",
21
+ "tqdm>=4.66.4; python_version >= '3.7'",
22
+ "jsonschema>=4.22.0; python_version >= '3.8'",
23
+ "requests>=2.31.0; python_version >= '3.7'",
24
+ "python-dotenv>=1.0.1",
25
+ "pyyaml",
26
+ "python-slugify",
27
+ "validators>=0.34.0",
28
+ "llama-index-core>=0.12.42",
29
+ 'llama-index-llms-openai>=0.4.5',
30
+ 'stix2extensions',
31
+ 'json-repair',
32
+ ]
36
33
  [project.urls]
37
34
  Homepage = "https://github.com/muchdogesec/txt2detection"
38
35
  Issues = "https://github.com/muchdogesec/txt2detection/issues"
@@ -50,4 +47,4 @@ llms = ['txt2detection[anthropic,gemini,deepseek,openrouter]']
50
47
 
51
48
 
52
49
  [tool.hatch.build.targets.wheel.force-include]
53
- "config" = "txt2detection/config"
50
+ "config" = "txt2detection/config"
@@ -265,8 +265,9 @@ def run_txt2detection(
265
265
  created=detection.date,
266
266
  modified=detection.modified,
267
267
  )
268
- detection.level = kwargs.get("level", detection.level)
269
- detection.status = kwargs.get("status", detection.status)
268
+ kwargs['license'] = kwargs.get('license') or detection.license
269
+ detection.level = kwargs.get("level") or detection.level
270
+ detection.status = kwargs.get("status") or detection.status
270
271
  detection.date = as_date(kwargs.get("created"))
271
272
  detection.modified = as_date(kwargs.get("modified"))
272
273
  detection.references = kwargs["reference_urls"]
@@ -1,6 +1,7 @@
1
1
  import io
2
2
  import logging
3
3
  import typing
4
+ import json_repair
4
5
 
5
6
  from llama_index.core.output_parsers import PydanticOutputParser
6
7
 
@@ -16,4 +17,5 @@ class ParserWithLogging(PydanticOutputParser):
16
17
  print(text, file=f)
17
18
  print("=================close=================" + "\n" * 5, file=f)
18
19
  logging.debug(f.getvalue())
19
- return super().parse(text)
20
+ repaired_json = json_repair.repair_json(text)
21
+ return super().parse(repaired_json)
File without changes
File without changes