cado-security/cloudgrep

file_size attribute problem with AWS

hberg32 opened this issue · 3 comments

Looks like there is a data type error when applying the file_size parameter to AWS.

python3 cloudgrep.py --bucket yyyy --prefix deletes/prod/ --profile saml --file_size 10000 --query 2bfebaafe66d7ad1ba67530abc4b41b8
Traceback (most recent call last):
File "/Users/xxx/cloudgrep/cloudgrep.py", line 3, in
main.main()
File "/Users/xxx/cloudgrep/cloudgrep/main.py", line 76, in main
CloudGrep().search(
File "/Users/xxx/cloudgrep/cloudgrep/cloudgrep.py", line 309, in search
matching_keys = list(
^^^^^
File "/Users/xxx/cloudgrep/cloudgrep/cloudgrep.py", line 218, in get_objects
if self.filter_object(obj, key_contains, from_date, end_date, file_size):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xxx/cloudgrep/cloudgrep/cloudgrep.py", line 161, in filter_object
if obj["Size"] == 0 or obj["Size"] > file_size:
^^^^^^^^^^^^^^^^^^^^^^^
TypeError: '>' not supported between instances of 'int' and 'str'

Thansk hberg32 I'll take a look

Hi @hberg32 this should now be fixed. Please re-open if not 👍

Went to test today and have a new error. This one is related to building yara. I'm not really a python guy so I can't tell if this is due to my local config or not. Maybe an item missing from requirements.txt? I'm using an Apple silicon macbook and Python 3.11.5, if that helps.

  yara/libyara/modules/pe/authenticode-parser/authenticode.c:22:10: fatal error: 'openssl/asn1.h' file not found
  #include <openssl/asn1.h>
           ^~~~~~~~~~~~~~~~
  1 error generated.
  error: command '/usr/bin/clang' failed with exit code 1