- Install Endor Labs on your local system
- Authenticate to Endor Labs
- Clone your repository
- Scan your first project
Run your first scan
Endor Labs supports four distinct scan types to identify open source risk, code issues, leaked secrets, and configuration gaps.Default namespace and accessWhen you run a scan, you can specify a namespace. If you leave it unspecified, projects are created in the root namespace of the tenant. That matters when your account or token only has access to specific namespaces. See Namespaces in Endor Labs for details.
Scan for OSS risk
To scan and monitor all packages in a given repository from the root of the repository, run the following command:--languages flag:
<languages-list> should be provided as a comma-separated list from the supported languages: c,c#,cpp,go,gosu,java,javascript,kotlin,php,python,ruby,rust,scala,swift,typescript.
Scan projects with private Git dependencies
During CLI and CI/CD scans, endorctl doesn’t write Endor Labs SCM credentials to your global Git configuration or environment variables. Credentials never persist on the scan host or override your local Git credential helpers. Instead, CLI and CI/CD scans resolve private Git repositories using the Git credentials already configured on the machine running the scan. Hosted scans triggered from an Endor Labs SCM integration automatically inject your namespace’s stored SCM credentials. Before running a CLI or CI/CD scan with private Git dependencies, configure repository access using SSH keys, a credential helper, orurl.<base>.insteadOf rules. Ensure that your access tokens have the required permissions. See Supported SCM platforms and access tokens to learn more.
-
Configure Git credentials for your SCM platform with the org, group, or repository URL that hosts your private dependencies and an access token.
GitHub
Replace:<access-token>with your access token.<host-url>with your GitHub Enterprise Server hostname.<organization-name>with your GitHub organization or repository path segment.
GitLab
Replace:<access-token>with your personal access token.<host-url>withgitlab.comor your self-managed hostname.<organization-name>with your GitLab group or subgroup path.
Bitbucket
Replace:<access-token>with your Bitbucket access token.<host-url>with your Bitbucket hostname.<workspace>with your Bitbucket workspace name.
-
If your project uses Go, set
GOPRIVATEto a comma-separated list of private Git host and organization patterns, in the same format as yourgit configURLs. For example, if your GitHub org isabccorpand your GitLab group iswidgetco, set:
-
Scan the repository.
Scan an example repository
To scan the example repositoryhttps://github.com/OWASP-Benchmark/BenchmarkJava.git, follow these steps after you authenticate to Endor Labs:
-
Clone the repository
https://github.com/OWASP-Benchmark/BenchmarkJava.git -
Navigate to the repository on your local system
-
Build the repository’s package with Maven:
-
Scan the repository
Scan for SAST
To run a SAST scan from the project root to identify potential security weaknesses in your source code, run the following command:--path:
Scanning for leaked secrets
To scan for all potentially leaked secrets in the checked out branch of your repository, run the following command:Scan for GitHub misconfigurations
Endor Labs allows teams to scan their repository for configuration best practices in alignment with organizational policy.Prerequisites
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.
- 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
Run a misconfiguration scan
To scan a GitHub repository for misconfigurations:-
Export your personal access token as an environment variable:
-
Scan the repository to retrieve configuration information and analyze the configuration against organizational policy or configuration best practices:
--github-api-url flag to your GitHub Enterprise server domain name: