You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-12Lines changed: 13 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,18 +3,18 @@
3
3
> [!NOTE]
4
4
> This is an _unofficial_ tool created by Field Security Specialists, and is not officially supported by GitHub.
5
5
6
-
These scripts provide an emulated Enterprise security manager team to GitHub Enterprise (cloud or server) administrators by using the existing organization security manager role.
6
+
These scripts provide an emulated Enterprise security manager team to GitHub Enterprise (Cloud or Server) administrators by using the existing organization Security Manager role.
7
7
8
-
The scripts will give you a list of all organizations in the enterprise as a CSV to work with programmatically, add you to all organizations as an owner, and can create/manage a team with the security manager role to see all GitHub Advanced Security alerts throughout the entire enterprise _without_ having admin rights to that code.
8
+
The scripts will give you a list of all organizations in the enterprise as a CSV to work with programmatically, add you to some or all organizations as an owner, and can create/manage a team with the Security Manager role to see all GitHub Advanced Security alerts throughout the entire enterprise _without_ having admin rights to that code.
9
9
10
10
> [!NOTE]
11
11
> This uses the [security manager role](https://docs.github.com/en/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization) and parts of the GraphQL API that is available in GitHub.com (free/pro/teams and enterprise), as well as GitHub Enterprise Server versions 3.5 and higher.
12
12
13
13
## Scripts
14
14
15
-
1.[`org-admin-promote.py`](/org-admin-promote.py) replaces some of the functionality of [`ghe-org-admin-promote`](https://docs.github.com/en/enterprise-server@latest/admin/configuration/configuring-your-enterprise/command-line-utilities#ghe-org-admin-promote), a built-in shell command on GHES that promotes an enterprise admin to own all organizations in the enterprise. It also outputs a CSV file similar to the `all_organizations.csv`[report](https://docs.github.com/en/enterprise-server@latest/admin/configuration/configuring-your-enterprise/site-admin-dashboard#reports), to better inventory organizations.
15
+
1.[`org-admin-promote.py`](/org-admin-promote.py) replaces some of the functionality of [`ghe-org-admin-promote`](https://docs.github.com/en/enterprise-server@latest/admin/configuration/configuring-your-enterprise/command-line-utilities#ghe-org-admin-promote), a built-in shell command on GHES that promotes an enterprise admin to own some/all organizations in the enterprise. It also outputs a CSV file similar to the `all_organizations.csv`[report](https://docs.github.com/en/enterprise-server@latest/admin/configuration/configuring-your-enterprise/site-admin-dashboard#reports), to better inventory organizations.
16
16
1.[`manage-sec-team.py`](/manage-sec-team.py) creates a team in each organization, assigns it the security manager role, and then adds the people you want to that team (and removes the rest).
17
-
1.[`org-admin-demote.py`](/org-admin-demote.py) takes the text file of orgs that the user wasn't already an owner of and "un-does" that promotion to org owner. The goal is to keep the admin account's notifications uncluttered, but running this is totally optional.
17
+
1.[`org-admin-demote.py`](/org-admin-demote.py) takes the text file of orgs that the user wasn't already an owner of and "un-does" that promotion to org owner. The goal is to keep the admin account's notifications uncluttered, but running this is totally optional.
18
18
19
19
## How to use it
20
20
@@ -63,7 +63,7 @@ The scripts will give you a list of all organizations in the enterprise as a CSV
63
63
- The security manager team isn't already an existing team that's using team sync [for enterprise](https://docs.github.com/en/enterprise-cloud@latest/admin/identity-and-access-management/using-saml-for-enterprise-iam/managing-team-synchronization-for-organizations-in-your-enterprise) or [for organizations](https://docs.github.com/en/enterprise-cloud@latest/organizations/organizing-members-into-teams/synchronizing-a-team-with-an-identity-provider-group).
64
64
- The Enterprise admin account doing this is not intended to be part of the security managers team you are creating (that would conflict with the demotion script)
65
65
66
-
## Any extra info?
66
+
## Example
67
67
68
68
This is what a successful run looks like. Here's the inputs:
69
69
@@ -72,10 +72,11 @@ This is what a successful run looks like. Here's the inputs:
72
72
- The organizations break down as such:
73
73
- `acme` org was already configured correctly.
74
74
- `testorg-00001` needed the team created, with `ghe-admin` removed and `luigi` and `hubot` added.
75
-
- `testorg-00002` was already created
75
+
- `testorg-00002` was already created.
76
+
- We've used the `--progress` flag
76
77
77
78
```console
78
-
$ ./manage-sec-team.py --sec-team-members luigi hubot
79
+
$ ./manage-sec-team.py --sec-team-members luigi hubot --progress
79
80
✓ Team security-managers updated as a security manager for acme
80
81
Creating team security-managers
81
82
✓ Team security-managers updated as a security manager for testorg-00001
@@ -92,8 +93,8 @@ Removing ghe-admin from security-managers
92
93
93
94
- Scripts that do things are in the root directory.
94
95
- Functions that do small parts are in `/src`, grouped roughly by what part of GitHub they work on.
95
-
- All Python code is formatted with [black](https://black.readthedocs.io/en/stable/) because it's simple and beautiful and no one needs to think about style.
96
-
- Python dependencies are minimal by default. There are two, both kept up-to-date with [Dependabot](https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/about-dependabot-version-updates). You can [check out the config file](.github/dependabot.yml) if you'd like.
97
-
- [requests](https://pypi.org/project/requests/) is a simple and extremely popular HTTP library.
98
-
- [defusedcsv](https://github.com/raphaelm/defusedcsv) is used over CSV to mitigate potential spreadsheet application exploitations based on how it processes user-generated data. OWASP has [written much more about CSV injection attacks on their website](https://owasp.org/www-community/attacks/CSV_Injection).
99
-
- The CSV files and TXT files are in the `.gitignore` file to not be accidentally committed into the repo.
96
+
- Python code is formatted with [black](https://black.readthedocs.io/en/stable/).
97
+
- Python dependencies are minimal by default. There are two:
98
+
- [requests](https://pypi.org/project/requests/) is a simple and popular HTTP library.
99
+
- [defusedcsv](https://github.com/raphaelm/defusedcsv) is used over `csv` to mitigate spreadsheet application exploitation in older versions.
100
+
- The `.csv` files and `.txt` files are in the `.gitignore` file to avoid accidental commits into the repo.
0 commit comments