针对敏感数据的Google Apps脚本安全注意事项

时间:2017-05-29 17:39:16

标签: encryption google-apps-script google-docs two-factor-authentication google-document-viewer

我的任务是创建一个系统来存储人力资源部门的员工文书工作。我们深深扎根于Google Docs平台(我们的所有文档都是通过Google Apps制作和提供的),而且我已经在我们内部Google网站上运行的Google Apps脚本上构建了一个时钟程序,并从Google表格中获取数据。但是,这项新任务将包含更多敏感数据,这些数据应以加密方式存储,并在使用两个因子身份验证后提供。

TL; DR:我需要帮助创建一个系统,以加密方式提供网页,并在Google文档生态系统中使用双因素身份验证。

以下是一些我认为可能有助于描述我正在寻找的伪代码:

CODE.GS



//CONSTANT VARIABLES
var adminList = ['Sarah@mycompany.com', 
                 'Lewis@mycompany.com', 
                 'Tim@mycompany.com'];

function doGet() {
  var htmlTemplate = HtmlService.createTemplateFromFile('Login_Prompt');
  var htmlOutput = htmlTemplate.evaluate().setSandboxMode(HtmlService.SandboxMode.IFRAME).setTitle('Login to HR Module'); 
  return htmlOutput;
}

function processLogin(username)
{
  if(adminList.indexOf(username) > -1)
  {
    var htmlTemplate = HtmlService.createTemplateFromFile('Admin_Page');
    var htmlOutput = htmlTemplate.evaluate().setSandboxMode(HtmlService.SandboxMode.IFRAME).setTitle('HR Management Module'); 
    return htmlOutput;
  }
  
  else
  {
    var htmlTemplate = HtmlService.createTemplateFromFile('User Page');
    var htmlOutput = htmlTemplate.evaluate().setSandboxMode(HtmlService.SandboxMode.IFRAME).setTitle('Employee Profile'); 
    return htmlOutput;
  
  }
}




登录-Prompt.HTML



<!DOCTYPE html>
<html>
  <head>
    <base target="_top">
  </head>
  <body>
    <h4>HR Management Console</h4>
    <p>Please log into this system using your Google Account Credentials</p>
    <form>
    Username: <input type="text" size = "6">
    Password: <input type="password" size = "4">
    <button>Submit</button>
    </form>
  </body>
</html>
&#13;
&#13;
&#13;

User_Page.html

&#13;
&#13;
<!DOCTYPE html>
<html>
  <head>
    <base target="_top">
  </head>
  <body>
    <h4> Welcome, User!</h4>
    <h5>Profile</h5>
    <ul>
      <li>Sensitive information 1</li>
      <li>Sensitive information 2</li>
      <li>Sensitive information 3</li>
      <li>Sensitive information 4</li>
    </ul>
    <button>Update your profile</button>
    <!-Open Form to access and edit personal data->
    
    <h5> Documents</h5>
    <ul>
     <li>Document 1</li>
     <li>Document 2</li>
     <li>Document 3</li>
     <li>Document 4</li> 
    </ul>
    <button>upload a document</button>
    <!-Open Form to upload HR Documents->
 
  </body>
</html>
&#13;
&#13;
&#13;

Admin_Page.html

&#13;
&#13;
<!DOCTYPE html>
<html>
  <head>
    <base target="_top">
  </head>
  <body>
    <p>Welcome, Manager!</p>
    <p>Users:</p>
    <ul>
      <li>LastName, FirstName 1 <button>Edit</button></li>
      <li>LastName, FirstName 2 <button>Edit</button></li>
      <li>LastName, FirstName 3 <button>Edit</button></li>
    </ul>
  </body>
</html>
&#13;
&#13;
&#13;

如何为此过程实施加密和双因素身份验证。使用Google Apps脚本在Google文档生态系统中可以做到这一点吗?

1 个答案:

答案 0 :(得分:0)

我认为我们将使用带有SSL证书的Cloud SQL托管的MySQL数据库。只要SSL线完好无损,我认为Google Appscript的嵌入式安全措施对我们来说应该足够了。感谢所有人帮助我们思考这个!