Skip to content

Commit dd190bf

Browse files
committed
fix(analyzers): raise configuration exception for non-email GENERIC observables in HudsonRock. Closes #3647
1 parent fd852b7 commit dd190bf

3 files changed

Lines changed: 55 additions & 0 deletions

File tree

api_app/analyzers_manager/observable_analyzers/hudsonrock.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ def run(self):
103103
+ self.get_param_url(["sortby", "page", "installed_software"])
104104
)
105105
response = requests.post(url, headers=headers, json={"login": self.observable_name})
106+
else:
107+
raise AnalyzerConfigurationException(
108+
f"Invalid GENERIC observable (not an email): {self.observable_name}"
109+
+ " for HudsonRock"
110+
)
106111
else:
107112
raise AnalyzerConfigurationException(
108113
f"Invalid observable type {self.observable_classification}"

issues_latest.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
[
2+
{
3+
"number": 3653,
4+
"title": "[BUG] job_pipeline task does not set job's final status on exception jobs get stuck in RUNNING forever",
5+
"url": "https://github.com/intelowlproject/IntelOwl/issues/3653",
6+
"labels": [
7+
"bug"
8+
]
9+
},
10+
{
11+
"number": 3647,
12+
"title": "[Bug] HudsonRock analyzer crashes when GENERIC observable is not an email",
13+
"url": "https://github.com/intelowlproject/IntelOwl/issues/3647",
14+
"labels": [
15+
"bug"
16+
]
17+
},
18+
{
19+
"number": 3639,
20+
"title": "Race condition in Job creation causes data loss",
21+
"url": "https://github.com/intelowlproject/IntelOwl/issues/3639",
22+
"labels": [
23+
"bug"
24+
]
25+
},
26+
{
27+
"number": 3623,
28+
"title": "Cross-organization data leakage in plugin_state_viewer endpoint",
29+
"url": "https://github.com/intelowlproject/IntelOwl/issues/3623",
30+
"labels": []
31+
},
32+
{
33+
"number": 3622,
34+
"title": "History artifacts tabs are broken",
35+
"url": "https://github.com/intelowlproject/IntelOwl/issues/3622",
36+
"labels": [
37+
"bug",
38+
"frontend"
39+
]
40+
}
41+
]

tests/api_app/analyzers_manager/unit_tests/observable_analyzers/test_hudsonrock.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from api_app.analyzers_manager.exceptions import AnalyzerConfigurationException
12
from api_app.analyzers_manager.observable_analyzers.hudsonrock import HudsonRock
23
from tests.api_app.analyzers_manager.unit_tests.observable_analyzers.base_test_class import (
34
BaseAnalyzerTest,
@@ -37,3 +38,11 @@ def get_mocked_response():
3738
200,
3839
),
3940
)
41+
42+
def test_invalid_generic_raises_exception(self):
43+
config = self.get_extra_config()
44+
config["observable_name"] = "johndoe123"
45+
46+
analyzer = self.analyzer_class(**config)
47+
with self.assertRaises(AnalyzerConfigurationException):
48+
analyzer.run()

0 commit comments

Comments
 (0)