Merge branch 'main' of github.com:misp/pymisp

pull/1002/head
Christian Studer 2023-03-10 20:41:49 +01:00
commit ea67c171f7
8 changed files with 472 additions and 378 deletions

View File

@ -2,11 +2,61 @@ Changelog
=========
v2.4.169 (2023-03-10)
---------------------
Changes
~~~~~~~
- Bump version. [Raphaël Vinot]
- Bump templates. [Raphaël Vinot]
- Bump deps. [Raphaël Vinot]
Fix
~~~
- Add local key in MISPTag. [Raphaël Vinot]
Related #947
- Use pytest for the tests. [Raphaël Vinot]
v2.4.168.1 (2023-02-28)
-----------------------
New
~~~
- [doc] added the Jupyter notebook used in a.7-rest-api-extensive-
restsearch. [Alexandre Dulaunoy]
Changes
~~~~~~~
- Bump changelog, version. [Raphaël Vinot]
- Bump templates, again. [Raphaël Vinot]
- Bump templates. [Raphaël Vinot]
- Bump deps, templates. [Raphaël Vinot]
- Bump deps. [Raphaël Vinot]
- Bump deps. [Raphaël Vinot]
- Bump deps. [Raphaël Vinot]
- Bump deps. [Raphaël Vinot]
- Bump deps. [Raphaël Vinot]
- Bump deps. [Raphaël Vinot]
Fix
~~~
- Properly handle missing parameter in CSV importer. [Raphaël Vinot]
Fix #931
- Undefined variable in event delegation. [Raphaël Vinot]
- Remove reference to old pydeep. [Raphaël Vinot]
Fix #914
v2.4.168 (2023-01-23)
---------------------
Changes
~~~~~~~
- Bump changelog. [Raphaël Vinot]
- Bump version. [Raphaël Vinot]
- Bump deps. [Raphaël Vinot]
- Bump deps. [Raphaël Vinot]

View File

@ -52,7 +52,7 @@ poetry install -E fileobjects -E openioc -E virustotal -E docs -E pdfexport
### Running the tests
```bash
poetry run nosetests-3.4 --with-coverage --cover-package=pymisp,tests --cover-tests tests/test_*.py
poetry run pytest --cov=pymisp tests/test_*.py
```
If you have a MISP instance to test against, you can also run the live ones:
@ -60,7 +60,7 @@ If you have a MISP instance to test against, you can also run the live ones:
**Note**: You need to update the key in `tests/testlive_comprehensive.py` to the automation key of your admin account.
```bash
poetry run nosetests-3.4 --with-coverage --cover-package=pymisp,tests --cover-tests tests/testlive_comprehensive.py
poetry run pytest --cov=pymisp tests/testlive_comprehensive.py
```
## Samples and how to use PyMISP
@ -124,7 +124,7 @@ logging.basicConfig(level=logging.DEBUG, filename="debug.log", filemode='w', for
```bash
# From poetry
nosetests-3.4 -s --with-coverage --cover-package=pymisp,tests --cover-tests tests/testlive_comprehensive.py:TestComprehensive.[test_name]
pytest --cov=pymisp tests/test_*.py tests/testlive_comprehensive.py:TestComprehensive.[test_name]
```

767
poetry.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
__version__ = '2.4.168'
__version__ = '2.4.169'
import logging
import sys
import warnings

View File

@ -367,7 +367,7 @@ class AbstractMISP(MutableMapping, MISPFileCache, metaclass=ABCMeta):
class MISPTag(AbstractMISP):
_fields_for_feed: set = {'name', 'colour', 'relationship_type'}
_fields_for_feed: set = {'name', 'colour', 'relationship_type', 'local'}
def __init__(self, **kwargs: Dict):
super().__init__(**kwargs)
@ -386,6 +386,8 @@ class MISPTag(AbstractMISP):
self.relationship_type = ''
if not hasattr(self, 'colour'):
self.colour = '#ffffff'
if not hasattr(self, 'local'):
self.local = False
def _to_feed(self, with_local: bool = True) -> Dict:
if hasattr(self, 'exportable') and not self.exportable:

@ -1 +1 @@
Subproject commit 3d238ffc407563e2d81cfcb867f426ae4f0ae898
Subproject commit 1da4760dcc99502a2dd5da02cba212b42068fcb8

View File

@ -214,7 +214,8 @@ class EMailObject(AbstractMISPObjectGenerator):
filename=attch.longFilename)
cur_attach = message.get_payload()[-1]
self._update_content_disp_properties(attch, cur_attach)
message.set_boundary(_orig_boundry) # Set back original boundary
if _orig_boundry is not None:
message.set_boundary(_orig_boundry) # Set back original boundary
return message
@staticmethod
@ -235,7 +236,7 @@ class EMailObject(AbstractMISPObjectGenerator):
pass
@property
def attachments(self) -> List[Tuple[str, BytesIO]]:
def attachments(self) -> List[Tuple[Optional[str], BytesIO]]:
to_return = []
try:
for attachment in self.email.iter_attachments():

View File

@ -1,6 +1,6 @@
[tool.poetry]
name = "pymisp"
version = "2.4.168"
version = "2.4.169"
description = "Python API for MISP."
authors = ["Raphaël Vinot <raphael.vinot@circl.lu>"]
license = "BSD-2-Clause"
@ -47,7 +47,7 @@ requests = "^2.28.2"
python-dateutil = "^2.8.2"
jsonschema = "^4.17.3"
deprecated = "^1.2.13"
extract_msg = {version = "^0.39.1", optional = true}
extract_msg = {version = "^0.39.2", optional = true}
RTFDE = {version = "^0.0.2", optional = true}
oletools = {version = "^0.60.1", optional = true}
python-magic = {version = "^0.4.27", optional = true}
@ -74,12 +74,12 @@ brotli = ['urllib3']
[tool.poetry.group.dev.dependencies]
requests-mock = "^1.10.0"
mypy = "^1.0.1"
ipython = "^8.10.0"
mypy = "^1.1.1"
ipython = "^8.11.0"
jupyterlab = "^3.6.1"
types-requests = "^2.28.11.13"
types-python-dateutil = "^2.8.19.7"
types-redis = "^4.5.1.1"
types-requests = "^2.28.11.15"
types-python-dateutil = "^2.8.19.10"
types-redis = "^4.5.1.4"
types-Flask = "^1.1.6"
pytest-cov = "^4.0.0"