Git Product home page Git Product logo

github-leak-audit's Introduction

GitHub Leak Audit

A GitHub workflow that scans your organization members' personal public repos for code that has potentially been leaked from your organization. Usually, this is a simple mistake, but it is currently impossible for organizations to prevent because GitHub doesn't support managed accounts.

When the workflow is done searching for potentially leaked code, it will build a report and email it to the email addresses you specify.

Setup Instructions

1. Fork this Repo

Fork this repo under the ownership of the organization you want to monitor for leaks.

2. Set up required secrets

For this app to function, it needs access to your organization's resources in the GitHub API. You have two options for authentication (click each option for setup instructions):

  1. GitHub App creation (generate private key and install it in your organization)
  2. Personal Authentication Token (PAT) creation

For a classic PAT, you will need "read:org" permission. For a GitHub App, you need Organization -> Members -> Read-only permission.

PATs are a little simpler, but creating a GitHub App for your organization is the preferred method for two reasons. First, it has a better rate limit in GitHub's API and is less likely to fail if you have a lot of members. Second, it isn't tied to an individual user account, so you won't run into issues if the individual who sets this up leaves the GitHub organization.

This app also needs email credentials to send the report email. You'll need to provide an SMTP server address as well as credentials for the account that is sending the email.

Below is an overview of the secrets that will need to be set up in your forked repo (including the ones mentioned above). Here is a link to documentation on how to set up GitHub Actions secrets.

Secret Description Required
APP_ID The App ID of the GitHub App you created If not using PAT
PRIVATE_KEY The private key of the GitHub App you created If not using PAT
PAT You can use a personal access token (PAT) instead of a GitHub App If not using App
ORG_NAME Your organization's username as it appears on GitHub Yes
ORG_NICKNAME The short name of your organization used to identify potential leaks (ex. Microsoft) Yes
EMAIL_SERVER SMTP server address to send the email report Yes
EMAIL_USERNAME Username to authenticate to the SMTP server Yes
EMAIL_PASSWORD Password to authenticate to the SMTP server Yes
EMAIL_RECIPIENTS Comma-separated list of emails to receive report (no spaces) Yes

3. Enable GitHub Actions workflow

Once the secrets are set up in your forked repo, you'll need to enable the workflow to allow the leak audit to run periodically. By default, forked repos will disable any GitHub Actions. To re-enable them, you can go to the "Actions" tab in your repo and enable workflows.

Once enabled, the leak audit should run every day at 2:30am CST.

github-leak-audit's People

Contributors

lawndoc avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.