Skip to content
This repository has been archived by the owner on Apr 26, 2021. It is now read-only.

Commit

Permalink
revert mongodb sorting tweaks #2006
Browse files Browse the repository at this point in the history
This was a good proposal by sebdg, however, it turns out that MongoDB
requires quite some (or at least, too much) memory for such sorting
rules, rendering this kind of useless on bigger'ish installations.

For what it's worth, these sorting rules were put in place so that,
after reprocessing an analysis, the latest results would be visible in
the Web Interface. Naturally the better and longterm solution will be to
completely delete any previous results. This is (still) a TODO item.

Thanks to seantree, nicpenning, and sebdg for identifying this issue and
providing a proper workaround. Keeping in mind the above the best way
forward seems to revert these changes for now, though.
  • Loading branch information
jbremer committed Dec 8, 2017
1 parent 3846eb6 commit 1c1259b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
9 changes: 3 additions & 6 deletions cuckoo/web/analysis/views.py
Expand Up @@ -57,8 +57,7 @@ def chunk(request, task_id, pid, pagenum):
{
"behavior.processes.pid": 1,
"behavior.processes.calls": 1
},
sort=[("_id", pymongo.DESCENDING)]
}
)

if not record:
Expand Down Expand Up @@ -103,8 +102,7 @@ def filtered_chunk(request, task_id, pid, category):
{
"behavior.processes.pid": 1,
"behavior.processes.calls": 1,
},
sort=[("_id", pymongo.DESCENDING)]
}
)

if not record:
Expand Down Expand Up @@ -149,8 +147,7 @@ def search_behavior(request, task_id):
record = results_db.analysis.find_one(
{
"info.id": int(task_id),
},
sort=[("_id", pymongo.DESCENDING)]
}
)

# Loop through every process
Expand Down
5 changes: 1 addition & 4 deletions cuckoo/web/controllers/analysis/api.py
Expand Up @@ -316,10 +316,7 @@ def tasks_recent(request, body):
# TODO Use a mongodb abstraction class once there is one.
cursor = mongo.db.analysis.find(
filters, ["info", "target"],
sort=[
("info.id", pymongo.DESCENDING),
("_id", pymongo.DESCENDING),
]
sort=[("_id", pymongo.DESCENDING)]
).limit(limit).skip(offset)

tasks = {}
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -143,7 +143,7 @@ def do_setup(**kwargs):

do_setup(
name="Cuckoo",
version="2.0.5",
version="2.0.5.1",
author="Stichting Cuckoo Foundation",
author_email="cuckoo@cuckoofoundation.org",
packages=[
Expand Down

0 comments on commit 1c1259b

Please sign in to comment.