Tool designed to add tags in bulk to Snyk projects
Project description
Snyk Tags Tool
Snyk Tags is a CLI tool with one purpose:
- Help filter Snyk projects by product type by adding product tags across a Snyk Group or Organization
Snyk Tags is a CLI tool that uses the Snyk Project API to assign tags in bulk to Snyk projects based on the product type.
Snyk Tags will update all projects of the specified product type within a Snyk Group or Organization with the product's tag.
You can also specify a custom tag for the products.
Once you run snyk-tags, go into the UI, naviagate to the projects page and find the tags filter options on the left-hand menu. Select the Product tag and the product as the key. All your Snyk projects from a specific product will be shown via this filter.
Installation and requirements
Requirements
Requires Python version above 3.6
Installation
To install the simplest way is to use pip:
pip install snyk-tags
Alternatively you can clone the repo and then run the following commands:
poetry install # To install dependencies
python -m snyk-tags # To run snyk-tags
Examples
I want to filter all my Snyk Code projects to the whole Snyk Group:
snyk-tags apply sast --groupid=abc --token=abc
I want to filter all my npm Snyk Open Source projects within a specific Snyk Organization:
snyk-tags apply sast --scatype=npm --orgid=abc --token=abc
Usage
Usage: snyk-tags [OPTIONS] COMMAND [ARGS]
COMMAND:
- apply:
snyk-tags apply --help
- container:
snyk-tags apply container
- Used to tag Snyk Container projects [default: deb]
- iac:
snyk-tags apply iac
- Used to tag Snyk IaC projects [default: iac]
- sast:
snyk-tags apply sast
- Used to tag Snyk Code projects [default: sast]
- sca:
snyk-tags apply sca
- Used to tag Snyk Open Source projects [default: mvn]
- custom:
snyk-tags apply custom
- Used to create a custom tag for the projects
- container:
OPTIONS:
- [-v, --version]:
snyk tags -v
- [--containertype]:
snyk-tags apply container --containertype=deb
- Define the type of Snyk Container projects to tag
- [--scatype]:
snyk-tags apply sca --scatype=maven
- Define the type of Snyk Open Source projects to tag
- [--projecttype]:
snyk-tags apply custom --projecttype=maven --tagkey=Type --tagvalue=Value
- Define the type of project to tag, must be accompanied by
tagkey
andtagvalue
- Define the type of project to tag, must be accompanied by
- [--tagkey]:
snyk-tags apply custom --projecttype=deb --tagkey=Type --tagvalue=Value
- Define the custom tag
- [--tagvalue]:
snyk-tags apply custom --projecttype=iac --tagkey=Type --tagvalue=Value
- Define the value of the custom tag
ARGS:
- [--group-id]:
snyk tags sast --group-id=abc
- Define the Group ID you want to apply the tags to
- Can also be imported as an environment variable
- [--org-id]:
snyk tags sast --org-id=abc
- Define the Organization ID you want to apply the tags to
- Can also be imported as an environment variable
- [--token]:
snyk-tags apply sast --token=abc
- Define the Snyk API Token you want to use (needs Group access by default)
- Can also be imported as an environment variable
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for snyk_tags-0.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cca91d47eb3bcafcc997b58bc728ce73ca7cbd062cb161118b687ec246e29d9b |
|
MD5 | 17d770642a41e2bc4f62f10d556c68d7 |
|
BLAKE2b-256 | f9ef72eed1a80d2e0d47aa34da374c952d885412c3a78a8b6955169ee149af44 |