Skip to main content
Configure Endor Labs to integrate with private PyPI repositories to access proprietary dependencies during security scanning and analysis. When your Python projects depend on packages hosted in private or corporate repositories, Endor Labs requires authentication credentials to resolve these dependencies and generate a complete bill of materials.
If your manifest or lockfile references a dependency directly by its Git repository URL, see Git-based dependencies.
This integration enables Endor Labs to:
  • Access private PyPI packages during dependency resolution
  • Generate comprehensive security analysis including private dependencies
  • Maintain complete visibility into your software supply chain
Endor Labs generally respects package authentication and configuration settings and a package manager integration is usually not required to scan private packages successfully.
  • Use package manager integrations to simplify scanning when authentication to private repositories is not part of standard manifest or settings files.
  • Package manager integrations allow you to set custom repositories for each package ecosystem and the priority of each repository for scanning.
To set up a package manager integration:
  1. Select User menu > Integrations from the left sidebar.
  2. Select Add next to the package manager configuration you want to add.
  3. Select Add Package Manager.
  4. Enter a Name for the integration.
  5. Choose an authentication type and complete the required fields.
  1. Optionally, under Advanced, select Propagate this package manager to all child namespaces to share this integration with child namespaces.
  2. Click Add Package Manager.

Test package manager integration

You can test the connection to a configured package manager to verify that Endor Labs can reach the repository. To test the connection:
  1. Select User menu > Integrations from the left sidebar.
  2. Click Manage in the package manager configuration you want to customize.
  3. Click the vertical three dots of the package manager configured and select Test Connection.
The integration does not perform authentication or authorization checks on the package manager repository.

Edit package manager integration

You can edit an existing package manager integration to update the name, repository URL, or authentication credentials. To edit a package manager integration:
  1. Select User menu > Integrations from the left sidebar.
  2. Click Manage next to the package manager you want to edit.
  3. Click the vertical three dots on the configured integration you want to edit and select Edit.
  4. You can modify the name, package manager URL, and credentials.
  5. Click Save Changes.

Private package manager integration for PyPI using API

Use endorctl to create a package manager resource through an API call and configure authentication for accessing private repositories during scans.
The PyPI package manager URL typically ends with /simple.
Run the following command to create a package manager resource and authenticate to private repository. Replace:
  • username with your package registry username
  • xxxx with your package registry password
  • namespace with your namespace.

Fetch package manager using API

Run the following command to fetch the package manager using the UUID.

Delete package manager using API

Run the following command to delete the package manager using the UUID.

Specify a private index for a single repository

A PyPI package manager integration applies to the namespace you create it in, and to child namespaces when you set propagate to true. Poetry, uv, and Pipenv also let a single repository name its own index in a manifest file. Endor Labs runs those tools during the scan, and each one reads its own manifest file. Endor Labs matches the declared URL to a configured integration and supplies the credentials, so the manifest file carries the URL and no credentials are stored in your repository. pip is the exception, because Endor Labs drives pip itself rather than delegating to it. See pip and requirements files to understand what a requirements file can and cannot control.

pip and requirements files

Endor Labs does not resolve dependencies from an index that you declare with --index-url, --extra-index-url, or -i in a requirements file. When Endor Labs resolves a pip project, it installs each package by name against the registries from your package manager integrations, so the index options in the file never reach pip. Configure an integration for the private index, and dependency resolution reaches it for every repository in the namespace. Endor Labs does read --find-links and -f entries from a requirements file and passes them to pip during resolution. A repository that resolves packages from a local or hosted archive directory scans without any further configuration. To resolve a pip project against an index that you declare only in the requirements file, build the virtual environment yourself before you scan.
Your own pip run honors the index options in the requirements file, along with your pip configuration file. Endor Labs then detects the virtual environment and reads the packages you installed rather than resolving them itself. See Python to review where Endor Labs looks for a virtual environment.

Declare an index for uv

Declare each index as a [[tool.uv.index]] entry in pyproject.toml.
Endor Labs matches the index URL to a configured package manager integration by scheme, host, and path, and uses the credentials from the integration. When the index URL already contains a user name, Endor Labs uses the integration credentials only when the user name matches. Members of a uv workspace also inherit the indexes declared in the workspace root pyproject.toml file.

Declare an index for Pipenv

