Safety 2 (formerly PyUp)
  • Welcome to Safety 2
  • 2023 Rebrand from PyUp to Safety Cybersecurity
  • Safety 2.x Basics
    • Getting started with Safety 2.x
    • Running a Safety Scan
    • License Scanning
  • Safety CLI 2 Scanner
    • Installation & Quick Start - Safety 2
    • Docker Containers
    • Inputs
    • Output Formats
    • Policy File
    • Applying Security Updates to Requirements Files
    • Exit Codes
    • Help and Support
    • Safety v1 to v2 Breaking Changes
  • Securing Git SCM Pipelines
    • Securing Git Repositories
    • GitHub Actions
      • Advanced Options: GitHub Actions
    • BitBucket Pipelines
    • Gitlab Pipelines
    • GitHub Integration
    • Scanning Development Environments with Git Post-Commit Hook
  • Troubleshooting
    • Invalid API Key Error
Powered by GitBook
On this page
  • Scanning your current environment
  • Scanning a requirements.txt file
  • Piping requirements into Safety
  1. Safety CLI 2 Scanner

Inputs

Safety allows you to scan your Python dependencies in a few different ways:

Scanning your current environment

Safety can scan your current environment for all packages that are currently installed. This type of scan will ensure that all downstream (recursive) package installations are audited and checked for security vulnerabilities.

safety check --key <YOUR-API-KEY>

Scanning a requirements.txt file

safety check -r <path-to-requirements-file> --key <YOUR-API-KEY>

Piping requirements into Safety

You can pipe your requirements.txt content directly into Safety via the --stdin argument. For example:

cat requirements.txt | safety check --key <YOUR-API-KEY> --stdin

PreviousDocker ContainersNextOutput Formats

Last updated 1 year ago