Skip to main content

TrustSource-pip-scan

TrustSource plugin for scanning python project install pip dependencies and uploading them https://app.trustsource.io for code compliance evaluation This package came about because official TrustSource provided packages (ts-pip-plugin, ts-python-client) and either don't work as of this time or don't provide good integration in the CI/CD pipelines for python projects. The library is influenced by ts-pip-plugin

This plugin is geared towards the use in CI/CD pipelines. It can do legal and vulnerability evaluation after TrustSource analysed the scan results. The package command exist with code 1 if evaluation fails.

Installation

Installation from pip

    pip install ts-pip-scan

Installing it from local dir

git clone https://github.com/JoeMabor/TrustSource-pip-scan.git

pip install <path>/TrustSource-pip-scan

Usage

TrustSource project and api key can be provided as options in the commandline or ts-plugin.json that can be added to root dir of the project to be scanned. Content of ts-plugin.json

{
    "project": "<TrustSource Project Name>",
    "apiKey": "<api-key>",
    base_url: str = TS_API_URL
    max_legal_warnings: 0
    max_legal_violations: 0
    max_vulnerability_warning: 0
    max_vulnerability_violations: 0
    skip_upload: false
    
}

Scan dependencies and upload them to TrustSource

ts-pip-scan scan <path-to-project-being-scanned/

Scan dependencies, upload to TrustSource and evaluate legal and vulnerability analysis

ts-pip-scan scan -val <path-to-project-being-scanned/

Scan dependencies without uploading results

ts-pip-scan scan --skip-upload <path-to-project-being-scanned/

For info about options, run

ts-pip-scan --help
ts-pip-scan scan --help

Some configs can be set as environment variables

max_legal_warnings -> TS_MAX_LEGAL_WARNINGS
max_legal_violations -> TS_MAX_LEGAL_VIOLATIONS
max_vulnerability_warnings -> TS_MAX_VULNERABILITY_WARNINGS
max_vulnerability_violations -> TS_MAX_VULNERABILITY_VIOLATIONS
TS_SKIP_UPLOAD -> skip_upload

Release files for ts-pip-scan 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ts-pip-scan 1.0.3
File Size Uploaded
ts_pip_scan-1.0.3.tar.gz 10.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ts-pip-scan 1.0.3
File Interpreter ABI Platform
ts_pip_scan-1.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 22.1 kB

Release files / ts_pip_scan-1.0.3.tar.gz

Download URL ts_pip_scan-1.0.3.tar.gz
Size 10.9 kB
Tags Source
SHA-256 checksum
How to use checksums
eac03e832dcefd82f3f14a475d57032783858fba16f34a910dd92962f78a2dcd
BLAKE2b-256 checksum
How to use checksums
c1fada77ab3a1801f40909f828529aeeec97817565642bfc6590dd92bb9b1d00
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.16

Release files / ts_pip_scan-1.0.3-py3-none-any.whl

Download URL ts_pip_scan-1.0.3-py3-none-any.whl
Size 11.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
db36df57ae7c7facac5fb4440b6724555f9293e36162b6f54e0ce77622c9516d
BLAKE2b-256 checksum
How to use checksums
6ec74e7acc962f1be51a6cc9de4ad0710d1b3d8339ef9dd335bc7747fd61b904
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.16

Release history Release notifications | RSS feed

This release

1.0.3 This release

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page