Skip to main content

CLI tool to check package permissions.

Project description

pytrust

PyPI License

pytrust is a CLI tool to analyze Python packages for their use of file system, environment variables, web requests, and exec calls. It helps you audit dependencies and generate permission reports in YAML format.

Installation

pip install pytrust

Usage

Analyze a single package and print its permissions as YAML

$ pytrust pypdf
pypdf:
  file_system: true
  env_vars: false
  web_requests: false
  exec_usage: false

Check a package against a permissions file

$ pytrust pypdf package-permissions.yaml
Permission violations found:
 - file_system: REQUIRED but NOT GIVEN

Analyze all installed (non-default) packages and print combined YAML

$ pytrust > all-packages-permissions.yaml

# Gives:
pypdf:
  file_system: true
  env_vars: false
  web_requests: false
  exec_usage: false
pytz:
  file_system: true
  env_vars: true
  web_requests: false
  exec_usage: false
flit:
  file_system: true
  env_vars: true
  web_requests: true
  exec_usage: false
six:
  file_system: false
  env_vars: false
  web_requests: false
  exec_usage: true
... (the list might be pretty long!)

Permissions YAML Example

In this file you specify which packages are allowed to access certain resources. For example:

pypdf:
	file_system: true  # needed to read/write PDF files
	env_vars: false
	web_requests: false
	exec_usage: false

Contributing & Help

  • Issues and PRs welcome!

Made with ❤️ by Martin Thoma and contributors.

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

pytrust-0.2.2.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

pytrust-0.2.2-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file pytrust-0.2.2.tar.gz.

File metadata

  • Download URL: pytrust-0.2.2.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.3

File hashes

Hashes for pytrust-0.2.2.tar.gz
Algorithm Hash digest
SHA256 270e4c2e305f2c1341024ab93d62b5b74d9f57a201567afd1d5a0fcc74f62ba0
MD5 2e7cec81002207acbb9744acfc692b5b
BLAKE2b-256 d9aca40e978f6712a4011b678f01e4d858f8678fc4849757bb59032acbddda8b

See more details on using hashes here.

File details

Details for the file pytrust-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: pytrust-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.3

File hashes

Hashes for pytrust-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c791cdf56081b7b81ac42139466e488cb6315d8201ed2cf07a0dc799571f5e90
MD5 35e9ce57fe551fe551270ecee98ece70
BLAKE2b-256 33651cb55cd8335916c8d8e9dd3bba8e65213cfd8471aed7f41841d12e15df36

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