Skip to main content

TrustSource plugin for scanning python project installed pip dependencies and uploading them to [TrustSource](https://app.trustsource.io) via its API for code compliance evaluation

Project description

TrustSource-pip-scan

TrustSource plugin for scanning python project installed pip dependencies and uploading them to TrustSource 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 toward 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>",
    "skipTranser": false,
    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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ts_pip_scan-1.0.0.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ts_pip_scan-1.0.0-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file ts_pip_scan-1.0.0.tar.gz.

File metadata

  • Download URL: ts_pip_scan-1.0.0.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.16

File hashes

Hashes for ts_pip_scan-1.0.0.tar.gz
Algorithm Hash digest
SHA256 1254fdf9280b190480c70485be9d4bfb23f543bf6cc04b76d4db473a22c9c1f9
MD5 a2511a74102dc6b13ca4e397bcb8ebeb
BLAKE2b-256 b662eb15d01b770b671f4832b9f4b2a4973f8344eef817c1178ab513b02d4b61

See more details on using hashes here.

File details

Details for the file ts_pip_scan-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: ts_pip_scan-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.16

File hashes

Hashes for ts_pip_scan-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8c2039ada055f86cf50858d3763bf535e596b5089ffe65210ceb73e3508b295c
MD5 f6244d0ae1bd5b1f4875f6418a0f5d9e
BLAKE2b-256 f6e3baad6adf26382c1c11764937947b0182a488ed9a0cfd06c4e9b3ec4c0908

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page