pylynk
is your primary tool to interface with interlynk's SAAS platform. Its main purpose is to upload and download SBOMs (Software Bill of Materials) to/from the Interlynk platform, along with managing products and versions.
# Using Python
export INTERLYNK_SECURITY_TOKEN=your_token_here
python3 pylynk.py upload --prod 'my-product' --sbom my-sbom.json
# Using Docker
docker run -e INTERLYNK_SECURITY_TOKEN=$INTERLYNK_SECURITY_TOKEN -v $(pwd):/app/data ghcr.io/interlynk-io/pylynk upload --prod 'my-product' --sbom /app/data/my-sbom.json
# Using Python
python3 pylynk.py download --prod 'my-product' --verId 'version-id-here' --output downloaded-sbom.json
# Using Docker
docker run -e INTERLYNK_SECURITY_TOKEN=$INTERLYNK_SECURITY_TOKEN -v $(pwd):/app/data ghcr.io/interlynk-io/pylynk download --prod 'my-product' --verId 'version-id-here' --output /app/data/downloaded-sbom.json
git clone https://github.com/interlynk-io/pylynk
pip3 install -r requirements.txt
python3 pylynk.py --help
or
docker pull ghcr.io/interlynk-io/pylynk:latest
or build locally:
docker build -t pylynk .
When using Docker, you need to mount your local directory to access files for upload or to save downloaded files. The examples use -v $(pwd):/app/data
which mounts your current directory to /app/data
inside the container.
When using Docker with environment variables, make sure to pass the value of the environment variable:
# Correct - passes the value
docker run -e INTERLYNK_SECURITY_TOKEN=$INTERLYNK_SECURITY_TOKEN ...
# Incorrect - only passes the variable name
docker run -e INTERLYNK_SECURITY_TOKEN ...
PyLynk can be authenticated by setting an environment variable INTERLYNK_SECURITY_TOKEN
or by providing a --token
param to all commands.
export INTERLYNK_SECURITY_TOKEN=lynk_test_GDGEB2j6jnhkzLSAQk9U3wiiQLrbNT11Y8J4
python3 pylynk.py prods
OR
python3 pylynk.py prods --token lynk_test_GDGEB2j6jnhkzLSAQk9U3wiiQLrbNT11Y8J4
OR
export INTERLYNK_SECURITY_TOKEN=lynk_test_GDGEB2j6jnhkzLSAQk9U3wiiQLrbNT11Y8J4
docker run -e INTERLYNK_SECURITY_TOKEN=$INTERLYNK_SECURITY_TOKEN ghcr.io/interlynk-io/pylynk prods
PyLynk supports multiple output formats:
--json
- JSON format (default)--table
- Table format
# Table format
python3 pylynk.py prods --table
# JSON format (default if no format specified)
python3 pylynk.py prods --json
# or simply
python3 pylynk.py prods
OR
docker run -e INTERLYNK_SECURITY_TOKEN=$INTERLYNK_SECURITY_TOKEN ghcr.io/interlynk-io/pylynk prods --table
python3 pylynk.py vers --prod 'sbom-exec' --table
OR
docker run -e INTERLYNK_SECURITY_TOKEN=$INTERLYNK_SECURITY_TOKEN ghcr.io/interlynk-io/pylynk vers --prod 'sbom-exec' --table
python3 pylynk.py vers --prod 'sbom-exec' --json
OR
docker run -e INTERLYNK_SECURITY_TOKEN=$INTERLYNK_SECURITY_TOKEN ghcr.io/interlynk-io/pylynk vers --prod 'sbom-exec' --json
python3 pylynk.py vers --prod 'sbomqs' --env 'production' --table
OR
docker run -e INTERLYNK_SECURITY_TOKEN=$INTERLYNK_SECURITY_TOKEN ghcr.io/interlynk-io/pylynk vers --prod 'sbomqs' --env 'production' --table
The status of actions associated with SBOM is reported in three states:
- UNKNOWN
- NOT_STARTED
- IN_PROGRESS
- COMPLETED
This applies to the following SBOM actions (represented with specific keys):
- SBOM Checks (Key:
checksStatus
) - SBOM Policies (Key:
policyStatus
) - SBOM Internal Labeling (Key:
labelingStatus
) - SBOM Automation Rules (Key:
automationStatus
) - SBOM Vulnerability Scan (Key:
vulnScanStatus
)
python3 pylynk.py status --prod 'sbomex' --verId 'fbcc24ad-5911-4229-8943-acf863c07bb4'
OR
docker run -e INTERLYNK_SECURITY_TOKEN=$INTERLYNK_SECURITY_TOKEN ghcr.io/interlynk-io/pylynk status --prod 'sbomex' --verId 'fbcc24ad-5911-4229-8943-acf863c07bb4'
Note: Download requires either --verId
OR all three parameters (--prod
, --env
, and --ver
) together.
Download SBOM for a specific version using version ID:
python3 pylynk.py download --prod 'sbomex' --verId 'fbcc24ad-5911-4229-8943-acf863c07bb4'
OR
docker run -e INTERLYNK_SECURITY_TOKEN=$INTERLYNK_SECURITY_TOKEN -v $(pwd):/app/data ghcr.io/interlynk-io/pylynk download --prod 'sbomex' --verId 'fbcc24ad-5911-4229-8943-acf863c07bb4' --output /app/data/sbom.json
Download SBOM for a specific version using product name, environment, and version name:
python3 pylynk.py download --prod 'sbomex' --env 'default' --ver 'sha256:5ed7e95ae79fe3fe6c4b8660f6f9e31154e64eca76ae42963a679fbb198c3951'
OR
docker run -e INTERLYNK_SECURITY_TOKEN=$INTERLYNK_SECURITY_TOKEN -v $(pwd):/app/data ghcr.io/interlynk-io/pylynk download --prod 'sbomex' --env 'default' --ver 'sha256:5ed7e95ae79fe3fe6c4b8660f6f9e31154e64eca76ae42963a679fbb198c3951' --output /app/data/sbom.json
Download SBOM including vulnerability information (accepts: true, false, 1, 0, yes, no):
python3 pylynk.py download --prod 'sbomex' --verId 'fbcc24ad-5911-4229-8943-acf863c07bb4' --vuln true
OR
docker run -e INTERLYNK_SECURITY_TOKEN=$INTERLYNK_SECURITY_TOKEN -v $(pwd):/app/data ghcr.io/interlynk-io/pylynk download --prod 'sbomex' --verId 'fbcc24ad-5911-4229-8943-acf863c07bb4' --vuln true --output /app/data/sbom-with-vulns.json
Download SBOM in SPDX or CycloneDX format with a specific version:
python3 pylynk.py download --prod 'sbomex' --verId 'fbcc24ad-5911-4229-8943-acf863c07bb4' --spec SPDX --spec-version 2.3
OR
docker run -e INTERLYNK_SECURITY_TOKEN=$INTERLYNK_SECURITY_TOKEN -v $(pwd):/app/data ghcr.io/interlynk-io/pylynk download --prod 'sbomex' --verId 'fbcc24ad-5911-4229-8943-acf863c07bb4' --spec CycloneDX --spec-version 1.5 --output /app/data/sbom.json
Download a lightweight version of the SBOM (reduced metadata):
python3 pylynk.py download --prod 'sbomex' --verId 'fbcc24ad-5911-4229-8943-acf863c07bb4' --lite
OR
docker run -e INTERLYNK_SECURITY_TOKEN=$INTERLYNK_SECURITY_TOKEN -v $(pwd):/app/data ghcr.io/interlynk-io/pylynk download --prod 'sbomex' --verId 'fbcc24ad-5911-4229-8943-acf863c07bb4' --lite --output /app/data/sbom-lite.json
Download the original uploaded SBOM without any processing:
python3 pylynk.py download --prod 'sbomex' --verId 'fbcc24ad-5911-4229-8943-acf863c07bb4' --original
OR
docker run -e INTERLYNK_SECURITY_TOKEN=$INTERLYNK_SECURITY_TOKEN -v $(pwd):/app/data ghcr.io/interlynk-io/pylynk download --prod 'sbomex' --verId 'fbcc24ad-5911-4229-8943-acf863c07bb4' --original --output /app/data/sbom-original.json
Download SBOM with support status and excluding parts:
python3 pylynk.py download --prod 'sbomex' --verId 'fbcc24ad-5911-4229-8943-acf863c07bb4' --include-support-status --exclude-parts
OR
docker run -e INTERLYNK_SECURITY_TOKEN=$INTERLYNK_SECURITY_TOKEN -v $(pwd):/app/data ghcr.io/interlynk-io/pylynk download --prod 'sbomex' --verId 'fbcc24ad-5911-4229-8943-acf863c07bb4' --include-support-status --exclude-parts --output /app/data/sbom-filtered.json
Download only the support level information in CSV format:
python3 pylynk.py download --prod 'sbomex' --verId 'fbcc24ad-5911-4229-8943-acf863c07bb4' --support-level-only
OR
docker run -e INTERLYNK_SECURITY_TOKEN=$INTERLYNK_SECURITY_TOKEN -v $(pwd):/app/data ghcr.io/interlynk-io/pylynk download --prod 'sbomex' --verId 'fbcc24ad-5911-4229-8943-acf863c07bb4' --support-level-only --output /app/data/support-levels.csv
Download SBOM without packaging into a single file (useful for multi-SBOM documents):
python3 pylynk.py download --prod 'sbomex' --verId 'fbcc24ad-5911-4229-8943-acf863c07bb4' --dont-package-sbom
OR
docker run -e INTERLYNK_SECURITY_TOKEN=$INTERLYNK_SECURITY_TOKEN -v $(pwd):/app/data ghcr.io/interlynk-io/pylynk download --prod 'sbomex' --verId 'fbcc24ad-5911-4229-8943-acf863c07bb4' --dont-package-sbom --output /app/data/sbom-unpackaged.json
Upload SBOM file sbomqs.cdx.json to the product named sbomqs
python3 pylynk.py upload --prod 'sbomqs' --sbom sbomqs.cdx.json
OR
docker run -e INTERLYNK_SECURITY_TOKEN=$INTERLYNK_SECURITY_TOKEN -v $(pwd):/app/data ghcr.io/interlynk-io/pylynk upload --prod 'sbomqs' --sbom /app/data/sbomqs.cdx.json
Upload SBOM file sbomqs.cdx.json to the product named sbomqs under environment production
python3 pylynk.py upload --prod 'sbomqs' --env 'production' --sbom sbomqs.cdx.json
OR
docker run -e INTERLYNK_SECURITY_TOKEN=$INTERLYNK_SECURITY_TOKEN -v $(pwd):/app/data ghcr.io/interlynk-io/pylynk upload --prod 'sbomqs' --env 'production' --sbom /app/data/sbomqs.cdx.json
PyLynk includes automatic retry logic with exponential backoff for failed uploads. By default, it will retry 3 times with increasing delays (1s, 2s, 4s).
Configure the number of retries:
# Disable retries
python3 pylynk.py upload --prod 'sbomqs' --sbom sbomqs.cdx.json --retries 0
# Increase retries to 5
python3 pylynk.py upload --prod 'sbomqs' --sbom sbomqs.cdx.json --retries 5
OR
docker run -e INTERLYNK_SECURITY_TOKEN=$INTERLYNK_SECURITY_TOKEN -v $(pwd):/app/data ghcr.io/interlynk-io/pylynk upload --prod 'sbomqs' --sbom /app/data/sbomqs.cdx.json --retries 5
Note: Retries are not attempted for authentication errors (401) or client errors (4xx) except rate limiting (429).
Use --verbose
or -v
with any command to see debug output. You can increase verbosity by using multiple -v
flags:
-v
- Basic debug output-vv
- More detailed debug output-vvv
- Maximum verbosity
To point to a different API endpoint than production
export INTERLYNK_API_URL=http://localhost:3000/lynkapi
- "Authentication failed. Please check your INTERLYNK_SECURITY_TOKEN" - Verify your token is correct and hasn't expired
- "Error: Please provide either --verId OR all of --prod, --env, and --ver" - The download command requires specific parameter combinations
- "Product not found" - Check that the product name is spelled correctly and exists in your organization
- "Version not found" - Ensure the version ID or version name is correct
When testing against a local API server running on your host machine, Docker containers cannot access localhost
. Use the following approach:
# Set API URL using host.docker.internal
export INTERLYNK_API_URL=http://host.docker.internal:3000/lynkapi
export INTERLYNK_SECURITY_TOKEN=your_test_token_here
# Run Docker with both environment variables
docker run \
-e INTERLYNK_SECURITY_TOKEN=$INTERLYNK_SECURITY_TOKEN \
-e INTERLYNK_API_URL=$INTERLYNK_API_URL \
-v $(pwd):/app/data \
ghcr.io/interlynk-io/pylynk upload --prod 'test-product' --sbom /app/data/test-sbom.json
On Linux, use the --network="host"
flag:
export INTERLYNK_API_URL=http://localhost:3000/lynkapi
export INTERLYNK_SECURITY_TOKEN=your_test_token_here
docker run \
--network="host" \
-e INTERLYNK_SECURITY_TOKEN=$INTERLYNK_SECURITY_TOKEN \
-e INTERLYNK_API_URL=$INTERLYNK_API_URL \
-v $(pwd):/app/data \
ghcr.io/interlynk-io/pylynk upload --prod 'test-product' --sbom /app/data/test-sbom.json
- SBOM Assembler - A tool to compose a single SBOM by combining other (part) SBOMs
- SBOM Quality Score - A tool for evaluating the quality and completeness of SBOMs
- SBOM Search Tool - A tool to grep style semantic search in SBOMs
- SBOM Explorer - A tool for discovering and downloading SBOM from a public repository
We appreciate all feedback. The best ways to get in touch with us:
- βοΈ Live Chat
- π« Email Us
- π Report a bug or enhancement
- β Follow us on X
If you like this project, please support us by starring it.