[](https://pypi.python.org/pypi/safety)
[](https://travis-ci.org/pyupio/safety)
[](https://pyup.io/repos/github/pyupio/safety/)
Safety checks your installed dependencies for known security vulnerabilities
# Installation
Install `safety` with pip
```bash
pip install safety
```
# Usage
To check your currently selected virtual environment for dependencies with known security
vulnerabilites, run:
```bash
safety check
```
You should get a report similar to this:
```bash
╒══════════════════════════════════════════════════════════════════════════════╕
│ │
│ /$$$$$$ /$$ │
│ /$$__ $$ | $$ │
│ /$$$$$$$ /$$$$$$ | $$ \__//$$$$$$ /$$$$$$ /$$ /$$ │
│ /$$_____/ |____ $$| $$$$ /$$__ $$|_ $$_/ | $$ | $$ │
│ | $$$$$$ /$$$$$$$| $$_/ | $$$$$$$$ | $$ | $$ | $$ │
│ \____ $$ /$$__ $$| $$ | $$_____/ | $$ /$$| $$ | $$ │
│ /$$$$$$$/| $$$$$$$| $$ | $$$$$$$ | $$$$/| $$$$$$$ │
│ |_______/ \_______/|__/ \_______/ \___/ \____ $$ │
│ /$$ | $$ │
│ | $$$$$$/ │
│ by pyup.io \______/ │
│ │
╞══════════════════════════════════════════════════════════════════════════════╡
│ REPORT │
╞══════════════════════════════════════════════════════════════════════════════╡
│ No known security vulnerabilities found. │
╘══════════════════════════════════════════════════════════════════════════════╛
```
Now, let's install something insecure:
```bash
pip install insecure-package
```
*Yeah, you can really install that.*
Run `safety check` again:
```bash
╒══════════════════════════════════════════════════════════════════════════════╕
│ │
│ /$$$$$$ /$$ │
│ /$$__ $$ | $$ │
│ /$$$$$$$ /$$$$$$ | $$ \__//$$$$$$ /$$$$$$ /$$ /$$ │
│ /$$_____/ |____ $$| $$$$ /$$__ $$|_ $$_/ | $$ | $$ │
│ | $$$$$$ /$$$$$$$| $$_/ | $$$$$$$$ | $$ | $$ | $$ │
│ \____ $$ /$$__ $$| $$ | $$_____/ | $$ /$$| $$ | $$ │
│ /$$$$$$$/| $$$$$$$| $$ | $$$$$$$ | $$$$/| $$$$$$$ │
│ |_______/ \_______/|__/ \_______/ \___/ \____ $$ │
│ /$$ | $$ │
│ | $$$$$$/ │
│ by pyup.io \______/ │
│ │
╞══════════════════════════════════════════════════════════════════════════════╡
│ REPORT │
╞══════════════════════════╤═══════════════╤═══════════════════╤═══════════════╡
│ package │ installed │ affected │ source │
╞══════════════════════════╧═══════════════╧═══════════════════╧═══════════════╡
│ insecure-package │ 0.1.0 │ <0.2.0 │ changelog │
╘══════════════════════════╧═══════════════╧═══════════════════╧═══════════════╛
```
Safety is also able to read from stdin with the `--stdin` flag set.
To check a local requirements file, run:
```
cat requirements.txt | safety check --stdin
```
or the output of `pip freeze`:
```
pip freeze | safety check --stdin
```
or to check a single package:
```
echo "insecure-package==0.1" | safety check --stdin
```
# Travis
```
install:
- pip install safety
script:
- safety check
```
# How it Works
# Support
If you are using `safety` in one of your projects, please consider getting a paid
[pyup.io](https://pyup.io) account. This is what makes projects like this possible.
=======
History
=======
0.4.0 (2016-11-07)
------------------
* Filter out non-requirements when reading from stdin.
0.3.0 (2016-10-28)
------------------
* Added option to read from stdin.
0.2.2 (2016-10-21)
------------------
* Fix import errors on python 2.6 and 2.7.
0.2.1 (2016-10-21)
------------------
* Fix packaging bug.
0.2.0 (2016-10-20)
------------------
* Releasing first prototype.
0.1.0 (2016-10-19)
------------------
* First release on PyPI.
Metadata
Release files for safety 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| safety-0.4.0.tar.gz | 6.4 kB | Without provenance | Details for safety-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| safety-0.4.0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for safety-0.4.0-py2.py3-none-any.whl |
Total release size: 15.1 kB
Release files / safety-0.4.0.tar.gz
| Download URL | safety-0.4.0.tar.gz |
|---|---|
| Size | 6.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
be7e38d4e1ae64def9318a4da52970379e2523c0282509a0f3beaf2bc971cc88
|
|
BLAKE2b-256 checksum How to use checksums |
5052eeec2cb15aedf0b3e06c8886065bcbf9e7fd891ddd52822cf42d32a95cae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / safety-0.4.0-py2.py3-none-any.whl
| Download URL | safety-0.4.0-py2.py3-none-any.whl |
|---|---|
| Size | 8.7 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
61f712b6b915828cf615f0b5fd8aff40192816434826cebf0089d6e1285ab1c3
|
|
BLAKE2b-256 checksum How to use checksums |
b63a8b2ede19bfcdf31c44df43b85f5c72e8f48c2733174e081916dc75e44ce4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for safety 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.