{"id":27170999,"url":"https://github.com/devwithkaiju/drivepermissionchecker","last_synced_at":"2026-04-29T00:02:30.796Z","repository":{"id":270096794,"uuid":"909327315","full_name":"DevWithKaiju/DrivePermissionChecker","owner":"DevWithKaiju","description":"Google Drive のフォルダ内のファイルの権限が不適切なものを Slack に通知する GAS","archived":false,"fork":false,"pushed_at":"2025-01-05T13:30:35.000Z","size":12,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-06T16:28:32.821Z","etag":null,"topics":["google-apps-script","google-drive","slack"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DevWithKaiju.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-28T11:21:22.000Z","updated_at":"2025-01-05T13:30:38.000Z","dependencies_parsed_at":"2024-12-28T12:21:23.063Z","dependency_job_id":"34e38127-ef7a-4952-bd82-8899bfdf0751","html_url":"https://github.com/DevWithKaiju/DrivePermissionChecker","commit_stats":null,"previous_names":["kaijuatut/drivepermissionchecker","devwithkaiju/drivepermissionchecker"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevWithKaiju%2FDrivePermissionChecker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevWithKaiju%2FDrivePermissionChecker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevWithKaiju%2FDrivePermissionChecker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevWithKaiju%2FDrivePermissionChecker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DevWithKaiju","download_url":"https://codeload.github.com/DevWithKaiju/DrivePermissionChecker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248000311,"owners_count":21031158,"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":["google-apps-script","google-drive","slack"],"created_at":"2025-04-09T08:22:10.364Z","updated_at":"2026-04-29T00:02:30.785Z","avatar_url":"https://github.com/DevWithKaiju.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DrivePermissionChecker\n\n## これはなに\n\nGoogle Drive API (v3) を使用して、指定フォルダ以下の全ファイルを高速にスキャンし、不適切な権限設定（外部共有など）があるファイルを検知して Slack に通知する GAS スクリプト。  \n従来の `DriveApp` クラスを使ったスクリプトに比べて高速に動作するため、ファイル数が多い環境でもタイムアウトしにくい（はず）。\n\n## できること\n\n* **高速スキャン**: Drive API を使用し、サブフォルダを含む大量のファイルを効率よくチェックする。\n* **権限チェック**: 以下の条件に該当するファイルを「不適切」とみなす。\n  * 「リンクを知っている全員」が閲覧可能な状態\n  * 指定した許可ドメイン（例: `@gmail.com`）以外のアカウントに共有されている状態\n* **Slack 通知**:\n  * 不備ファイルの一覧を Slack に通知する。（上位 30 件までを表示）\n* **除外設定**: 特定のキーワード（例: `【共有用】`）を含むファイルはチェック対象から除外できる。\n\n## 使い方\n\n1. **スクリプトの準備**: Google Apps Script エディタにコードを貼り付ける。\n2. **Drive API の有効化**:\n    * エディタ左側の「サービス」の `+` ボタンをクリックする。\n    * **Drive API** を選択し、「追加」をクリックする（このコードのバージョンは **v3** に対応）。\n3. **設定の入力**:\n    * コード内の `SETTINGS` オブジェクトを環境に合わせて書き換える。\n    * `TARGET_FOLDER`: チェックしたい親フォルダの ID\n    * `SLACK_URL`: Slack の Incoming Webhook URL\n    * `SAFE_DOMAINS`: 許可するドメイン（配列形式）\n4. **実行**:\n    * `main` 関数を実行し、権限承認を行う。\n    * 必要に応じて「トリガー」を設定し、定期実行させる。\n\n## 通知サンプル\n\n権限設定に不備があった場合、Slack に以下のような通知が飛ぶ。\n\n\u003e 🚨 **Drive権限チェック: 35件の不備が見つかりました**  \n\u003e **[内部資料] 2025年度予算案.pdf**  \n\u003e ⚠️ リンクを知っている全員がアクセス可能  \n\u003e **顧客リスト.xlsx**  \n\u003e 🚫 外部共有: outsider@example.com [writer]  \n\u003e *(...他 5 件（件数が多いため省略）)*  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevwithkaiju%2Fdrivepermissionchecker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevwithkaiju%2Fdrivepermissionchecker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevwithkaiju%2Fdrivepermissionchecker/lists"}