Declare each index as a [[source]] entry in your Pipfile, with the credentials written as environment variable placeholders rather than literal values.
Endor Labs matches the host and path of the source URL to a configured package manager integration. When they match, Endor Labs sets INTERNAL_USERNAME and INTERNAL_PASSWORD to the integration credentials for the pipenv install command, so the credentials never appear in your Pipfile. The placeholder names are yours to choose. Endor Labs uses whatever names the URL contains. A source URL without a user:password@ section receives no credentials. Set ENDOR_PYTHON_PIPENV_ENABLED to true before you scan a Pipenv project. See Python to review the full Pipenv prerequisites.

Poetry authentication behavior

Endor Labs matches each source declared in [[tool.poetry.source]] in your pyproject.toml file to a configured PyPI package manager integration by comparing normalized URLs (scheme, host, port, and path). When a source URL matches an integration with a complete username and password, Endor Labs passes the credentials to the poetry lock and poetry install commands during a scan. Poetry derives the environment variable name for a source from its name. It converts the name to uppercase and replaces hyphens with underscores. Endor Labs follows the same convention, so a source named org-repo receives credentials as POETRY_HTTP_BASIC_ORG_REPO_USERNAME and POETRY_HTTP_BASIC_ORG_REPO_PASSWORD.
Endor Labs only supplies credentials for sources already declared in pyproject.toml. It does not add or rewrite Poetry sources.

Known limitations

  • Existing credentials take precedence: If a source URL in pyproject.toml already contains inline credentials, or if the corresponding POETRY_HTTP_BASIC_* environment variables are already set, Endor Labs does not add or override them.
  • Shared credential keys: Poetry converts the source names to uppercase and replaces hyphens with underscores. Therefore, sources named org-repo and org_repo resolve to the same environment variable key. Endor Labs skips credential injection for that key, because one credential pair could otherwise authenticate requests to two different registry URLs.
  • Dotted source names: Poetry (version 2.4 and later) preserves dots in a source name when deriving its environment variable key. The earlier versions of Poetry replace dots with underscores. Because the correct key depends on the installed Poetry version, Endor Labs skips credential injection for source names that contain a dot.
  • Basic authentication only: This behavior passes only username and password credentials matched by URL. Token-based authentication and mTLS certificates are not passed to Poetry commands.

Where Endor Labs reads pip configuration

Endor Labs does not define a location of its own for pip.conf. It runs pip inside the virtual environment for your project, with the environment that the scan inherits from your shell or your CI job. pip then loads its own configuration files from its standard locations, so place pip.conf where pip already expects it. pip loads these files in order of global, user, and then virtual environment, and a later file overrides an earlier one. On Linux and macOS, pip also loads the legacy $HOME/.pip/pip.conf file when it exists. See pip configuration for the complete resolution rules, including the XDG_CONFIG_HOME and XDG_DATA_HOME variants.

Point pip at a specific configuration file

Set PIP_CONFIG_FILE to an absolute path when you want a single file to govern the scan. pip loads that file last, so its values override the global, user, and virtual environment files.
The user-level file is the reliable choice when you let Endor Labs create the virtual environment. Endor Labs creates that environment in a temporary directory outside your project and removes it after the scan, so a pip.conf placed at the virtual environment scope does not apply. Supply your own virtual environment, or use the user-level file or PIP_CONFIG_FILE, when you need configuration that survives the scan. See Python to review how Endor Labs detects and creates virtual environments.

Use pip environment variables

pip reads any option as an environment variable named PIP_ followed by the option name in uppercase, with hyphens replaced by underscores. Endor Labs does not set or override these variables, so PIP_INDEX_URL and PIP_EXTRA_INDEX_URL take effect during a scan.
Endor Labs passes the registries from your package manager integrations to pip as --extra-index-url command line options. In pip, a command line option takes precedence over both environment variables and configuration files. Endor Labs never passes --index-url, so an index-url you set in pip.conf or in PIP_INDEX_URL remains the primary index for the scan.

Configuration for automated scans

An automated scan through an SCM integration runs in an isolated sandbox that Endor Labs manages. A pip.conf file on your workstation or on a self-hosted runner is not present in that sandbox, and neither are environment variables you set outside the scan. Configure a package manager integration for any private index that an automated scan needs to reach, and declare the index URL in the repository manifest file. See Python to review how automated scans build Python projects.