Snyk Shell
Snyk Shell provides a convenient shell interface to the Snyk API. You can use any valid Python expression as well as make calls to the Snyk API using the pre-configured Snyk API client. When you load the the shell it will pre-load a list of your organizations and projects so you have some data to explore.
Installation
Snyk Shell is available from PyPi. Use your prefered Python dependency management tool to install:
pip install snyksh
Snyk Shell is also available as a Docker image.
docker pull garethr/snyksh
Configuration
In order to access the Snyk API you need to provide your API token. This is done using
an environment variable called SNYK_TOKEN:
export SNYK_TOKEN=<your-token-goes-here>
snyksh
docker run --rm -it -e SNYK_TOKEN=<your-token> garethr/snyksh
Usage
With Snyk Shell running you can interact with data in Snyk. This includes your projects as well as vulnerability data more generally.
Here's a few examples.
Welcome to Snyk Shell
The following objects and methods are currently available:
client - An instance of the Snyk client, which can be used to make requests to the API
organizations - A prepopulated list of the Snyk organizations you are a member of
projects - A prepopulated list of all of your Snyk projects
pprint() - A pretty printer for objects returns by the API
In [1]: organizations
Out[1]: [Organization(name='garethr', id='<not-the-read-organization-id>', group=None)]
In [2]: pprint(organizations)
[
snyk.models.Organization(
name='garethr',
id='<not-the-real-organization-id>'
)
]
In [3]: results = client.organizations.first().test_python("django", "2.0.0")
In [4]: len(results.issues.vulnerabilities)
Out[4]: 6
In [5]: [x.identifiers["CVE"][0] for x in results.issues.vulnerabilities]
Out[5]:
['CVE-2019-6975',
'CVE-2018-7536',
'CVE-2018-7537',
'CVE-2018-6188',
'CVE-2018-14574',
'CVE-2019-3498']
The Snyk API client
Snyk Shell uses the Snyk Python API client pysnyk. If you want to build your own applications
which interact with the Snyk API, or you want to know all of the properties and methods avaiable
to you, see the client documentation and examples.
Metadata
Release files for snyksh 0.1.1
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 | |
|---|---|---|---|---|
| snyksh-0.1.1.tar.gz | 3.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| snyksh-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.4 kB
Release files / snyksh-0.1.1.tar.gz
| Download URL | snyksh-0.1.1.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eea72483b3553708e14fa39e63a384ceb5a96333d03c730113a1c9cc5f9af062
|
|
BLAKE2b-256 checksum How to use checksums |
c71edbe5581fda1a1cbac755e1af3fb2118e37e7995195672c20570cf373571d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/0.12.16 CPython/3.7.4 Darwin/18.7.0
|
Release files / snyksh-0.1.1-py3-none-any.whl
| Download URL | snyksh-0.1.1-py3-none-any.whl |
|---|---|
| Size | 3.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
47cbae33e0ffde0d5795bdfee8dea1b6e55fe952d0830e2e90123f1670baf9cc
|
|
BLAKE2b-256 checksum How to use checksums |
6b4df6bc4a8a48dac132ce14a35b4fcb8fdd2178ba1cb54d7ed985e210876a8e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/0.12.16 CPython/3.7.4 Darwin/18.7.0
|
Security for snyksh 0.1.1
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.