Skip to content
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

Google Drive Connector Fails When "Malware or Spam" Is Detected #1339

Open
0xRy4n opened this issue Apr 17, 2024 · 0 comments
Open

Google Drive Connector Fails When "Malware or Spam" Is Detected #1339

0xRy4n opened this issue Apr 17, 2024 · 0 comments

Comments

@0xRy4n
Copy link
Contributor

0xRy4n commented Apr 17, 2024

The Google Drive connector will fail if a file is detected as containing "Malware or Spam".

<HttpError 403 when requesting https://www.googleapis.com/drive/v3/files/<SNIP>?alt=media returned "This file has been identified as malware or spam and cannot be downloaded.". Details: "[{'message': 'This file has been identified as malware or spam and cannot be downloaded.', 'domain': 'global', 'reason': 'cannotDownloadAbusiveFile'}]">

This is problematic in cases where company content is likely to trigger such a warning. In my case, the content in question is content related to penetration testing as my company deals with educational cybersecurity content and labs.

This (supposedly) can be remedied by using the acknowledgeAbuse=True in the get_media() call. For example, on line 330 of google_drive/connector.py you have:

response = service.files().get_media(fileId=file["id"]).execute()

Which could be changed to:

response = service.files().get_media(fileId=file["id"], acknowledgeAbuse=True).execute()

Obviously, whether this is a behavior you want is highly circumstantial.

I am suggesting having this as a connector configuration setting. You would then wrap these calls to catch the error and recall with the acknowledgeAbuse argument if the setting to allow this is enabled.

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

No branches or pull requests

1 participant