Skip to content

Conversation

@pull
Copy link

@pull pull bot commented Feb 10, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

doomedraven and others added 11 commits February 10, 2026 12:30
* file details cache

  Summary of Changes:

   1. Modified `lib/cuckoo/common/objects.py`:
       * Updated File.init_yara to calculate a SHA256 hash of all compiled YARA rule files.
       * Stored this hash in File.yara_rules_hash.

   2. Modified `modules/processing/CAPE.py`:
       * In process_file, imported mongo_find_one from dev_utils.mongodb.
       * Implemented logic to query the MongoDB files collection using the file's SHA256.
       * Cache Hit: If the file is found and yara_hash matches, file_info is populated from the database, skipping expensive operations like f.get_all() (PE parsing, initial YARA scan) and static_file_info.
       * Partial Cache Hit: If the file is found but yara_hash differs, the cached data is loaded, but YARA scans are re-run (f.get_yara()), and the yara_hash field is updated. static_file_info is still skipped to
         avoid re-extracting/re-analyzing static properties.
       * Cache Miss: If the file is not in the DB, standard processing proceeds, and yara_hash is added to file_info for future caching.

  This solution optimizes processing time for previously analyzed files while ensuring YARA scan results remain up-to-date when rules change.

* more

* fix

* Update CAPE.py

* Update CAPE.py

* Update test_file_extra_info.py

* fixes

* Update objects.py

* make it on/off
Add additional static fields (yara, cape_yara, yara_hash, options_hash, clamav) to mongo normalization so they aren't stripped. In CAPE processing, ensure the internal pe object is populated (f.get_type(); pefile_object = f.pe) for full and partial hits, and fill missing options_hash and yara_hash for partial results. Also ensure file name and guest_paths are set when absent. These changes restore metadata removed by mongo_hooks and ensure pefile and hash fields are available for downstream results.
@pull pull bot locked and limited conversation to collaborators Feb 10, 2026
@pull pull bot added the ⤵️ pull label Feb 10, 2026
@pull pull bot merged commit 410fa9a into threatcode:master Feb 10, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant