9 ms·
Show HN: GitHub Org Audit Tool
This is a tool for auditing github organizations including their repos, users, and teams. It is useful for compliance, security and auditing.
- candiddevmike 4y agoWhy audit when you can declare all of this in Terraform? https://registry.terraform.io/providers/integrations/github/latest/docs https://registry.terraform.io/providers/integrations/github/...
- coenhyde 4y agoAs much a fan of Terraform I am. If you didn't started defining your repos in Terraform from day 0, importing hundreds of repos, members, permission sets would be quite a lot more work than running this audit tool.
- andrewstuart2 4y agoAnd quite frankly, terraform is great at first, and maybe for smaller projects, but for larger cases it becomes unmaintainable and unrefactorable pretty quickly.
- playingalong 4y agoAnd here comes Terraformer: https://github.com/GoogleCloudPlatform/terraformer https://github.com/GoogleCloudPlatform/terraformer It doesn't import anything, but generates the .tf files for you. Disclaimer: I have used that, but not for GitHub.
- gtirloni 4y agoTerraform doesn't know what it doesn't know. It only cares about stuff you defined in code and ignores all the rest. You can't use it for auditing purposes, except in its narrow scope.
- nikolay 4y agoI use that provider - it's one of the buggiest Terraform providers ever!
- megamorf 4y agoUnfortunately, it leaves a lot to be desired. I've actually had to do a fair bit of GH access reporting myself recently and I can recommend the GraphQL API as it allows you to properly list direct and indirect permissions on repositories (org + team + direct collaborator) that are alot harder to do with the REST API due to its inconsistent permissions model.
- benfrancom 4y agoNice, do you have anything you can share?
- pquerna 4y agoi've also been working on a similar tool -- working towards open sourcing it too. would you be interested in taking a look? paul.quenra at conductorone com
- LukeShu 4y agoIME, the problem with the GraphQL API is that it does a poor job of indicating where permissions came from, and you have to fall back to bad heuristics. For example, if team="company" has "READ", and team="company/dev" has "WRITE", and Bob is in team="company/dev" but not team="company", then Bob will have both "READ" and "WRITE" because of his membership in team="company/dev"; the API will give no indication that the "READ" indirectly came from team="company". Also, the permissions that the PAT needs in order for GraphQL to even list those things is excessive. Anyway, here's my audit script for such things: https://github.com/datawire/collaborators https://github.com/datawire/collaborators
- atonse 4y agoHow about using steampipe for this?
- nathanwallace 4y agoThanks atonse for the shout out! Steampipe [1] is an open source CLI to query your cloud resources (e.g. GitHub, AWS, Splunk, etc) with SQL. The GitHub plugin has 44 tables to query [2]. The "GitHub Sherlock" mod includes 34 automated controls for organization, repo and issue best practices. The "GitHub Compliance" mod has 35 automated controls for supply chain security. Mods are written in HCL + SQL. [3] 1 - https://steampipe.io https://steampipe.io 2 - https://hub.steampipe.io/plugins/turbot/github https://hub.steampipe.io/plugins/turbot/github 3 - https://hub.steampipe.io/mods?q=github https://hub.steampipe.io/mods?q=github
- benfrancom 4y agoThanks for sharing! Love these other options!
- FBISurveillance 4y agoQuick feedback: Just noticed that you can get rid of one setup step at https://steampipe.io/downloads https://steampipe.io/downloads - you don't need to brew tap & brew install, you can just use one command: `brew install turbot/tap/steampipe` without doing `brew tap` first.
- nathanwallace 4y agoGood idea - thanks, love the feedback :-)
- maartenh 4y agoAwesome! I built something like this for $JOB-1 too. Unfortunately didn't get to open source this before I left. I built in an a mechanism for policy checks too, e.g. to check that only an allowed list of repositories was public, and that permissions were only assigned through teams.
- serge1978 4y agoThis is super helpful!