You can also use GitHub Actions to scan demo projects and invite your teammates to try out Endor Labs.
1 - Quick start with GitHub App
Get up and running quickly with Endor Labs GitHub App.
This guide provides instructions on how to get started with Endor Labs using the Endor Labs GitHub App.
Prerequisites for GitHub App
Before installing and scanning projects with Endor Labs GitHub App, make sure you have:
A GitHub cloud account and organization. If you don’t have one, create one at GitHub.
Administrative permissions to your GitHub organization. Installing the Endor Labs GitHub App in your organization requires approval or permissions from your GitHub organizational administrator.
Endor Labs GitHub App requires read permissions to Dependabot alerts, actions, administration, checks, code, commit statuses, issues, metadata, packages, pull requests, repository hooks, and security events. It does not need write access to any resources.
Select Getting Started from the left navigation menu.
Select SCAN WITH GITHUB APP.
Click Install GitHub App.
Endor Labs GitHub App page appears.
Click Install.
Select a user to authorize the app.
Select the organization in which you want to install the app.
Select whether to install and authorize Endor Labs on all your repositories or select the specific repositories that you wish to scan.
Click Install & Authorize.
If the button to install says Install and Request instead of Install and Authorize, you don’t have permission to install the GitHub App. Select Install and Request to notify your organizational administrator of your request to install.
Select the Endor Labs namespace that you want to use and click Next.
Select the scanners that you wish to use and click Continue.
You will be redirected back to Endor Labs.
Review the results of your project
Sign in to the Endor Labs user interface, click Projects on the left sidebar, and select your project to review the scan results.
2 - Quick start with endorctl
Get up and running quickly with endorctl.
This guide provides step-by-step instructions to set up and configure an Endor Labs tenant while getting started with your first project scan in your local system.
Use the following steps to scan your first project with Endor Labs:
Install or update the Endor Labs CLI (endorctl) for your operating system.
macOS
brew tap endorlabs/tap
brew install endorctl
npm install -g endorctl
### Run the following command to get the npm global bin directory:npm config get prefix
### Open your shell configuration file and insert the path you obtained with the above command:exportPATH="/path/to/npm/global/bin:$PATH"### Reload your shell configuration and verify endorctl is installed:endorctl --version
### Download the latest CLI for MacOS ARM64curl https://api.endorlabs.com/download/latest/endorctl_macos_arm64 -o endorctl
### Verify the checksum of the binaryecho"$(curl -s https://api.endorlabs.com/sha/latest/endorctl_macos_arm64) endorctl"| shasum -a 256 -c
### Modify the permissions of the binary to ensure it is executablechmod +x ./endorctl
### Create an alias endorctl of the binary to ensure it is available in other directoryaliasendorctl="$PWD/endorctl"
### Download the latest CLI for MacOS AMD64curl https://api.endorlabs.com/download/latest/endorctl_macos_amd64 -o endorctl
### Verify the checksum of the binaryecho"$(curl -s https://api.endorlabs.com/sha/latest/endorctl_macos_amd64) endorctl"| shasum -a 256 -c
### Modify the permissions of the binary to ensure it is executablechmod +x ./endorctl
### Create an alias endorctl of the binary to ensure it is available in other directoryaliasendorctl="$PWD/endorctl"
Linux
npm install -g endorctl
### Run the following command to get the npm global bin directory:npm config get prefix
### Open your shell configuration file and insert the path you obtained with the above command:exportPATH="/path/to/npm/global/bin:$PATH"### Reload your shell configuration and verify endorctl is installed:endorctl --version
### Download the latest CLI for Linux amd64curl https://api.endorlabs.com/download/latest/endorctl_linux_amd64 -o endorctl
### Verify the checksum of the binaryecho"$(curl -s https://api.endorlabs.com/sha/latest/endorctl_linux_amd64) endorctl"| sha256sum -c
### Modify the permissions of the binary to ensure it is executablechmod +x ./endorctl
### Create an alias endorctl of the binary to ensure it is available in other directoryaliasendorctl="$PWD/endorctl"
Windows
npm install -g endorctl
### Run the following command to get the npm global bin directory:npm config get prefix
### Add the path from the above command to the System property 'Path' in your Environment variable settings.### Open a new Command prompt and verify endorctl is installed:endorctl --version
### Download the latest CLI for Windowscurl -O https://api.endorlabs.com/download/latest/endorctl_windows_amd64.exe
### Check the expected checksum of the binary filecurl https://api.endorlabs.com/sha/latest/endorctl_windows_amd64.exe
### Verify the expected checksum and the actual checksum of the binary matchcertutil -hashfile .\endorctl_windows_amd64.exe SHA256
### Rename the binary fileren endorctl_windows_amd64.exe endorctl.exe
To authenticate your client with Endor Labs, utilize the built-in command endorctl init along with an external identity provider. Endor Labs supports multiple identity providers, including Google, GitHub, GitLab, Email link authentication, and Custom Identity Provider through Enterprise SSO. Examples of such enterprise SSO solutions include Google, GitHub, GitLab, or your organization’s specific choice.
Upon successful authentication to Endor Labs using endorctl, proceed to clone the repository you intend to scan. If you prefer initiating with a dummy app for scanning, feel free to skip to the next step.
To clone a Git repository, use the git clone command followed by the clone link of the repository. You can find the URL on the repository’s page on a platform like GitHub or GitLab. For example,
A runtime environment and build tools for supported software development languages your team uses must be installed on any system used for testing. For more information, see Supported languages and frameworks.
For more information on supported languages, package managers and build systems and the requirements for each language, see their respective page.
To run a complete and accurate scan with Endor Labs, ensure that the software can be successfully built, incorporating well-formatted manifest files. To maximize the benefits of an Endor Labs OSS scan, you should perform a comprehensive testing as a post-build step, either locally or in a CI pipeline. Use the following commands to verify that the software can be built successfully with well-formatted manifest files before initiating the scan.
mvn dependency:tree
mvn clean install
gradle dependencies --configuration compileClasspath
./gradlew assemble
# Use `gradle assemble` if you do not have a gradle wrapper# in your repository
To scan and monitor all packages in a given repository from the root of the repository, run the following command:
endorctl scan
Scanning an example repository
To scan an example repository https://github.com/OWASP-Benchmark/BenchmarkJava.git, you must perform the following steps after successfully authenticating to Endor Labs:
Clone the repository https://github.com/OWASP-Benchmark/BenchmarkJava.git
The following procedure should be used to scan with Endor Labs for potential secrets leaked into your source code.
To scan for all potentially leaked secrets in the checked out branch of your repository, run the following command:
endorctl scan --secrets
Often, secrets are leaked outside the context of your repositories main branch and can be found in older branches or those that are under active development. To identify these, Endor Labs inspects the Git logs of the repository.
To scan for all potentially leaked secrets in all branches of your repository, run the following command:
endorctl scan --secrets --git-logs
Scan for GitHub misconfigurations
Endor Labs allows teams to scan their repository for configuration best practices in alignment with organizational policy.
Pre-requisites
To scan the GitHub repository, you must have:
The GitHub repository HTTPS clone URL
A personal access token with access administrative access to the repository. For help creating a personal access token see GitHub documentation.
If you are on a self-hosted GitHub Enterprise Server, you should also have:
The GitHub API URL (This is typically the FQDN of the GitHub server)
A local copy of the CA Certificate if the certificate is self-signed or from a private CA
Running a misconfiguration scan
To scan a GitHub repository for misconfigurations:
Export your personal access token as an environment variable:
exportGITHUB_TOKEN=<personal_access_token>
Scan the repository to retrieve configuration information and analyze the configuration against organizational policy or configuration best practices: