Google Drive setup

Google Drive offers cloud-based storage for your policy and claim files, which can be automatically retrieved, uploaded, and stored in BriteCore.

BriteCore setup

Get started

To get started:

  1. Set up a Google account for your company.
  2. Contact BriteCore or your developer to complete the account setup.

Enable Google Drive access

To enable Google Drive access:

  1. On the Google APIs screen, select the Select from dialog box, and then select NEW PROJECT.
  2. On the New Project screen, complete the following steps:
    1. In the Project Name box, type the project name.
    2. In the Organization dropdown list, select the applicable organization.
    3. In the Location box, select BROWSE, navigate to and select the applicable location, and then select Select.
    4. Select CREATE.
  3. On the Google APIs screen, under G Suite, select Google Drive API.
  4. On the Google Drive API screen, select Enable.
  5. On the Google Drive API Overview screen, select CREATE CREDENTIALS.
  6. Under Find out what kind of credentials you need, select service account.
  7. On the Service accounts screen, select CREATE SERVICE ACCOUNT.
  8. On the Create service account screen, complete the following steps:
    1. In the Service account name box, type the account name.
    2. In the Service account ID box, type a unique ID.

      Note: Keep a record of the Service account ID.

    3. In the Service account description box, type a description for the account.
    4. Select Create.

      Note: If prompted to enter a Key type, type .p12.

    5. Complete the optional steps if applicable.
    6. Select Done.

Enable drive event generation

To enable Google Drive event generation:

  1. In the APIs & Services menu, select Domain verification.
  2. On the Domain verification screen, select Add domain.
  3. In the Configure webhook notifications for glassy-operand dialog box, in the Domain box, type your BriteCore URL (e.g., companyname.britecorepro.com), and then select Add domain.

Verify domain ownership

To verify domain ownership:

  1. In the Domain verification dialog box, select Take me there or log in to your Google account, and then complete the following steps:
    1. Select Add a property.
    2. Type your BriteCore URL (e.g., companyname.britecorepro.com), and then select Continue.
    3. Select Alternate methods, copy the content, and then paste it below Update Statement.

UPDATE settings
SET value = 'YIwP_Sz_gLkj6UTjWw-JABpaqz4gMHe5KNdT73DsFOk'
WHERE option = 'domain-verification-code'

Note: You may need to contact BriteCore for assistance.

    1. Run the statement against your database, and then select Verify.
    2. Check that your domain has been verified.
    3. In the developer console, in the APIs & Services menu, select Domain verification.

      Note: If your BriteCore site domain doesn’t appear, select Add domain, type your BriteCore URL (e.g., companyname.britecorepro.com), and then select Add domain.

Ordinary mode activation

Note: Since the Privileged mode activation requires BriteCore to make domain changes, use the Ordinary mode to complete the activation.

  1. Open the client site terminal.
  2. Open ipython: PYTHONPATH=/srv/www/britecore/lib ipython.

    Note: If you don’t run ipython in /lib, you will receive an error: ImportError: No module named vendors.google.

  3. Locate your .p12 key from when you enabled Google Drive, and then identify its path.

    Note: You can use CyberDuck to move the file to a specific folder on the site.

  4. Run the commands from lines 102-112.

    Note: If you run each command individually, run settings.save() after each line.

    • For the settings.auth.service_account command (line 105), replace the provided account with your service account.
    • For the settings.auth.key_data command (line 106), replace the provided path with your .p12 key path.
    • For the settings.feature.webhooks_mountpoint command (line 108), replace the provided path with the client’s BriteCore URL.

      Note: If you use the incorrect path to the .p12 key, you will receive an error: IOError: [Errno 2] No such file or directory.

Run the provisioning sequence

To run the provisioning sequence:

  1. Open ipython: PYTHONPATH=/srv/www/britecore/lib ipython.

    Note: If you don’t run ipython in /lib, you will receive an error: ImportError: No module named vendors.google.

  2. Run the commands from lines 123-126.

    Note: If you run each command individually, run settings.save() after each line.

To fix errors:

  • If you receive HttpAccessTokenRefreshError: invalid_client: The OAuth client was not found when running indexer = GoogleDrivePolicyIndexerFactory().create(), there is an issue with credentials. Ensure the credentials and paths are correct.

    Note: You may need to delete the Service Account Key and generate a new one.

  • If you receive GoogleDrivePolicyIndexerError: failed to share file with user account when running indexer.remote_setup(), there is an intermittent, erroneous error. Wait a few minutes, then rerun the command.

BriteCore processing

To set up BriteCore processing:

  1. In Google Drive, upload files according to the accepted file structure.

    Note: The files will pull into the correct policy or claim within an External Documents folder.

  2. Remove any non-indexed files.

Additional information

For additional information, you can read the Google Drive content in GitHub: