{"id":19527605,"url":"https://github.com/bugfender/google-drive-audit","last_synced_at":"2025-04-26T11:31:55.518Z","repository":{"id":43479358,"uuid":"425893241","full_name":"bugfender/google-drive-audit","owner":"bugfender","description":"Google Drive permission audit tool","archived":false,"fork":false,"pushed_at":"2023-07-04T09:02:28.000Z","size":39,"stargazers_count":11,"open_issues_count":4,"forks_count":6,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-03-27T12:55:03.697Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bugfender.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":"audit/audit.go","citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-11-08T15:32:31.000Z","updated_at":"2023-11-06T09:54:48.000Z","dependencies_parsed_at":"2022-07-14T18:47:12.750Z","dependency_job_id":null,"html_url":"https://github.com/bugfender/google-drive-audit","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugfender%2Fgoogle-drive-audit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugfender%2Fgoogle-drive-audit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugfender%2Fgoogle-drive-audit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugfender%2Fgoogle-drive-audit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bugfender","download_url":"https://codeload.github.com/bugfender/google-drive-audit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224032184,"owners_count":17244373,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T01:15:43.051Z","updated_at":"2024-11-11T01:15:43.993Z","avatar_url":"https://github.com/bugfender.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Google Drive Audit tool\n\nThis is a utility to assist in the audit of Google Drive. \nIt lists all files for all users in all the company's drives, together with who has access to them.\n\n## Setup\nThis tool requires some setup to be able to work:\n\n* Create a new project in Google Cloud Platform web console\n  * Navigate to https://console.developers.google.com (Google Cloud Platform web console) while logged in as a G-Suite administrator within the domain to be crawled (if the user is not added within the correct domain then the correct data will not be identified).\n  * Create a new project.\n  * Select Application type\n\n* Once a new project has been created, navigate to APIs\u0026Services → OAuth consent screen.\n  * Set User type to \"Internal\".\n  * Provide the name for new application.\n  * Click Save.\n\n* Create a new service account\n  * In Google Cloud Platform web console, navigate to Credentials and click Create Credentials.\n  * Then, click Service account.\n  * Create service account as described in Google official article.\n  * On the Grant this service account access to project (optional) step, do not select any roles.\n  * On the Grant users access to this service account (optional) step, do not grant any user access. Click Done.\n\n* Create a service account key.\n  * On the Service accounts section, click edit on the account you want to create a key for.\n  * Click (menu) icon under Actions and select Create key.\n  * In the Create private key for \u003cService account name\u003e dialog, select JSON format, and download the file to a known location as it will be required later.\n\n* Delegate domain-wide authority to the service account\n  * On the Service accounts section, select your service account and click Edit.\n  * Click the Show Domain-Wide Delegation link and tick the Enable G Suite Domain-wide Delegation checkbox.\n  * Click Save.\n  * Once completed, review the \"Domain wide delegation\" column for this account and make sure that the delegation enabled.\n  * Click the View Client ID link.\n  * Copy your Client ID, you will need it later.\n\n* Enable Google Drive API\n  * In Google Cloud Platform web console, navigate to the API Dashboard and select Enable APIs and Services (if APIs have not previously been enabled).\n  * Search for Google Drive API and click Enable (or Manage).\n  * Search for Admin SDK API and click Enable (or Manage).\n\n* Allow the use of the application in Google Workspace Admin Console\n  * Navigate to http://admin.google.com\n  * Navigate to Security → API Controls → Manage Domain-wide Delegation within the Google admin portal.\n  * Set the client name to the Client ID you copied on the previous step.\n  * Set the API scopes `https://www.googleapis.com/auth/drive.readonly` \n    and `https://www.googleapis.com/auth/admin.directory.user.readonly`\n    (and `https://www.googleapis.com/auth/drive` if you want to perform write operations)\n    and select Authorize.\n\nCredit to https://helpcenter.netwrix.com/NDC/NDC/Config_Infrastructure/Configure_GDrive.html\n\n## Building\n\n```\ngo build\n```\n\n## Usage\n\n```\ngoogle-drive-audit audit [flags]\n\nFlags:\n-a, --admin-email string   email address of a domain administrator\n-c, --credentials string   service credentials file (obtained from Google Cloud Platform console) (default \"credentials.json\")\n-d, --domain string        domain name to audit\n-o, --output string        output file (default \"-\")\n-q, --quiet                do not show progress\n```\n\nExample:\n\n    google-drive-audit audit --domain=yourcompany.com --admin-email=you@yourcompany.com\n    google-drive-audit report\n    google-drive-audit unshare --domain yourcompany.com --admin-email you@yourcompany.com --user ex.employee@yourcompany.com\n\n## Limitations\n\nThis tool only works on Google Workspaces domains.\n\n## Roadmap\n\nThis tool could do other useful things for an administrator:\n\n* Copy files shared by external users (to keep in case they were un-shared)\n\nThese features will be implemented when needed, if ever. Please feel free to contribute.\n\n\n## Support\n\nThis tool is open source and free to use (see `LICENSE`), but you can get commercial \nsupport from Beenario GmbH for a fee. Contact us if you're interested.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbugfender%2Fgoogle-drive-audit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbugfender%2Fgoogle-drive-audit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbugfender%2Fgoogle-drive-audit/lists"}