Skip to content

Commit

Permalink
Little adjusts (#2263)
Browse files Browse the repository at this point in the history
* little adjusts

* adjust

* refactored base_url in url to enable healthchecks

* adjust

* added update abstract method

* added logging of intel_owl package

* adjusted threatfox

* threatfox analyzer fix

* threatfox analyzer fix

* threatfox analyzer fix

* threatfox analyzer fix

* threatfox analyzer fix

* elastic shards/replicas reduced
  • Loading branch information
mlodic authored Apr 15, 2024
1 parent 7f2d633 commit e65b793
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
26 changes: 20 additions & 6 deletions api_app/analyzers_manager/observable_analyzers/threatfox.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@ def run(self):
response.raise_for_status()

result = response.json()
data = result.get("data", {})
if isinstance(data, dict):
ioc_id = data.get("id", "")
if ioc_id:
result["link"] = f"https://threatfox.abuse.ch/ioc/{ioc_id}"
data = result.get("data", [])
if data and isinstance(data, list):
for index, element in enumerate(data):
ioc_id = element.get("id", "")
if ioc_id:
result["data"][index][
"link"
] = f"https://threatfox.abuse.ch/ioc/{ioc_id}"
return result

@classmethod
Expand All @@ -39,7 +42,18 @@ def _monkeypatch(cls):
if_mock_connections(
patch(
"requests.post",
return_value=MockUpResponse({}, 200),
return_value=MockUpResponse(
{
"query_status": "ok",
"data": [
{
"id": "12",
"ioc": "139.180.203.104:443",
},
],
},
200,
),
),
)
]
Expand Down
3 changes: 2 additions & 1 deletion configuration/elastic_search_mappings/intel_owl_bi.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"settings" : {
"number_of_shards" : 1
"number_of_shards" : 1,
"number_of_replicas": 0
},
"mappings": {
"dynamic": false,
Expand Down

0 comments on commit e65b793

Please sign in to comment.