Getting started with Interlynk CLI
git clone https://github.com/interlynk-io/pylynk
Once cloned, cd and install requirements
cd pylynk
pip3 install -r requirements.txt
Verify it's working by running:
python3 pylynk.py --help
See the full PyLynk CLI help.
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
OR
python3 pylynk.py prods --token lynk_test_GDGEB2j6jnhkzLSAQk9U3wiiQLrbNT11Y8J4
python3 pylynk.py prods --table
Output
NAME | ID | VERSIONS | UPDATED AT |
-----------------------------------------------------------------------------------|
sbomqs | 478ba2d2-ec5c-4eec-afb7-85a72fe17bd3 | 1 | 2024-02-29 01:07:59 PST |
sbomex | e865710e-b262-4f44-9078-970052794a60 | 1 | 2024-02-29 01:05:24 PST |
python3 pylynk.py prods --json
Output
[
{
"name": "sbomqs",
"updatedAt": "2024-02-29T09:07:59Z",
"id": "478ba2d2-ec5c-4eec-afb7-85a72fe17bd3",
"versions": 1
},
{
"name": "sbomex",
"updatedAt": "2024-02-29T09:05:24Z",
"id": "e865710e-b262-4f44-9078-970052794a60",
"versions": 1
}
]
TBD
python3 pylynk.py vers --prodId 'e865710e-b262-4f44-9078-970052794a60' --table
Output
ID | VERSION | PRIMARY COMPONENT | UPDATED AT |
-----------------------------------------------------------------------------------------------------------------------------------------------------------------|
fbcc24ad-5911-4229-8943-acf863c07bb4 | sha256:5ed7e95ae79fe3fe6c4b8660f6f9e31154e64eca76ae42963a679fbb198c3951 | centos:centos7.9.2009 | 2024-02-29 01:05:24 PST |
python3 pylynk.py vers --prodId 'e865710e-b262-4f44-9078-970052794a60' --json
Output
[
{
"id": "fbcc24ad-5911-4229-8943-acf863c07bb4",
"vulnRunStatus": "FINISHED",
"updatedAt": "2024-02-29T09:05:24Z",
"primaryComponent": {
"name": "centos:centos7.9.2009",
"version": "sha256:5ed7e95ae79fe3fe6c4b8660f6f9e31154e64eca76ae42963a679fbb198c3951"
}
}
]
python3 pylynk.py vers --prod 'sbom-exec' --table
Output
ID | VERSION | PRIMARY COMPONENT | UPDATED AT |
---------------------------------------------------------------------------------------------------|
e0b1fb60-03de-4202-b316-51422351b96b | 1.3 | agdfda | 2024-02-18 17:01:17 PST |
2f576a83-0918-4749-86a8-3788dd8fd26d | 1.1 | xxx | 2024-02-18 17:01:17 PST |
5a46ab07-174f-4074-b4af-f8f83a17b822 | 1.0.1 | Implantatron Programmer | 2024-02-18 17:01:22 PST |
python3 pylynk.py vers --prod 'sbomqs' --env 'production' --table
Output
ID | VERSION | PRIMARY COMPONENT | UPDATED AT |
-----------------------------------------------------------------------------------------------------------------------------------------------------------------|
6067a2f0-76b1-4b51-97cf-cc01175d66c4 | sha256:5ed7e95ae79fe3fe6c4b8660f6f9e31154e64eca76ae42963a679fbb198c3951 | centos:centos7.9.2009 | 2024-02-29 00:59:11 PST |
TBD
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 --prodId 'e865710e-b262-4f44-9078-970052794a60' --verId 'fbcc24ad-5911-4229-8943-acf863c07bb4'
Output
{
"checksStatus": "COMPLETED",
"policyStatus": "COMPLETED",
"labelingStatus": "UNKNOWN",
"automationStatus": "IN_PROGRESS",
"vulnScanStatus": "NOT_STARTED"
}
Run the following command to upload an SBOM:
python3 pylynk.py download --prod 'sbomex' --verId 'fbcc24ad-5911-4229-8943-acf863c07bb4'
Output
{SBOM Data}
Run the following command to upload an SBOM:
python3 pylynk.py download --prod 'sbomex' --env 'default' --vers 'sha256:5ed7e95ae79fe3fe6c4b8660f6f9e31154e64eca76ae42963a679fbb198c3951'
Output
{SBOM Data}
Upload SBOM file sbomqs.cdx.json to the product named sbomqs
python3 pylynk.py upload --prod 'sbomqs' --sbom sbomqs.cdx.json
Output
Uploaded successfully
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
Output
Uploaded successfully
Use --verbose
or -v
with any command to see debug output.
To point to a different API endpoint than production
export INTERLYNK_API_URL=http://localhost:3000/lynkapi
- 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.