Commit fe2e337
Use UTC-aware datetimes for task and machine timestamps (#2841)
* Adding fix for yara-python installation (#2825)
* Bump aiohttp from 3.13.2 to 3.13.3 (#2826)
---
updated-dependencies:
- dependency-name: aiohttp
dependency-version: 3.13.3
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Bump pynacl from 1.5.0 to 1.6.2 (#2828)
Bumps [pynacl](https://github.com/pyca/pynacl) from 1.5.0 to 1.6.2.
- [Changelog](https://github.com/pyca/pynacl/blob/main/CHANGELOG.rst)
- [Commits](pyca/pynacl@1.5.0...1.6.2)
---
updated-dependencies:
- dependency-name: pynacl
dependency-version: 1.6.2
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Bump urllib3 from 2.3.0 to 2.6.3 (#2832)
Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.3.0 to 2.6.3.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](urllib3/urllib3@2.3.0...2.6.3)
---
updated-dependencies:
- dependency-name: urllib3
dependency-version: 2.6.3
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Update behavior.py
* Bump pypdf from 5.2.0 to 6.6.0 (#2835)
Bumps [pypdf](https://github.com/py-pdf/pypdf) from 5.2.0 to 6.6.0.
- [Release notes](https://github.com/py-pdf/pypdf/releases)
- [Changelog](https://github.com/py-pdf/pypdf/blob/main/CHANGELOG.md)
- [Commits](py-pdf/pypdf@5.2.0...6.6.0)
---
updated-dependencies:
- dependency-name: pypdf
dependency-version: 6.6.0
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Bump werkzeug from 3.1.4 to 3.1.5 (#2834)
Bumps [werkzeug](https://github.com/pallets/werkzeug) from 3.1.4 to 3.1.5.
- [Release notes](https://github.com/pallets/werkzeug/releases)
- [Changelog](https://github.com/pallets/werkzeug/blob/main/CHANGES.rst)
- [Commits](pallets/werkzeug@3.1.4...3.1.5)
---
updated-dependencies:
- dependency-name: werkzeug
dependency-version: 3.1.5
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* ci: Update requirements.txt
* Bump aiohttp from 3.13.2 to 3.13.3 (#2837)
---
updated-dependencies:
- dependency-name: aiohttp
dependency-version: 3.13.3
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Bump urllib3 from 2.3.0 to 2.6.3 (#2836)
Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.3.0 to 2.6.3.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](urllib3/urllib3@2.3.0...2.6.3)
---
updated-dependencies:
- dependency-name: urllib3
dependency-version: 2.6.3
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* fix mongo_search_query not defined when hash doesnt exist in mongodb
* webgui timezone moved to config
* Use UTC-aware datetimes for task and machine timestamps
✦ I have standardized the timestamps in lib/cuckoo/core/database.py to use naive UTC, ensuring consistency across the database schema and logic.
Summary of Changes:
1. Defaults: Updated Guest.started_on to use a naive UTC lambda default (lambda: datetime.now(timezone.utc).replace(tzinfo=None)).
2. Logic: Replaced all occurrences of datetime.now() (local time) and datetime.utcnow() (deprecated) with datetime.now(timezone.utc).replace(tzinfo=None) in the following methods:
- set_task_status
- lock_machine / unlock_machine
- set_machine_status
- guest_stop
- check_file_uniq
- add (for PCAP/Static)
- clean_timed_out_tasks
- update_clock
3. Fixes:
- Fixed minmax_tasks to correctly handle naive UTC timestamps when converting to Unix timestamps (preventing local timezone offset issues).
- Updated datetime.utcfromtimestamp(0) calls to datetime.fromtimestamp(0, timezone.utc).replace(tzinfo=None).
This ensures that all timestamps stored and processed in lib/cuckoo/core/database.py are consistently naive UTC.
Note on Tests:
The file tests/test_database.py contains assertions using datetime.datetime.now() (local time). Depending on your testing environment's timezone and freezegun configuration, you may need to update those tests to
expect naive UTC timestamps to match these changes.
* fix
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Josh R. <jershmagersh@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: GitHub Actions <action@github.com>1 parent d8572ce commit fe2e337
File tree
10 files changed
+183
-167
lines changed- conf/default
- installer
- lib/cuckoo
- common
- core
- modules/processing
- tests
- web/web
10 files changed
+183
-167
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
802 | 802 | | |
803 | 803 | | |
804 | 804 | | |
805 | | - | |
806 | | - | |
| 805 | + | |
807 | 806 | | |
808 | 807 | | |
809 | 808 | | |
810 | 809 | | |
811 | 810 | | |
812 | 811 | | |
813 | | - | |
814 | | - | |
| 812 | + | |
815 | 813 | | |
816 | 814 | | |
817 | 815 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1422 | 1422 | | |
1423 | 1423 | | |
1424 | 1424 | | |
| 1425 | + | |
| 1426 | + | |
1425 | 1427 | | |
1426 | 1428 | | |
1427 | 1429 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
17 | 23 | | |
18 | 24 | | |
19 | 25 | | |
| |||
307 | 313 | | |
308 | 314 | | |
309 | 315 | | |
310 | | - | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
311 | 319 | | |
312 | 320 | | |
313 | 321 | | |
| |||
474 | 482 | | |
475 | 483 | | |
476 | 484 | | |
477 | | - | |
| 485 | + | |
478 | 486 | | |
479 | 487 | | |
480 | 488 | | |
481 | 489 | | |
482 | | - | |
| 490 | + | |
483 | 491 | | |
484 | 492 | | |
485 | 493 | | |
| |||
818 | 826 | | |
819 | 827 | | |
820 | 828 | | |
821 | | - | |
| 829 | + | |
822 | 830 | | |
823 | 831 | | |
824 | | - | |
| 832 | + | |
825 | 833 | | |
826 | 834 | | |
827 | | - | |
| 835 | + | |
828 | 836 | | |
829 | 837 | | |
830 | 838 | | |
831 | 839 | | |
832 | 840 | | |
833 | 841 | | |
834 | 842 | | |
835 | | - | |
| 843 | + | |
836 | 844 | | |
837 | | - | |
| 845 | + | |
838 | 846 | | |
839 | 847 | | |
840 | 848 | | |
| |||
965 | 973 | | |
966 | 974 | | |
967 | 975 | | |
968 | | - | |
| 976 | + | |
969 | 977 | | |
970 | 978 | | |
971 | 979 | | |
| |||
1061 | 1069 | | |
1062 | 1070 | | |
1063 | 1071 | | |
1064 | | - | |
| 1072 | + | |
1065 | 1073 | | |
1066 | 1074 | | |
1067 | 1075 | | |
| |||
1073 | 1081 | | |
1074 | 1082 | | |
1075 | 1083 | | |
1076 | | - | |
| 1084 | + | |
1077 | 1085 | | |
1078 | 1086 | | |
1079 | 1087 | | |
| |||
1119 | 1127 | | |
1120 | 1128 | | |
1121 | 1129 | | |
1122 | | - | |
| 1130 | + | |
1123 | 1131 | | |
1124 | 1132 | | |
1125 | 1133 | | |
| |||
1250 | 1258 | | |
1251 | 1259 | | |
1252 | 1260 | | |
1253 | | - | |
| 1261 | + | |
1254 | 1262 | | |
1255 | 1263 | | |
1256 | 1264 | | |
| |||
1292 | 1300 | | |
1293 | 1301 | | |
1294 | 1302 | | |
1295 | | - | |
| 1303 | + | |
1296 | 1304 | | |
1297 | 1305 | | |
1298 | 1306 | | |
1299 | 1307 | | |
1300 | | - | |
| 1308 | + | |
1301 | 1309 | | |
1302 | 1310 | | |
1303 | 1311 | | |
| |||
1982 | 1990 | | |
1983 | 1991 | | |
1984 | 1992 | | |
1985 | | - | |
| 1993 | + | |
1986 | 1994 | | |
1987 | 1995 | | |
1988 | 1996 | | |
| |||
2225 | 2233 | | |
2226 | 2234 | | |
2227 | 2235 | | |
2228 | | - | |
| 2236 | + | |
2229 | 2237 | | |
2230 | 2238 | | |
2231 | 2239 | | |
| |||
2246 | 2254 | | |
2247 | 2255 | | |
2248 | 2256 | | |
2249 | | - | |
| 2257 | + | |
2250 | 2258 | | |
2251 | 2259 | | |
2252 | 2260 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
130 | | - | |
| 130 | + | |
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| |||
0 commit comments