mirror of
https://github.com/safedep/pmg.git
synced 2026-08-03 07:24:09 +02:00
* feat: Sandbox implementation with seatbelt * refactor: Remove concept of PM_CACHE * fix: Misc fixes * refactor: Sandbox for separation of boundaries * fix: Apply API * fix: Add support for sandbox cleanup * test: Add variable interpolation test * fix: Misc cleanup fixes * chore: Cleanup sandbox registry * chore: Cleanup sandbox policy * chore: Cleanup sandbox * fix: Misc cleanup fixes * fix: Remove violation mode * fix: Update config template * chore: Go mod cleanup * fix: Handle the case when package manager policy is explicitly disabled * fix: Sandbox executor * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Abhisek Datta <abhisek.datta@gmail.com> * test: Remove unused var * test: Add test for seatbelt sandbox driver * fix: Sandbox profile loader from file should use path for caching * test: Add policy test * feat: Add support for config templates * fix: Seatbelt translator handle glob * fix: Merge conflicts * fix: Fix sandbox policy generator for MacOS min permissions * fix: Sandbox path handling bugs * fix: Deny read to dangerous directories * fix: Deny read to dangerous directories * add sandbox e2e (#112) * fix: Sandbox E2E test * fix: Code review fixes * fix: Code review fixes * doc: Add sandbox debugging guide * doc: Update sandbox doc * docs: Add sandbox usage doc * fix: Use better error for sandbox without policy * fix: Add sandbox for npx * fix: Enable PTY for npm --------- Signed-off-by: Abhisek Datta <abhisek.datta@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Sahil Bansal <bansalsahil315@gmail.com>
76 lines
1.9 KiB
YAML
76 lines
1.9 KiB
YAML
name: pypi-restrictive
|
|
description: Restrictive sandbox policy for PyPI ecosystem (pip, poetry, uv)
|
|
package_managers:
|
|
- pip
|
|
- pip3
|
|
- poetry
|
|
- uv
|
|
|
|
# Optional security settings (uncomment to enable)
|
|
# allow_git_config: false # Allow package managers to modify .git/config (default: false, blocks for security)
|
|
|
|
# Allow interactive terminal (PTY) operations (default: false)
|
|
allow_pty: true
|
|
|
|
filesystem:
|
|
allow_read:
|
|
- ${CWD}/**
|
|
- ${HOME}/.config/pip/**
|
|
- ${HOME}/.pip/**
|
|
- ${HOME}/.poetry/**
|
|
- ${HOME}/.cache/pip/**
|
|
- ${HOME}/.cache/pypoetry/**
|
|
- ${HOME}/.cache/poetry/**
|
|
- ${HOME}/.cache/uv/**
|
|
- /usr/local/**
|
|
- /Library/**
|
|
- /System/Library/**
|
|
|
|
allow_write:
|
|
# Note: ${TMPDIR} is automatically allowed when write restrictions are enabled (macOS)
|
|
# Note: Patterns ending with /** automatically allow creating the parent directory.
|
|
# For example, ${CWD}/.venv/** allows both:
|
|
# 1. Creating the .venv directory itself
|
|
# 2. Writing any files/directories inside it
|
|
- ${CWD}/.venv/**
|
|
- ${CWD}/venv/**
|
|
- ${HOME}/.cache/pip/**
|
|
- ${HOME}/.cache/pypoetry/**
|
|
- ${HOME}/.cache/poetry/**
|
|
- ${HOME}/.cache/uv/**
|
|
- ${HOME}/.local/lib/python*/**
|
|
|
|
# Additional deny rules (optional - credentials are automatically blocked)
|
|
# Automatically blocked for security:
|
|
# - .env, .env.*, .ssh/, .aws/, .gcloud/, .kube/, .gnupg/, .docker/config.json
|
|
# - .git/hooks/ (always blocked)
|
|
# - .git/config (blocked unless allow_git_config: true)
|
|
deny_read: []
|
|
|
|
deny_write:
|
|
# Additional system directories to protect
|
|
- /etc/**
|
|
- /usr/**
|
|
|
|
network:
|
|
allow_outbound:
|
|
- pypi.org:443
|
|
- files.pythonhosted.org:443
|
|
- github.com:443
|
|
|
|
deny_outbound:
|
|
- "*:*"
|
|
|
|
process:
|
|
allow_exec:
|
|
- /usr/bin/python*
|
|
- /usr/local/bin/python*
|
|
- /usr/bin/gcc
|
|
- /usr/bin/clang
|
|
- /usr/bin/git
|
|
|
|
deny_exec:
|
|
- /usr/bin/curl
|
|
- /usr/bin/wget
|
|
- /bin/bash
|