Organization
この章では、GitHub Organizationの作成、メンバー管理、チーム階層、権限設定について学びます。
Organizationとは
Section titled “Organizationとは”Organizationは、複数のリポジトリとメンバーを一元管理するためのアカウント種別です。企業やチーム、オープンソースプロジェクトで利用されます。
個人アカウントとの違い
Section titled “個人アカウントとの違い”| 項目 | 個人アカウント | Organization |
|---|---|---|
| 所有者 | 1人 | 複数人可能 |
| リポジトリ | 個人所有 | 組織所有 |
| メンバー管理 | コラボレーター | チーム単位 |
| 権限設定 | 基本的 | 詳細 |
| 請求 | 個人 | 組織一括 |
Organizationの作成
Section titled “Organizationの作成”- 右上のプロフィールアイコン → Settings
- 左メニューの「Organizations」
- 「New organization」をクリック
| プラン | 価格 | 主な機能 |
|---|---|---|
| Free | 無料 | 公開リポジトリ無制限、プライベート制限あり |
| Team | $4/ユーザー/月 | プライベート無制限、高度な権限管理 |
| Enterprise | $21/ユーザー/月 | SAML SSO、監査ログ、高度なセキュリティ |
# Organization 作成時の設定項目Organization name: my-companyBilling email: billing@company.comOrganization URL: github.com/my-company
# プロフィール設定Display name: My CompanyDescription: We build amazing softwareWebsite: https://company.comLocation: Tokyo, Japanメンバー管理
Section titled “メンバー管理”メンバーの招待
Section titled “メンバーの招待”Organization → People → Invite member:
招待方法:1. GitHubユーザー名またはメールで検索2. 役割を選択(Owner / Member)3. チームを選択(オプション)4. 招待を送信
招待の有効期限: 7日間メンバーの役割
Section titled “メンバーの役割”| 役割 | 説明 |
|---|---|
| Owner | 全権限を持つ管理者 |
| Member | 通常のメンバー |
| Billing manager | 請求管理のみ |
| Security manager | セキュリティ設定のみ |
Ownerの責任
Section titled “Ownerの責任”Ownerができること:- メンバーの追加/削除- チームの作成/管理- リポジトリの作成/削除- 組織設定の変更- 請求情報の管理- Webhookの設定- 2要素認証の強制
推奨:- Ownerは2-3人に限定- 重要な操作は複数人で確認- 監査ログを定期確認メンバーの削除
Section titled “メンバーの削除”削除手順:1. People → メンバーを選択2. 「Remove from organization」3. 確認ダイアログで承認
削除時の影響:- 組織のリポジトリへのアクセス喪失- チームからも自動削除- 個人フォークは保持される- 過去のコミット履歴は残るチームの作成
Section titled “チームの作成”Organization → Teams → New team:
Team name: backend-teamDescription: バックエンド開発チームTeam visibility: Visible(全メンバーに表示)Parent team: engineering(オプション)チームの階層構造
Section titled “チームの階層構造”engineering (親チーム)├── frontend-team│ ├── react-team│ └── design-system-team├── backend-team│ ├── api-team│ └── database-team└── devops-team ├── infrastructure-team └── ci-cd-team権限の継承:- 親チームの権限は子チームに継承- 子チームに追加権限を付与可能- 一括での権限変更が容易
通知:- 親チームへのメンションで全員に通知- @engineering で engineering 以下全員に通知
管理:- 組織構造を反映した管理- 人事異動への対応が容易チームへのリポジトリ割り当て
Section titled “チームへのリポジトリ割り当て”チーム → Repositories → Add repository:
設定: Repository: my-company/backend-api Permission: Write
権限レベル: - Read: 閲覧のみ - Triage: Issue/PR管理 - Write: プッシュ可能 - Maintain: リポジトリ設定の一部 - Admin: 全権限Organization → Settings → Member privileges:
Base permissions: ☐ No permission(アクセスなし) ☑ Read(読み取りのみ) ☐ Write(書き込み可能) ☐ Admin(管理者)
推奨: Read または No permission理由: 最小権限の原則リポジトリ作成権限
Section titled “リポジトリ作成権限”Repository creation: ☐ Members can create public repositories ☑ Members can create private repositories ☐ Members can create internal repositories
理由:- パブリックリポジトリは誤って機密情報を公開するリスク- プライベートリポジトリは比較的安全フォーク設定
Section titled “フォーク設定”Repository forking: ☐ Allow forking of private repositories
理由:- フォークはコードの複製- 管理外に機密コードが流出するリスク組織のプロフィール
Section titled “組織のプロフィール”プロフィール設定
Section titled “プロフィール設定”Organization → Settings → Profile:
Organization profile: Display name: My Company Inc. Email: contact@company.com Description: Building the future of software URL: https://company.com Location: Tokyo, Japan
Profile README: # .github リポジトリに profile/README.md を配置プロフィールREADME
Section titled “プロフィールREADME”# Welcome to My Company
私たちは革新的なソフトウェアを開発しています。
## 主要プロジェクト- [product-a](https://github.com/my-company/product-a) - メインプロダクト- [open-source-lib](https://github.com/my-company/open-source-lib) - OSSライブラリ
## Join Us- [採用情報](https://company.com/careers)- [ブログ](https://blog.company.com)
## Contact- Email: dev@company.com- Twitter: @mycompanyセキュリティ設定
Section titled “セキュリティ設定”2要素認証の強制
Section titled “2要素認証の強制”Organization → Settings → Authentication security:
Two-factor authentication: ☑ Require two-factor authentication for everyone
結果:- 2FAなしのメンバーは組織から除外- 新規メンバーは2FA設定が必須- セキュリティの大幅な向上SSHキーと個人アクセストークン
Section titled “SSHキーと個人アクセストークン”SSH certificate authorities: # 組織用SSH CA を設定可能(Enterprise)
Personal access token requirements: ☑ Require approval for fine-grained personal access tokens # メンバーのPAT使用を管理Organization → Settings → Audit log:
確認できる内容:- メンバーの追加/削除- リポジトリの作成/削除- 権限の変更- Webhookの設定- 2FA の有効化/無効化
フィルタリング: action:repo.create action:org.add_member actor:username中級者向けTips
Section titled “中級者向けTips”大規模組織の管理
Section titled “大規模組織の管理”# 100人以上の組織での推奨設定
チーム構造: - 部門ごとの親チーム - プロジェクトごとの子チーム - クロスファンクショナルチーム
権限管理: - CODEOWNERS の活用 - ブランチ保護ルール - Required reviewers
自動化: - メンバー同期(SAML/LDAP) - チーム同期(GitHub Teams Sync) - Terraform での管理Terraformでの管理
Section titled “Terraformでの管理”resource "github_organization_settings" "org" { billing_email = "billing@company.com" name = "My Company" description = "Building amazing software"
default_repository_permission = "read" members_can_create_repositories = false members_can_create_public_repositories = false}
resource "github_team" "engineering" { name = "engineering" description = "Engineering team" privacy = "closed"}
resource "github_team" "backend" { name = "backend" description = "Backend team" privacy = "closed" parent_team_id = github_team.engineering.id}GitHub CLI での管理
Section titled “GitHub CLI での管理”# メンバー一覧gh api /orgs/{org}/members --jq '.[].login'
# チーム一覧gh api /orgs/{org}/teams --jq '.[].name'
# メンバー招待gh api /orgs/{org}/invitations -f email="user@example.com" -f role="direct_member"
# チーム作成gh api /orgs/{org}/teams -f name="new-team" -f description="New team"監査ログの自動エクスポート
Section titled “監査ログの自動エクスポート”# GitHub Enterprise の場合Settings → Audit log → Stream to: - Amazon S3 - Azure Blob Storage - Datadog - Splunk - Google Cloud Storage| 項目 | 推奨設定 |
|---|---|
| Ownerの数 | 2-3人に限定 |
| Base permission | Read または None |
| 2FA | 必須 |
| リポジトリ作成 | 制限推奨 |
Organizationのベストプラクティス
Section titled “Organizationのベストプラクティス”- 最小権限: ベース権限は最小限に
- チーム単位管理: 個人ではなくチームに権限付与
- 階層構造: 組織構造を反映したチーム階層
- 2FA必須: セキュリティの基本
- 定期監査: 権限とメンバーを定期的にレビュー
- ドキュメント化: 組織ポリシーを明文化
推奨設定チェックリスト
Section titled “推奨設定チェックリスト”# Organization 設定チェックリスト
## 基本設定- [ ] プロフィール完成- [ ] プロフィールREADME作成- [ ] 請求情報設定
## セキュリティ- [ ] 2FA必須化- [ ] ベース権限を最小化- [ ] フォーク制限- [ ] 監査ログ確認体制
## チーム- [ ] チーム階層の設計- [ ] 権限の割り当て- [ ] CODEOWNERSの設定
## 運用- [ ] Ownerのバックアップ- [ ] 退職者対応プロセス- [ ] 定期レビューのスケジュール次の章では、Enterprise機能について学びます。
Q1. GitHub Organizationの主な用途は何ですか?
Q2. Organization内のチームの役割は何ですか?
Q3. Organization Ownerができることは何ですか?