GitHub Logs
Panther supports pulling GitHub logs directly and audit log streaming
Overview
Panther supports the following methods of ingesting logs from GitHub:
Panther can fetch GitHub audit logs by querying the GitHub API for new events every one minute.
This method works at GitHub's Organization level.
Panther can ingest GitHub audit logs using GitHub's audit log streaming feature via AWS S3 or Google Cloud Storage.
This method works at GitHub's Enterprise level.
Panther supports ingesting GitHub webhooks directly via HTTP.
This method works at GitHub's Organization level.
How to onboard GitHub Organization logs to Panther
Your Github Organization needs to be part of a Github Enterprise Cloud deployment. The Github Enterprise Server self-hosted option is not yet supported.
Step 1: Authorize Panther in GitHub
There are two different options to authorize Panther to receive GitHub audit logs:
Create a new OAuth App in GitHub and provide the app credentials to Panther
Generate a Personal Access Token in GitHub and provide credentials to Panther
Option 1: Create a new OAuth App
The steps below can only be performed if you have organization owner permission in your GitHub organization and a GitHub Enterprise subscription. If you need to configure multiple integrations for different GitHub Organizations using the same credentials, you can either use a Personal Access Token or an OAuth2 App that is created on the user account, instead of the Organization account. If any Organizations have enabled OAuth2 App Access Restrictions, the app must be first approved by an Organization admin.
Log in to your GitHub Enterprise account.
On the homepage of your organization's account, click on the Settings tab.
Scroll to the bottom of the page and click on Developer Settings and then OAuth Apps.
Click on Register an application. Fill in the form:
Enter a memorable application name into the Name field e.g.
Panther Integration.Enter your Panther instance's primary URL into the Homepage URL field e.g.
https://test.runpanther.xyzCopy the Redirect URL from Panther and paste into the Authorization Callback URL field.
To do this, you will need to log into Panther and set up GitHub as a log source by following the directions below. Once you've made it to the step where you see a Redirect URL, you can copy it and continue setting up your GitHub app.
Once all necessary fields are filled in, click Register Application.
Once the application is registered, you can view the Client ID and generate a new Client Secret. Store them in a secure location – you will need them in the next steps.
Option 2: Generate a personal access token
The steps below can only be performed if you have organization owner permission in your GitHub organization and a GitHub Enterprise subscription. You can read more on generating a Personal Access Token in GitHub here.
Log in to your Github Enterprise account.
Click on your profile then click on the Settings option.
Scroll to the bottom of the page and click on Developer Settings and then Personal Access Token.
Click Generate new token and enter a descriptive token name, e.g.,
Panther Integration.Select the scopes, or permissions, you'd like to grant this token.
Select the
read:audit_logscope.If the
read:audit_logscope is not available to you, select theadmin:org>read:orgpermission instead.
You do not need to enable the
write:orgpermission.
Click Generate token.
Copy the token and store it in a secure location – you will need it in the next steps.
Step 2: Create a new GitHub API source in Panther
In the lefthand navigation bar of your Panther Console, click Configure > Log Sources.
Click Create New.
Search for “GitHub API,” then click its tile.
On the slide-out panel, click Start Setup.
On the next screen, enter a descriptive name for the source (for example,
My Github Audit logs) and the name of the Github organization you want to monitor.Click Setup.
Authorize Panther to receive logs from GitHub - depending on the option you chose above, follow the steps below:
Use OAuth2 Authorization Flow: Enter the App Client ID and the Client Secret that you acquired from Github. You can find this information on the details page of the OAuth app in your Github account once you register the application.
Use a Personal Access Token: Copy the personal access token key and paste it into Personal Access token field.
Click Setup.
You will be presented with the option to Grant Access.
Click Authorize.
You will be directed to a success screen:

You can optionally enable one or more Detection Packs.
The Trigger an alert when no events are processed setting defaults to YES. We recommend leaving this enabled, as you will be alerted if data stops flowing from the log source after a certain period of time. The timeframe is configurable, with a default of 24 hours.

How to onboard GitHub logs via audit log streaming to Panther
There are two steps to configure GitHub audit log streaming with Panther:
Set up audit log streaming from GitHub to a storage destination.
Create a new GitHub Audit Log Streaming source in Panther.
Prerequisite
Audit log streaming must be configured in GitHub by your GitHub enterprise owner.
Step 1: Set up audit log streaming from GitHub to a storage destination
Panther supports ingesting GitHub audit log streaming data from two storage destinations. Choose one of the storage destinations below:
AWS S3
Follow the instructions here: Setting up streaming for Amazon S3.
Google Cloud GCS
Follow the instructions here: Setting up streaming to Google Cloud Storage.
Step 2: Create a new GitHub audit log streaming source in Panther
In the lefthand navigation bar of the Panther Console, click Configure > Log Sources.
Click Create.
Search for GitHub. Select the GitHub Audit Log Streaming tile.

Select either S3 or GCS, depending on the transport method you chose.
Follow the onboarding process for your chosen destination method:
For S3, follow the documentation on how to enable Panther to pull logs from S3.
After creating your S3 bucket in Panther, navigate to the source's Schema tab, and click Advanced Edit & Test with Raw Events.

Set an S3 Exclusion Filter with a value of
_check.
For GCS, follow the documentation on how to enable Panther to pull logs from GCS.
How to onboard GitHub webhook events
Panther supports ingesting GitHub webhook events directly via HTTP.
Step 1: Create a GitHub Webhooks source in Panther
In the left-hand navigation bar of your Panther Console, click Configure > Log Sources.
Click Create New.
Search for “GitHub Webhooks,” then click its tile.
In the slide-out panel, the Transport Mechanism dropdown in the upper right corner will be pre-populated with the HTTP option.
Click Start Setup.

Follow Panther's instructions for configuring an HTTP Source, beginning at Step 5.
During setup, for Logs Stream Type, choose JSON.
During setup, the Auth method will be preset to HMAC, and the HMAC Header Name will be preset to
X-Hub-Signature-256.Save the Secret Key Value you enter, as you'll need it in the next step.
Step 2: Create the webhook in GitHub
See detailed instructions for creating a GitHub webhook in GitHub's Creating webhooks documentation.
In GitHub, navigate to your organization.
In the left-hand navigation bar, click Webhooks.

Click Add Webhook.
Enter values for the following fields:
Content Type: Set to to
application/json.Payload URL: Set to the HTTP Source URL you generated in Panther in Step 1.
Secret value: Set this as the value you used during HTTP source creation in Step 1.
Choose which events you want Panther to receive. All event types are supported, but not all of them have security value.
See descriptions of event types in GitHub's Webhook events and payloads documentation.
Click Add Webhook.
Panther-managed detections
See Panther-managed rules for GitHub in the panther-analysis GitHub repository.
All Panther-managed GitHub detections include the filter_include_event helper function. You can customize this function to include or exclude certain logs based on a field value. This filter may be useful if you're using audit log streaming to ingest GitHub enterprise logs, but you'd like to filter out certain organizations. As an example, see it in use in the GitHub.Action.Failed detection.
Querying logs in Data Explorer
To see examples of querying GitHub logs in Panther's Data Explorer, see Github Audit logs queries.
Supported log types
GitHub.Webhook
GitHub webhooks emit notifications for any event generated within your GitHub organization or repository. For more information, see GitHub's webhook documentation.
Github.Audit
The audit log allows organization administrators to quickly review actions performed by members of your organization. For more information, see GitHub's documentation on accessing audit logs.
Last updated
Was this helpful?

