授权导入范围后是否可以浏览电子表格?

Is it possible to browse a spreadsheet when an importrange has been authorized?

我在 google 驱动器上创建了多个传播sheet。所以我是所有这些的所有者。

我有一个 spreadsheet (MASTER) 用作主文件,将数据导出到我与团队共享的其他 spreadsheets (ACTIVITY REPORT)顾问。导出的数据使他们能够使用列表作为数据验证等,这有助于主文件分析他们activity(无需清理数据)。

因为我已经批准了与顾问团队共享的 spreadsheets 上的 master 的导入范围,所以我知道已经创建了一个连接。因此,他们可以更改 ACTIVITY REPORT 中的公式,以访问我不希望他们在我的 MASTER 文件中看到的数据。

对所有内容使用范围名称或特定的 sheet exported/imported 会阻止他们浏览他们想要的内容(他们基本上需要传播的 IDsheet 和范围,其中包括 sheet 或命名范围的名称)。

但我想知道 Apps Script 是否允许他们这样做(浏览我的主文件以了解我如何命名我的 sheets、范围等),因为如果是这样的话,然后在编辑使用的传播 sheet 上授权导入范围可以允许他们基本上导入他们想要的文件中的任何内容,包括敏感或机密信息,使用命名范围或通过 sheet 的名称不专用于导出的 s。

But I wanted to know if Apps Script could allow them to do that (browse my MASTER File to know how I named my sheets, ranges, and so on),

在我的简短测试中,应用程序脚本 authorization/permissions 似乎与 importrange 授权分开。因此,如果 He/She 已经无法访问 Master。然而,从站上的编辑器能够通过 importrange 公式访问主站。

来自support,

Spreadsheets must be explicitly granted permission to pull data from other spreadsheets using IMPORTRANGE. The first time the destination sheet pulls data from a new source sheet, the user will be prompted to grant permission. Once access is granted, any editor on the destination spreadsheet can use IMPORTRANGE to pull from any part of the source spreadsheet. The access remains in effect until the user who granted access is removed from the source.


Using Range Names or a specific sheet for all the things to be exported/imported prevents them from browsing what they want (they basically need the ID of the spreadsheet and a range which includes the name of a sheet or a named range).

本质上,您想使用 Sheet name/Range 名称作为密码。在我的简短测试中,遇到了以下问题:

  • 暴力破解是一种可能性。 SheetName/RangeName 应该有 >30 位的熵,即随机 sheet names/special characters/uppercase/lowercase 个字母有 >8 个字符。

  • 关于 importrange 的运作方式并没有透露太多信息。这意味着,Google 将来很容易允许应用程序脚本访问,而您可能不知道。

  • 最后,也是最重要的,Sheet-name/Range-name 是完全可选的。

    The sheet_name component of range_string is optional; by default IMPORTRANGE will import from the given range of the first sheet.

换句话说,任何编辑都可以不受限制地访问第一个 sheet。例如,以下导入是完全有效的:

=IMPORTRANGE("SPREADSHEETURL", "A1:Z")

此外,如果您不小心将主传播sheet中的敏感sheet移动到左侧,使其成为第一个sheet,所有编辑者都可以轻松访问该sheet 移动后。为了将这种风险降到最低,您可以创建一个 spreadsheet 系统:Master>slave1(只有一个 sheet 导入。没有编辑器)>slave1 的从属(1 个编辑器;从 slave1 导入)。这样的话,即使slave1sheet的名字被猜到了,Mastersheet也是安全的

判决:

使用 importrange() 来保护任何敏感数据的安全是个坏主意。此外,使用 importrange 超过几个 sheets 充其量是不可靠的。出于所有目的,最好完全避免使用 importrange。虽然比公式有点繁琐,但对于 spreadsheet 同步,从性能和安全角度来看,最好使用 "Standalone" 脚本。