How auto detection works
Endor Labs begins auto detection by scanning your project repository to locate manifest files and identify the languages used in your project. Based on the results, it runs language specific detectors to extract version information. Each detector operates independently and follows a consistent process. It reviews the associated manifest or build configuration files to determine the toolchain version. If a file contains multiple version fields, the detector uses a fixed priority order to select the most appropriate one. After identifying a version, the detector sends the version details to the assigner. The assigner checks the Endor Labs toolchain support matrix to verify if the version is supported for the host operating system and architecture. If it doesn’t find an exact match, it selects the closest supported version based on the major version number. This version will be the toolchain used for your project scan. For example, when analyzing Java projects, the Java detector checks config files likepom.xml or build.gradle to find the Java version used in the project.
Config files scanned for version detection
The following table lists the config files Endor Labs scans to detect the language and version used in your project. The following examples illustrate how to define versions in each config file.Java with Maven
Java with Maven
Config file:
pom.xmlDefine the Java version using any one of the following options:-
Using version fields
-
Using plugin configuration
Java with Gradle
Java with Gradle
Config file: Ensure the Gradle wrapper version is defined in
build.gradleDefine the Java version using sourceCompatibility and targetCompatibility.gradle/wrapper/gradle-wrapper.properties.Python
Python
Specify the Python version in any of the following config files.
setup.py
setup.py
Use
python_requires inside the setup() block.pyproject.toml
pyproject.toml
Use
requires-python to define the Python version range..python-version
.python-version
Specify the exact Python version.
Node.js
Node.js
Specify the NodeJS version in any of the following config files.
package.json
package.json
Use
engines.node.nvmrc
.nvmrc
Specify the exact NodeJS version.
.node-version
.node-version
Specify the exact NodeJS version.
Yarn
Yarn
Specify the Yarn version in any of the following config files.
package.json
package.json
Use
engines.yarn.yarnrc.yml
.yarnrc.yml
Use
yarnPath.yarnrc
.yarnrc
Use
yarnPathPNPM
PNPM
Config file:
package.jsonSpecify the pnpm version using engines.pnpm.NET
.NET
Specify the .NET version using any of the following config files.
global.json
global.json
Use
sdk.version*.csproj
*.csproj
Use
TargetFramework or TargetFrameworksDirectory.Build.props
Directory.Build.props
Use
TargetFramework or TargetFrameworks in a PropertyGroup to define the .NET version for the directory and subdirectories.Directory.Packages.props
Directory.Packages.props
Use
TargetFramework or TargetFrameworks in a PropertyGroup to define the .NET version when using central package management.Golang
Golang
Config file:
go.modUse the go directive.Auto detection is best-effort and works only if your project’s config files are correctly configured.
Enable auto detection for endorctl scans
To enable auto detection for endorctl scans, run:Enable auto detection in GitHub App
When using the GitHub App, you can enable auto detection either by a project or enable it for all projects in a tenant.-
To enable the auto detection by a project, update the project’s
meta.annotationswith"ENDOR_SCAN_ENABLE_BUILD_TOOLS_VERSION_DETECTION":"true". -
To enable auto detection across all projects in a tenant, update the system config’s
meta.annotationswith"ENDOR_SCAN_ENABLE_BUILD_TOOLS_VERSION_DETECTION":"true".