To configure the GitHub app to work with Infisical, you’ll need to modify the following settings:
Homepage URL: Required to be set. Set it to the URL of your Infisical instance. (e.g. https://app.infisical.com)
Setup URL: Set this to https://<your-infisical-instance.com>/organization/secret-scanning
Webhook URL: Set this to https://<your-infisical-instance.com>/api/v1/secret-scanning/webhook
Webhook Secret: Set this to a random string. This is used to verify the webhook request from Infisical. Use openssl rand -base64 32 in your terminal to generate a random secret.
Remember to save the webhook secret as you will need it in the next step.
Now you can create the GitHub app by clicking on the “Create GitHub App” button.
If you want other Github users to be able to install the app, you need to tick the “Any account” option under “Where can this GitHub App be installed?”
2
Retrieve the GitHub App ID
After clicking the “Create GitHub App” button, you will be redirected to the GitHub settings page. Here you can copy the “App ID” and save it for later when you need to configure your environment variables for your Infisical instance.
3
Retrieve your GitHub App slug
The GitHub App slug is the name of the app you created in a slug friendly format. You can find the slug in the URL of the app you created.
4
Create a new GitHub App private key
Create a new app private key by clicking on the “Generate a private key” button under the “Private keys” section.
Once you click the “Generate a private key” button, the private key will be downloaded to your computer. Save this file for later as you will need the private key when configuring Infisical.
Remember to save the private key as you will need it in the next step.
5
Configure your Infisical instance
Now you can configure your Infisical instance by setting the following environment variables:
SECRET_SCANNING_GIT_APP_ID: The App ID of your GitHub App.
SECRET_SCANNING_GIT_APP_SLUG: The slug of your GitHub App.
SECRET_SCANNING_PRIVATE_KEY: The private key of your GitHub App that you created in a previous step.
SECRET_SCANNING_WEBHOOK_SECRET: The webhook secret of your GitHub App that you created in a previous step.
After restarting your Infisical instance, you should be able to use the secret scanning feature within your organization. Follow the steps below to add the GitHub App to your Infisical organization.
To install the GitHub App, press the “Integrate With GitHub” button in the top right corner of your Infisical Secret Scanning dashboard.
Next, you’ll be prompted to select which organization you’d like to install the app into. Select the organization you’d like to install the app into by clicking the organization in the menu.
Select the repositories you’d like to scan for secrets and press the “Install” button.
Secret scans are built on event-driven architecture. This means that every time a push is made to one of your selected repositories, Infisical will scan the modified files for any exposed secrets.
If one or more exposed secrets are detected, it will be displayed in your Infisical dashboard. An exposed secret is known as a “Risk”. Each risk has the following data associated with it:
Date: When the risk was first detected.
Secret Type: Which type of secret was detected.
Info: Information about the secret, such as the repository, file name, and the committer who made the change.
Once an exposed secret is detected, all organization admins will be sent an e-mail notification containing details about the exposed secret.
Each risk also contains a “View Exposed Secret” button, which will take you directly to the GitHub commit and to the line where the secret was exposed.
After an exposed secret is detected, it will be marked as Needs Attention. When there are risks marked as needs attention, it’s important to address them as soon as possible.
You can mark the risk as Resolved by changing the status to one of the following states:
This Is a False Positive: The secret was not exposed, but was detected by the scanner.
I Have Rotated The Secret: The secret was exposed, but it has now been removed.
No Rotation Needed: You are choosing to ignore this risk. You may choose to do this if the risk is non-sensitive or otherwise not a security risk.
If you’re intentionally committing a test secret that the secret scanner might flag, you can instruct Infisical to overlook that secret with the methods listed below.
An alternative method to exclude specific findings involves creating a .infisicalignore file at your repository’s root.
You can then add the fingerprints of the findings you wish to exclude. The Infisical scan report provides a unique Fingerprint for each secret found.
By incorporating these Fingerprints into the .infisicalignore file, Infisical will skip the corresponding secret findings in subsequent scans.