Download and install endorctl
Use one of the following methods to download and install endorctl on your local system. After you install endorctl, you must authenticate. Then you can start scanning your code.Install endorctl with Homebrew
Use Homebrew to efficiently install endorctl on macOS and Linux operating systems making it easy to manage dependencies, and track installed packages with their versions. Install endorctl from the Endor Labs tap with Homebrew by running the following commands. The tap is updated regularly with the latest endorctl release.Install endorctl with npm
Use npm to efficiently install endorctl on macOS, Linux, and Windows operating systems making it easy to manage dependencies, track and update installed packages and their versions.-
Make sure that you have npm installed in your local environment and use the following command to install endorctl.
-
Run the following command to get the npm global bin directory.
-
Edit your shell configuration file and insert the path you obtained from the previous command.
-
Reload your shell configuration and verify endorctl is installed.
-
To update your version of endorctl, run the following command.
Download and install the endorctl binary directly
To download the endorctl binary directly use the following commands:- Linux
- Mac OS
- Windows
- Sign in to Endor Labs.
- Select Projects from the left sidebar.
- Click Add Project.
- Choose CLI.
- Follow the on-screen instructions to download and install the appropriate version and architecture of
endorctlfor your system.
Authenticate to Endor Labs
You can authenticate to Endor Labs in multiple ways:Login with the init command
To log in with your supported authentication provider:- Google
- GitHub
- GitLab
- Email
- SSO
- Google
- GitHub
- GitLab
- Email
- SSO
Login with an API Key
To log in with an API key you’ll need to set the following environment variables:- ENDOR_API_CREDENTIALS_KEY - The API key used to authenticate against the Endor Labs API.
- ENDOR_API_CREDENTIALS_SECRET - The API key secret used to authenticate against the Endor Labs API.
- ENDOR_NAMESPACE - The Endor Labs namespace you would like to scan against. You can locate the namespace from the top left hand corner of the screen under the Endor Labs logo on the Endor Labs application.
If you do not have any projects in your namespace you will get an empty json output, which means you are successfully authenticated.
Print your access token
Once you have successfully initialized endorctl, you can print your access token with the following command.Clone your repository
Upon successful authentication to Endor Labs usingendorctl, 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,
https://github.com/username/repo-name.git with the actual URL of the Git repository you want to clone.
Navigate to the repository you’ve cloned.
Software prerequisites for endorctl scan
The following prerequisites must be met to scan with Endor Labs:- A local installation of Git or the ability to clone repositories in CI. See the Git documentation for instructions on installing Git
- 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.
Build your software
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.- Java (Maven)
- Java (Gradle)
- JavaScript (npm)
- JavaScript (yarn)
- JavaScript (pnpm)
- JavaScript (Rush)
- .NET (dotnet)
- PHP (composer)
- Golang
- Python (pip)
- Python (poetry)
- Ruby (bundler)
- Swift/Objective-C
- Scala (sbt)
- Scala (Gradle)
- Rust (Cargo)
Persistently set environment variables for endorctl
To persistently set an environment variable, append the environment variable and the value to~/.endorctl/config.yaml. This configuration file is for CLI usage.
For example, if your GitHub Enterprise Server URL was https://api.github.com you can set the variable to persist in your configuration using the following command.