README.md

drive-public-files

A Google Apps Script that audits all of your Google Drive files for any publicly shared files and sends you an email with the results.

Public Google Drive documents

Public Google Drive documents can be viewed or edited by anyone with the link. These documents can even show up in Google searches if they are "Public on the web." Public sharing is useful for crowd sourcing information or publishing content, but it's not appropriate for sensitive information.

Often people create public Google Drive files because they're not aware they can share with other Google users directly. Public sharing is also the default sharing option in the Google Drive UI.

Auditing public Google Drive documents

The Google Drive UI does not let you search for your publicly shared files. G Suite Admins or security teams may need to help users identify their public Google Drive files.

I created this project to solve this problem. It uses the Google Drive SDK search feature via the searchFiles() method in Google Apps Script DriveApp to find files with a visibility of anyoneCanFind or anyoneWithLink. The script then emails the user the names and URLs of their public Drive files.

Running the script

I publicly shared this script so that anybody can view or run it. You will see warnings from Google that this script is unsafe. This because I have not published it the Chrome Web Store as a Google-reviewed add-on or web app.