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.5.tar.gz (4.8 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.5-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pytrust-0.2.5.tar.gz
Algorithm Hash digest
SHA256 038a2cf1ec6ece7835097cd0e50ea8bd79cdb782bdd0f0284eda66de84c2c7e4
MD5 25b841955cda8862c21a9bdd3b35d290
BLAKE2b-256 2685161ba0d9c7549cdf9fa6fa3a62617a797cbd02d7f0cbeb98e58b7145e856

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pytrust-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 94f09f5c809d0e3005c4eb9f040431bfeb8d88bba428b86fc79d7ca7ae59910c
MD5 0bc4c070cc59f2cc2427cf5136a955b2
BLAKE2b-256 9518a2b926a0331ce983c1016342602bd190b7c5959664257bb9c8e339d41420

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