Custom approved-listing filter with Docker

The default approved-listing filter supports the bare minimum to operate on all repositories supported by Snyk. In order to customize the approved-listing filter, create the default filter locally by installing snyk-broker and running broker init [Git type]. The created accept.json is the default filter for the chosen Git type. Place the file in a separate folder such as ./private/accept.json, and provide it to the Docker container by mounting the folder and using the ACCEPT environment variable:

docker run --restart=always \
           -p 8000:8000 \
           -e BROKER_TOKEN=secret-broker-token \
           -e GITHUB_TOKEN=secret-github-token \
           -e PORT=8000 \
           -e BROKER_CLIENT_URL= \
           -e ACCEPT=/private/accept.json
           -v /local/path/to/private:/private \

To filter by header, add a validation block with the following key and values:

KeyValueValue TypeExample


The name of the header you wish to filter on. If this is defined then the named header must explicitly exist on the request; otherwise it will be blocked




The header value must match one of the defined strings



Example: To only allow the SHA Media Type accept header for requests to the GitHub Commits API, you would add the following:

    "method": "GET",
    "path": "/repos/:name/:repo/commits/:ref",
    "origin": "https://${GITHUB_TOKEN}@${GITHUB_API}",
    "valid": [
            "header": "accept",
            "values": ["application/vnd.github.v4.sha"]

Last updated

More information

Snyk privacy policy

© 2023 Snyk Limited | All product and company names and logos are trademarks of their respective owners.