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.1.tar.gz (4.5 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.1-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pytrust-0.2.1.tar.gz
Algorithm Hash digest
SHA256 ae20143f5d6bbc10038f09211edaa747f31f877a65b488ab6a28505e52712e94
MD5 d048da6ff75fbed9733c11319d82ff0c
BLAKE2b-256 c25e8e2518c93ad26231aba892c1fbe0acee8578187750176ac40a4e0f85772c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pytrust-0.2.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 63d7005ddb1f1e1c0f02ced8a1e15977507f6aa3be580d28f34f74256641049a
MD5 77d11d211b3bfdc29b404da8c36e6ef8
BLAKE2b-256 151667f4d92a525f32af26ae06f7798e6aec86c71a0dfba0eff1a88a83c8a97b

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