ruby language

Documentation Index

Fetch the complete documentation index at: /llms.txt

Use this file to discover all available pages before exploring further.

Ruby is a widely used open-source programming language. Endor Labs supports scanning and monitoring of Ruby projects. Using Endor Labs, application security engineers and developers can:

Software prerequisites

Before you begin, verify the following prerequisites:

Prepare Ruby projects

You can prepare your Ruby project before running a scan to lock its dependency versions in a Gemfile.lock file. Ensure your repository has a Gemfile and run the following command to generate the Gemfile.lock file:

bundle lock

If the repository already contains a Gemfile.lock, endorctl uses it for dependency resolution and does not generate it again.

Configure private RubyGems package repositories

Endor Labs supports fetching and scanning dependencies from private RubyGems package registries. Endor Labs will fetch resources from authenticated endpoints and perform the scan, allowing you to view the resolved dependencies and findings. See RubyGems package manager integrations for more information on configuring private registries.

Run a scan

Perform a scan to get visibility into your software composition and resolve dependencies.

endorctl scan

You can perform the scan from within the root directory of the Git project repository, and save the local results to a results.json file. The results and related analysis information are available on the Endor Labs user interface.

endorctl scan -o json | tee /path/to/results.json

If you use Endor Labs with an EU tenant, use https://app.eu.endorlabs.com instead of https://app.endorlabs.com.

Understand the scan process

Endor Labs looks for Gemfile, *.gemspec, and Gemfile.lock files to find and monitor the dependency activity.

If the Gemfile.lock is not present in your project, Endor Labs generates this file and stores it in a temp directory. Endor Labs deletes the file after extracting dependency information. Endor Labs’ dependency resolution mechanism assesses multiple factors, including compatibility, stability, and availability, to determine the most suitable version for usage. Your Ruby project uses the resolved dependency version during build or execution. By utilizing the dependency graph, you can access significant information about the dependencies. This includes determining whether a dependency is direct or transitive, checking its reachability, verifying source availability, and more. The dependency graph provides a visual representation that allows you to examine the graphical details of these dependencies.

Call graphs

Endor Labs performs reachability analysis and generates call graphs for Ruby projects from the abstract syntax tree. You don’t have to build or install your project for Endor Labs to generate the call graph. Endor Labs also performs an inside-out analysis to determine the reachability of dependencies in your project. Set the following environment variable before running a scan to enable call graph generation.

export ENDOR_SCAN_RUBY_CALL_GRAPH=true

Call graph generation is enabled by default for automated scans.

Known limitations

Troubleshoot errors