Skip to content

fix(waf) : handle waf log format #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

adrien-goetz-wmx
Copy link

#42

I add two options to fix 2 bugs I found when running the script.

N°1 : --convert_date

Traceback (most recent call last):
File "/Users/adrien/cloudgrep/cloudgrep.py", line 3, in
main.main()
File "/Users/adrien/cloudgrep/cloudgrep/main.py", line 69, in main
CloudGrep().search(
File "/Users/adrien/cloudgrep/cloudgrep/cloudgrep.py", line 117, in search
matching_keys = list(
^^^^^
File "/Users/adrien/cloudgrep/cloudgrep/cloud.py", line 186, in get_objects
if self.filter_object(obj, key_contains, from_date, end_date, file_size, convert_date=convert_date):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/adrien/cloudgrep/cloudgrep/cloud.py", line 246, in filter_object
if from_date and last_modified < from_date:
^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: can't compare offset-naive and offset-aware datetimes

I force conversion of from_date, end_date and last_modified variables using pytz

N°2: --use_og_name

When deciding if file should be uncompressed, script looks for .gz extension in tmp_name file generated by tempfile and not in original bucket key

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant