{"id":13809909,"url":"https://github.com/snyk-labs/snyk-filter","last_synced_at":"2026-02-26T11:15:11.917Z","repository":{"id":37796447,"uuid":"126257790","full_name":"snyk-labs/snyk-filter","owner":"snyk-labs","description":"Snyk filtering for SNYK CLI","archived":false,"fork":false,"pushed_at":"2024-05-15T23:05:06.000Z","size":484,"stargazers_count":15,"open_issues_count":10,"forks_count":26,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-05-19T06:16:25.304Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://snyk.io","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/snyk-labs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-03-22T00:37:53.000Z","updated_at":"2023-12-21T14:17:03.000Z","dependencies_parsed_at":"2024-01-13T22:53:30.887Z","dependency_job_id":null,"html_url":"https://github.com/snyk-labs/snyk-filter","commit_stats":null,"previous_names":["snyk-tech-services/snyk-filter"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snyk-labs%2Fsnyk-filter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snyk-labs%2Fsnyk-filter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snyk-labs%2Fsnyk-filter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snyk-labs%2Fsnyk-filter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/snyk-labs","download_url":"https://codeload.github.com/snyk-labs/snyk-filter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":213870383,"owners_count":15650179,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T02:00:39.301Z","updated_at":"2026-02-26T11:15:06.609Z","avatar_url":"https://github.com/snyk-labs.png","language":"JavaScript","funding_links":[],"categories":["Snyk CLI, Plugins, Extensions, Filters"],"sub_categories":[],"readme":"[![Snyk logo](https://snyk.io/style/asset/logo/snyk-print.svg)](https://snyk.io)\n\n***\n\n# Custom Filtering for Snyk CLI\nsnyk-filter takes the JSON outputted from the [Snyk CLI](https://support.snyk.io/hc/en-us/articles/360003812578-CLI-reference), e.g. `snyk test --json` and applies custom filtering of the results, as well as options to fail your build.\n\n[![Known Vulnerabilities](https://snyk.io//test/github/snyk-tech-services/snyk-filter/badge.svg?targetFile=package.json)](https://snyk.io//test/github/snyk-tech-services/snyk-filter?targetFile=package.json)\n[![CircleCI](https://circleci.com/gh/snyk-tech-services/snyk-filter.svg?style=svg)](https://circleci.com/gh/snyk-tech-services/snyk-filter)\n[![Inactively Maintained](https://img.shields.io/badge/Maintenance%20Level-Inactively%20Maintained-yellowgreen.svg)](https://gist.github.com/cheerfulstoic/d107229326a01ff0f333a1d3476e068d)\n\n\n**This repository is in maintenance mode, no new features are being developed. Bug \u0026 security fixes will continue to be delivered. Open source contributions are welcome for small features \u0026 fixes (no breaking changes)**\n\n# How do I use it?\n\n## Install\n`npm i -g snyk-filter`\n\n### Note about `node-jq`\n\nsnyk-filter uses the `node-jq` library, which requires that a [`jq`](https://stedolan.github.io/jq/) binary is installed.  This typically happens transparently via `npm install -g`, but on some systems JQ does not get properly installed locally. If you receive an error after installation regarding `node-jq`, then `jq` should be installed manually to avoid this error.\n\n```\n# install jq ahead of time (ubuntu example)\nsudo apt-get install -y jq\n\n# tell node-jq to skip trying to install it on its own\nexport NODE_JQ_SKIP_INSTALL_BINARY=true\n\n# tell node-jq where the existing jq binary is\nexport JQ_PATH=$(which jq)\n\n# finally, install snyk-filter (does not work with node version \u003e 12)\nsudo npm install -g\n```\n\n## Usage\n\n1. Implement your custom JQ filters in a .snyk-filter/snyk.yml file relative to your current working directory where you will be running snyk test from (see in [sample-filters](https://github.com/snyk-tech-services/snyk-filter/tree/develop/sample-filters) and tweak things from there - use [JQPlay](https://jqplay.org/) )\n\n2. Then pipe your `snyk test --json` output into `snyk-filter` or use the `-i` argument to input a json file. Use the `-f` argument to point to the yml file containing your custom filters if you are not using the default location (.snyk-filter/snyk.yml).\n\n3. Return code of snyk-filter will be 0 for pass (no issues) and 1 for fail (issues found)\n\n### Example with Snyk CLI (using .snyk-filter/snyk.yml by default)\n`snyk test --json | snyk-filter`\n\n### Example with Snyk CLI and custom yml file location\n`snyk test --json | snyk-filter -f /path/to/example-cvss-9-or-above.yml`\n\n### Example\n`snyk-filter -i snyk_results.json`\n\n### Example with custom yml file location\n`snyk-filter -i snyk_results.json -f /path/to/example-high-upgradeable-vulns.yml`\n\n## Options\n`--json` to output json\n\n### License\n\n[License: Apache License, Version 2.0](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnyk-labs%2Fsnyk-filter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsnyk-labs%2Fsnyk-filter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnyk-labs%2Fsnyk-filter/lists"}