Disable Spreadsheet copy - Google Sheets

Viewed 3072

I would like to allow users to use my spreadsheet but not copy it as it contains intellectual property. I tried going to sharing settings and disabling:

  1. Editors can change permissions and share

  2. Viewers and commenters can see the option to download, print, and copy

But the sheet can still be copied. Ideas?

3 Answers

Unfortunately, it is not possible to disable copy / download for editors.

You can only do that for commenters and viewers.

As a workaround, I would advice you to keep your sensitive information into one master file and then importrange or copy via a script the shareable information into another file. So even if they copy or download the latter your sensitive information won't be copied / downloaded.

Related questions:

There isn't any sure way to hide your data. Once something is published on the internet, you should consider it saved on many devices all over the world. Consider some ways to get hidden spreadsheet data

Attack scenarios:

  • By far the easiest way is CTRLC and CTRLV(Copy and Paste)
  • Editor menu options: File->Copy and File->Export
  • Once your file id is visible, any editor or even viewer with access to the file can easily copy the file itself through
  • Screenshot and use OCR(Optical character recognition)
  • View source code in the browser and directly copy the table
  • Simulate browser using

Hiding data:

Data may be hidden from naive users. Data cannot be hidden from users, who know the basics of how the web works.

  • Add ?rm=minimal to url, when sharing the sheets file. This hides all menu options.See here
  • Frame the edior in a iframe in your own website and use to hide the top portion of the web page.

Hiding Logic:

You may still be able to hide logic of your code.

  • IMPORTRANGE: This is a very basic and easy way to hide your logic. But there are limitations and any editor can access any part of your master spreadsheet.

  • You can implement a IMPORTRANGE like logic using custom functions and webapps. This gives more control over the connector and secures your master spreadsheet much better than IMPORTRANGE. Here,

    • Two web apps are created, each associated with a spreadsheet(Master and client).
    • You use two KEYs to communicate between them. One for access and other for encryption.
    • Once access is verified, the data from master spreadsheet is encrypted and sent back to the custom function. Simultaneously the encryption key is posted to the client webapp.
    • The key here is the Master/Server webapp posts the encryption key only to the published client web app link. So, no other sheet or anything else can intercept the key or decrypt the data. Furthermore, a random key is generated for each access.
  • Another option is to let go off the spreadsheet completely and use a single webapp to show the data. This hides the logic in server scripts and linked spreadsheets.

Comment thoughts:

Create a script onOpen to kill sheets if the file is wrong?

onOpen cannot post data anywhere without the new copy owner permission. It's not possible to kill sheets. But data can be erased.

/**
 * Deletes all sheets on the copy, if a copy is made 
 */
const onOpen = () => {
  const ss = SpreadsheetApp.getActive();
  const id = ss.getId();
  const sheets = ss.getSheets();
  ss.insertSheet(sheets.length);//insert a blank sheet at the end
  if (id !== '###Original ID###') sheets.forEach(s => ss.deleteSheet(s));//will fail at the last sheet(doesn't matter)
};

But editor can modify the original script before making a copy. And a revision of the original spreadsheet will still be available. The new owner can revert to the original version, use api endpoints mentioned above to get the data. Also mobile apps don't support onOpen. New owners can simply use mobile versions to access data.

Use formula web-app to notify file owner, ?

Possible, but data is already copied and there's no specific information that can be used to accurately identify the new owner. You maybe able to get locale information though.

I think the simplest solution would be to copy and paste from the master file the range of values you want to share with the other document. In this scenario the editors of the other document won't have access to neither the code nor the full data of the master file since the latter won't be shared with them.

The copy and paste part can be done automatically via a script and a trigger mechanism to update the data automatically so you won't have to do anything manually and the master file won't be exposed to any user.

Related