- Scan their software for potential security issues and violations of organizational policy.
- Prioritize vulnerabilities in the context of their applications.
- Understand the relationships between software components in their applications.
System specifications for deep scan
Before you proceed to run a deep scan, ensure that your system meets the following specification.| Project Size | Processor | Memory |
|---|---|---|
| Small projects | 4-core processor | 16 GB |
| Mid-size projects | 8-core processor | 32 GB |
| Large projects | 16-core processor | 64 GB |
Software prerequisites
- Make sure that you have Go 1.12 or higher versions.
- Install Bazel version
5.x.x,6.x.x,7.x.x,8.x.x, or9.x.xif your project uses Bazel. Endor Labs supports Bzlmod with Bazel aspects. See Bazel for more information. - Make sure your repository includes one or more files with
.goextension.
Build Go projects
You must build your Go projects before running the scan. Also verify that packages exist in the local package caches and that the go.mod file is well formed and available in the standard location. To ensure that your go.mod file is well formed, run the following command:Scan Bazel projects
To scan Go projects that use Bazel, see Bazel for build instructions, supported rules, and scan commands. Endor Labs supports Bzlmod with Bazel aspects. See Bazel Aspects for more information.Run a scan
Use the following options to scan your repositories. Perform the endorctl scan after building the projects.Option 1 - Quick scan
Perform a quick scan to get quick visibility into your software composition. This scan won’t perform reachability analysis to help you prioritize vulnerabilities.Option 2 - Deep scan
Use the deep scan to perform dependency resolution, reachability analysis, and generate call graphs. You can do this after you complete the quick scan successfully.Understand the scan process
Endor Labs resolves your Golang-based dependencies by leveraging built-in Go commands to replicate the way a package manager would install your dependencies. To discover package names for Go packages Endor Labs uses the command:Go standard library vulnerability scanning
Endor Labs performs SCA for the Go standard library by adding the standard library as a dependency in the bill of materials (BOM). The Go version used for the standard library determines which standard library package Endor Labs matches for vulnerability checks.Version resolution order
Endor Labs determines the Go version for standard library vulnerability scanning using the following precedence order.-
Use the system Go version
By default, the scanner uses the version that
go env GOVERSIONreports in the scan environment. For example, if the host has Go 1.23.2 installed, the scanner uses 1.23.2 for scanning. -
Pin to a specific Go version:
Set the
ENDOR_SCAN_GO_VERSIONenvironment variable to specify the Go version used for standard library vulnerability scanning. For example, settingENDOR_SCAN_GO_VERSIONto1.23.4ensures that the scanner uses Go 1.23.4 for standard library scanning. -
Use the version from
go.modSetENDOR_SCAN_USE_GOMOD_VERSION=trueto instruct endorctl to use the version specified in thegodirective of the module’sgo.modfile instead of detecting the system Go version.For example, if the go.mod file contains go 1.22 and the host system has Go 1.23 installed, the scanner uses Go 1.22 for vulnerability checks.
Fallback behaviorIf the scanner cannot detect the system Go version, it falls back to the version in the
go directive in your module’s go.mod file.Known limitations
Endor Labs createsgo.mod files for you when projects do not have a go.mod file. This can lead to inconsistencies with the actual package created over time and across versions of the dependencies.
Troubleshoot errors
Here are a few error scenarios that you can check for and attempt to resolve them.-
Host system check failure errors:
- Go is not installed or not present in the PATH environment variable. Install Go and try again.
- The installed version of Go is lower than 1.12. Install Go version 1.12 or higher and try again.
-
Resolved dependency errors:
- A dependency version does not exist or cannot be found. The package may no longer exist in the repository.
- If the go.mod file is not well-formed then dependency resolution may return errors. Run
go mod tidyand try again.
-
Call graph errors:
These errors often mean the project won’t build. Ensure any generated code is in place and verify that
go build ./...runs successfully.