Giter VIP home page Giter VIP logo

drive-public-files's Introduction

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.

To run the script:

  1. Visit https://script.google.com/d/1BfmF_Iw728kZdTugkzDrH4FmTo0S_i78Fgt61QF55P9uuym8rPIrKIlU/edit.
  2. Click on the triangle run button (next to the spider debugger).
  3. Click "Review Permissions" when asked for authorization.
  4. Sign in to your Google account.
  5. Click on "Advanced" under "This app isn't verified."
  6. Click on "Go to Public Google Drive files audit (unsafe)."
  7. Click "Allow."
  8. The script will start to run. You should see a yellow banner with "Running function getPublicFiles..."
  9. You will receive an email report of your public Drive files when the script finishes.

Creating a copy

If you'd like to make a copy of this script in your own Google account:

  1. Visit https://script.google.com/d/1BfmF_Iw728kZdTugkzDrH4FmTo0S_i78Fgt61QF55P9uuym8rPIrKIlU/edit.
  2. Click on "File" then "Make a copy..."

Cloning a local copy with clasp

I used clasp to develop this script locally with git source control. If you'd like to clone this script locally with clasp:

  1. Globally install clasp - npm install -g @google/clasp.
  2. Login to your Google account with clasp - clasp login.
  3. Enable the Google Apps Script API on your Google account - https://script.google.com/home/usersettings.
  4. Create a copy of the script in your own account, see Creating a copy.
  5. Create a folder for the App Script files and change in to that directory.
  6. Run clasp clone <script ID>. The script ID is in the URL of your copy of the script.

drive-public-files's People

Contributors

alulsh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

drive-public-files's Issues

Entire Organization

Hi
Sorry to use the issues section. I cant find a way to ask a comment.

How do I use this run for an entire organization report for only public links that can appear on search engines?

what is the difference between "anyoneCanFind " and "anyoneWithLink "

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.