Overview
This article provides step-by-step instructions for creating the Mend for GitHub Enterprise App in your GitHub Enterprise Environment.
Getting It Done
Creating the Mend for GitHub Enterprise App
-
Go to your GitHub Enterprise instance, select Settings > Organization, and then within the Organization Settings, select GitHub Apps from the Developer settings
-
Click the New GitHub app button
-
Enter your GitHub Enterprise password
-
The Register new GitHub App page is displayed
-
Fill in the fields according to these guidelines in steps 6 and 7
-
General:
-
GitHub App name: “Mend App”. NOTE: The name cannot contain an underscore (“__”)
-
Description: Mend for GitHub Enterprise
-
Homepage URL: https://mend.io
-
User authorization callback URL: empty
-
Setup URL (optional): empty
-
Webhook URL: A valid URL pattern. This is a temporary value that is changed at a later stage of the installation process
-
Webhook secret: Generate and enter a secret value (string) and make sure you copy this value somewhere. You will need it for later
-
-
Permissions & events:
This section lists every webhook event and permission the Mend for GitHub App requires, and what each one is used for. Mend.io follows a least-privilege approach: If something is not listed here, the app does not use it.
NOTE: Permission fields that are not specified below should be left as is ("No access")-
Repository permissions:
-
Administration: Read-only
Reads branch protection rules so Mend knows whether its check is a required status check. Read & Write is needed only if you want Mend to manage the branch protection rule itself — this is not the default. -
Checks: Read and write
Publishes scan results as check runs on commits and PRs. Write access is also what allows the re-run button in the Checks UI to reach Mend. -
Commit statuses: Read and write
Used by the remediation engine to post status updates on Mend remediation pull requests. -
Contents: Read and write
Reads your.whitesourceconfiguration and dependency manifests to run the scan. Write access is used to create remediation branches and dependency-upgrade commits. -
Custom properties: Read-only
Reads the custom property values set on a repository, used to map repositories to Mend products. -
Issues: Read and write
Creates and updates vulnerability issues, and posts or edits their comments as findings are resolved. -
Metadata: Read-only
Basic repository information. GitHub requires this for every app and it cannot be disabled. It is also what delivers the Repository event. -
Pages: Read and write
-
Projects: Read and write
-
Pull requests: Read and write
Opens remediation pull requests, reads PR contents for PR scans, and posts findings as PR comments. -
Webhooks: Read-only
-
Workflows: Read and write
-
Not required: Earlier versions of the setup guide asked for the following. Mend makes no API calls to any of them and subscribes to none of their events. If your app grants them, you can safely remove them.
-
Pages
-
Projects
-
Workflows
-
Deployments
-
Webhooks
-
-
-
Organization permissions:
-
Custom properties: Read-only
Reads organization-level custom property definitions. GitHub also requires this permission in order to deliver the Custom property and Custom property values events. -
Members: Read-only
GitHub requires this permission in order to deliver the Organization event. Mend uses it only to detect organization deletion and clean up the installation — it does not read your member list. GHE only. -
Not required: Earlier versions of the setup guide asked for the following. Mend makes no API calls to any of them and subscribes to none of their events. If your app grants them, you can safely remove them.
-
Pages
-
Projects
-
Workflows
-
Deployments
-
Webhooks
-
-
-
Webhook events: Subscribe the app to the following events. Each one triggers a specific part of the Mend workflow:
-
Check run - Lets you re-run a Mend security check directly from the GitHub Checks UI.
-
Create - Starts branch-aware scanning as soon as a new branch or tag is created.
-
Custom property - Keeps Mend in sync when the organization-level custom property definitions change.
-
Custom property values - Maps repositories to Mend products using GitHub repository custom properties.
-
Installation / Installation repositories - Delivered by GitHub to every app and cannot be turned off. Mend uses them to know which repositories it has access to.
-
Issue comment - Reads Mend commands typed in issue comments, such as on-demand fix PR requests.
-
Issues - Tracks the lifecycle of Mend-created security issues and drives remediation from the master issue checkboxes.
-
Organization - Cleans up the Mend installation automatically if the GitHub organization is deleted. Only the
deletedaction is used. -
Pull request - Runs PR scans on open, update and reopen, and detects when a Mend remediation PR is merged or closed.
-
Pull request review comment - Handles feedback and remediation commands on SAST findings posted as PR review comments.
-
Push - Triggers a scan when code is pushed to a tracked branch, and picks up changes to your Mend configuration file.
-
Release - Triggers a scan when a release is published.
-
Repository - Core scanning works without it, but repository renames, product mapping and archive state silently drift — leaving stale or duplicate Mend projects. On rename, Mend updates the project to the new repository name; on a topics change, it re-resolves product mapping; on archive or unarchive, it tags the project accordingly. Each of these events also refreshes Mend's cached repository settings and configuration.
-
Not Required: Earlier versions of the setup guide asked for the following. Mend makes no API calls to any of them and subscribes to none of their events. If your app grants them, you can safely remove them.
-
Check suite: GitHub automatically delivers
check_suiteevents to any app with write access to Checks, so you may still see them even though the event is not listed above. Mend ignores them — no action is required on your side. -
Member
-
Membership
-
Team
-
Team add
-
-
-
-
Where can this GitHub App be installed? It is recommended to select 'Any account', so that any GitHub Organization can install this App. Alternatively, you can limit it to your own organization
-
Click the Create GitHub App button
-
(Optional) Edit the GitHub App and upload a logo for your App
Changing permissions on an existing GitHub App installation requires approval from an organization owner before the change takes effect. Removing any event or permission listed in this page will cause parts of the Mend integration to stop working.
Fill in fields on the Integrations Page
Note: This step differs slightly between the Mend AppSec Platform and the Legacy SCA Application. Instructions for the Legacy Application are available at the bottom of this section.
Open a separate browser tab or window and log in to the Mend Platform.
-
Navigate to the Integrations page by clicking the cogwheel at the upper right corner of the UI:
-
Click the GitHub Enterprise tile under Repositories:
-
This will take you to the Integrate page, where you are required to fill in the following fields:
-
GitHub URL: Your GitHub Enterprise instance Destination URL. For example: https://GitHubEnterprisedev.com.
-
GitHub API URL: The GitHub API URL value plus '/api/v3' - <https://api.github.com/>/api/v3
-
GitHub Application Id: From the GitHub Enterprise server UI, go to Settings > Organization Settings > GitHub Apps. Click Edit next to the GitHub app you created previously. Scroll to the About section. Copy the GitHub ID value and paste it as the GitHub Application Id input field value.
Leave this page open in Edit mode, as you will need it for the next field (Github Webhook Secret). -
GitHub Webhook Secret: Paste the webhook secret that you generated as part of the Install the GitHub Application step.
-
GitHub Application Private Key: In the Private key section of the Mend App Settings, click Generate private key. Save the private_key.pem file that is generated. Open this file in any editor and copy its contents. Paste the contents in the GitHub application private key input field.
NOTE: The key is encrypted, and its value is not revealed to Mend.
-
-
Click Get Activation Key to generate your activation key. A new Service user is created for this integration inside the Mend Application with a WS prefix.
NOTE: Do not remove this Service user and ensure this user remains part of the Admin group. -
Copy the generated Activation Key to the clipboard. You will need to use it in the next section.
Configuring Deployment Settings
Run the UI configuration tool from the wss-configuration Directory
The UI Configuration tool enables you to configure the deployment file according to your specific configuration requirements.
-
Open the file index.html located inside the wss-configuration directory via a Chrome or Firefox Web browser. The Mend Configuration Editor page is displayed.
-
Load the template JSON configuration file by clicking Choose File button and selecting the file located at wss-configuration/config/prop.json. The General tab appears in the Editor.
-
Click the General tab and enter the Activation Key which you copied in the previous section.
-
To display the Proxy tab, click the Advanced Properties checkbox on the Home tab. Proxy fields that are not mandatory (e.g., user name and password) must be left blank.
-
Click Export, and save the JSON file with the name prop.json. This file will be used in the next sections.
Notes:
-
You can export the JSON file at any time, even if you did not finish editing it in order to save your configurations and to enable assigning the configuration of a specific section to the appropriate professional in your organization (e.g., data source section may be assigned to the DBA of your organization).
-
When exporting the configuration file, it is important to give it the filename "prop.json".
-
In case of replacing the prop.json file with a new one, it is not enough to restart the controller and scanner pods. It is required to delete the old pods and run new ones.
-
If using the WS_ACTIVATION_KEY environment variable, the activation key did not require to be passed through the prop.json file.
Reference
Details on Attributes of the Configuration File
|
Section |
Label |
Name |
Type |
Mandatory |
Description |
Sample Value |
|---|---|---|---|---|---|---|
|
General |
Activation Key |
bolt.op.activation.key |
String |
yes |
Your generated activation key in the Mend application |
|
|
Proxy |
HTTP Proxy Host |
proxy.host |
Host Address |
no |
HTTP proxy host. Leave blank to disable. Default value: Empty |
|
|
Proxy |
HTTP Proxy Port |
proxy.port |
Integer |
no |
HTTP proxy port. Leave blank to disable. Default value: Empty |
|
|
Proxy |
Proxy User |
proxy.user |
String |
no |
Proxy UserName (if applicable) |
user |
|
Proxy |
Proxy Password |
proxy.password |
String |
no |
Proxy Password (if applicable) |
abc123 |
|
Proxy |
Enable Proxy For All Traffic |
proxy.for.all |
Boolean |
no |
If set to NOTES:
|
|
|
Advanced |
Controller URL |
controller.url |
String |
no |
The ability to modify the App container URL in case its default name (wss-ghe-app) was modified. Default value: http://wss-ghe-app:5678 |
|
|
Issues |
Should Create Issues |
bolt4scm.create.issues |
Boolean |
no |
The ability to globally enable/disable Issues creation across all of your organization's repositories. Default value: true
|
|
|
Issues |
Should Create Build Status |
bolt4scm.create.check.runs |
Boolean |
no |
The ability to globally enable/disable build statuses across all of your organization's repositories. Default value: true
|
|
Next Steps after creating the Mend for GitHub Enterprise App
After you have successfully created the Mend for GitHub Enterprise App in your GitHub Enterprise environment, you are ready to build and deploy the Mend for GitHub Enterprise containers.