PyPI Integration
PIP resolves Python packages using the package index configured in pip.conf, pip.ini, or the --index-url command-line option. To route PIP traffic through the Lineaje Proxy, configure PIP to use the Proxy’s PyPI endpoint and authenticate with your Lineaje username and Personal Access Token (PAT).
Getting Started
Store the Lineaje PAT in a secure location
For example, add your SBOM360 email and Lineaje PAT as an environmental variable:
export ARTIFACTORY_CREDS_USR="your-email@example.com"
export ARTIFACTORY_CREDS_PSW="by9...dPQ=="For CICD pipelines, like GitHub Actions, this token can be stored as a repository-level secret or an organization-level secret. A sample GitHub Action is added below for your reference.
Configure pip.conf
Create or update this file:
~/.config/pip/pip.confAdd the following configuration:
[global]
index-url = https://<ARTIFACTORY_CREDS_USR>:<ARTIFACTORY_CREDS_PSW>@observe.fortknox.v2.prod.veedna.com/artifactory/api/pypi/gos-all-proxy-python/simple
trusted-host = observe.fortknox.v2.prod.veedna.comYou can choose between observe mode or enforce mode. More details are here:
Modes of OperationAlternative: Pass the Proxy URL Directly
Instead of configuring pip.conf, you can pass the Proxy URL directly using --index-url.
pip install urllib3==2.0.5 \
--index-url https://<ARTIFACTORY_CREDS_USR>:<ARTIFACTORY_CREDS_PSW>@observe.fortknox.v2.prod.veedna.com/artifactory/api/pypi/gos-all-proxy-python/simple \
-vvvThe -vvv flag enables verbose logging and helps confirm that packages are being resolved through the Lineaje Proxy.
Sample Configurations
GitHub Actions
This guide explains how to configure a GitHub Actions workflow to install Python dependencies from Lineaje GOS Artifactory and run unit tests.
1. Create GitHub Secrets
Create repository-level or organization-level secrets to store the Lineaje credentials.
Open your GitHub repository.
Go to Settings.
Open Secrets and variables.
Select Actions.
Click New repository secret.
Create the following secret:
Set the value to your SBOM360 email.
Create another secret:
Set the value to your Lineaje PAT.
2. Add the GitHub Actions Workflow
Create the following workflow file in your repository:
Add the below content:
Jenkins
This guide explains how to configure Jenkins to install Python dependencies using FortKnox Artifactory as the Python package index.
1. Configure Python in Jenkins
Ensure Python is available on the Jenkins agent.
Validate Python and PIP by running:
If Python is not installed, install the required Python version or configure the Jenkins agent image to include Python and PIP.
2. Add Artifactory Credentials in Jenkins
Go to Manage Jenkins.
Open Credentials.
Select the appropriate credentials scope, usually:
Click Add Credentials.
Select credential type:
Enter your SBOM360 email as the username and the Lineaje PAT as the password.
Set the credential ID, for example:
Save the credential.
This credential ID will be used in the Jenkinsfile:
3. Add the Jenkinsfile
Add the following
Jenkinsfileto the root of the repository.Replace the credential ID if needed.
4. Validate the Jenkins Pipeline
Open the Jenkins job.
Run Build with Parameters.
Select the FortKnox mode:
observeenforce
Start the build.
Confirm that the pipeline completes the following steps:
Prints the Python version.
Prints the PIP version.
Installs dependencies from Lineaje GOS Artifactory.
Runs unit tests.
Verifying Proxy Routing
Use verbose mode to confirm that PIP is resolving packages through the Lineaje Proxy.
In the logs, confirm that the Proxy URL appears.
Expected example:
You may also see package download URLs similar to:
To detect policy violations, search the build logs for the relevant Lineaje policy violation message. To learn more, see Detecting Policy Violations in Build Logs.
Last updated