GitHub Plugin for Threat Exchange
GitHub Plugin for Threat Exchange
This document explains how to configure the GitHub plugin with the Threat Exchange module of the Netskope Cloud Exchange platform. This integration allows for sharing of file hashes of GitHub repository files with Netskope.
To complete this configuration, you need:
- A Netskope Tenant (or multiple, for example, production and development/test instances).
- A Netskope Threat Prevention subscription for malicious file hash sharing.
- A Netskope Cloud Exchange tenant with the Threat Exchange module already configured.
- A GitHub Account with access to repositories from which the file hashes are required to be fetched.
- Get the GitHub API token.
- Configure the GitHub Plugin.
- Configure sharing between Netskope and GitHub.
- Validate the GitHub Plugin.
Click play to watch a video.
- Log in to GitHub.
- In the top right corner of any page, click your profile photo, and then click Settings.
- In the left panel, click Developer settings.
- In the left panel, click Personal access tokens.
- Click Generate new token from top right corner.
- In Note, give your token a descriptive name.
- Select the following scopes for repo and user.
- Click the Generate token icon.
- Copy the newly generated token by pressing and save it in a secure location. This token is used to configuring the GitHub plugin.
- In Cloud Exchange, go to Settings and click Plugins.
- Search for and select the GitHub plugin box to open the plugin creation pages.
- Enter the Basic Information on the first page:
- Configuration Name: Enter a name appropriate for your integration.
- Poll Interval: Adjust to environment needs. We recommend not to go below 5 minutes for production environments.
- Aging Criteria: Leave the default.
- Override Reputation: Leave the default.
- Enable SSL Verification: Leave the default.
- Click Next.
- Enter the Configuration Parameters on the second page:
- Base URL: Enter the Base URL of your GitHub API (only if default needs to be changed).
- API Token: Enter your GitHub API token.
- Repository Name: Enter comma-separated names of the repositories for which the file hashes are to be fetched. Leave empty to include all accessible repositories.
- Tag: Leave the default.
- Quota Limit: Leave the default.
- Click Save in the top right corner. Go to Threat Exchange > Plugins to see your new GitHub plugin.
- Go to Threat Exchange and select Sharing. The Sharing page displays the existing relationships for each sharing configuration in grid view as shown below. The Sharing page also has inputs to configure new sharing from one plugin to another.
- Click Add Sharing Configuration, and in the Source Configuration dropdown list, select Github.
- Select a Business Rule, and then select Netskope for the Destination Configuration. Sharing configurations are unidirectional. data obtained from one plugin is shared with another plugin. To achieve bi- or multi-directional sharing, configure each separately.
- Select a Target. Each plugin will have a different target or destination for the IoC.
Depending on the Target selected, Add to URL List or Add to File Hash List, the remaining options change. If using a File Hash List, jump to the next step.
For a URL List, select a List Name, enter a New List Name. The List Name must exist in the Netskope UI. For information about creating a URL List, refer to Add a URL List. Now select a URL List Type, and then a List Size and Default URL.
- For Add a File Hash List, enter a List Name, List Size, and Default File Hash. The List Name needs to exist in your Netskope UI at Settings > Policies > Profiles. For information about creating a File Profile for hashes, refer to Adding a File Profile
- Click Save.
- Repeat steps 2-6, but select Netskope as the Source Configuration and GitHub as the Destination Configuration.
- Click Save.
Adding a new sharing configuration on the active source poll will share the existing IoCs of the source configuration to the destination configuration. Whenever a new sharing configuration is built, all the active IoCs will also be considered for sharing if they match the source/destination combination.
Plugins that do not have API for ingesting data cannot receive threat data. This is true of the installed plugin API Source, which provides a bucket associated with an API endpoint for remote 3rd-party systems to push data to. Once a Sharing policy has been added, it takes effect.
After a sharing configuration has been created, the sharing table will show the rule being invoked, the source system providing the potential IoC matches, the destination system that will receive matching IoC, and the target applicable to that rule. Multiple Sharing configurations can be made to support mapping certain IoC to multiple targets even on the system destination system.
Modify, Test, or Delete a Sharing Configuration
Each configuration supports 3 actions:
- Edit the rule by clicking on the pencil icon.
- Test the rule by clicking on the synchronization icon. This tests how many IoC will actually be sent to the destination system based on the timeframe and the rule.
- Delete the rule by clicking on the garbage can icon.
In order to validate the integration you must have at least one repository accessible to the configured user on GitHub.
- Go to Threat Exchange, and click Threat IoCs. You should see records from your GitHub plugin. You can filter based on Source values to check both the Netskope and GitHub plugin.
- In the Netskope UI, go to Policies > File > Your Custom File Profile and click File Hash.
- If data is not being brokered between the platforms, you can look at the audit logs in Cloud Exchange. In Cloud Exchange go to Logging and look through the logs for errors.