Skip to content

Commit

Permalink
feat: switch to Snyk CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
sethyates committed Apr 15, 2023
1 parent 2c54261 commit 3634baf
Show file tree
Hide file tree
Showing 27 changed files with 54 additions and 32,654 deletions.
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

55 changes: 0 additions & 55 deletions .eslintrc.json

This file was deleted.

1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

5 changes: 0 additions & 5 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,3 @@ updates:
directory: /
schedule:
interval: daily

- package-ecosystem: npm
directory: /
schedule:
interval: daily
53 changes: 0 additions & 53 deletions .github/workflows/check-dist.yml

This file was deleted.

31 changes: 0 additions & 31 deletions .github/workflows/test.yml

This file was deleted.

3 changes: 0 additions & 3 deletions .prettierignore

This file was deleted.

10 changes: 0 additions & 10 deletions .prettierrc.json

This file was deleted.

24 changes: 14 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,23 @@ To use the GitHub Action, add the following to your job:
### Inputs
| Name | Default | Description |
|----------------|--------------|---------------------------------------------------------------------------------------------------------------|
| `scan-version` | `latest` | the version of docker scan to install |
| `image` | required | name of image to scan |
| `tag` | `latest` | tag of image to scan |
| `severity` | `medium` | only report vulnerabilities of provided level or higher (low, medium, high) |
| `token` | required | use the authentication token to log into the third-party scanning provider |
| `file` | `Dockerfile` | specify the location of the Dockerfile associated with the image. This option displays a detailed scan result |
| `exclude-base` | `false` | exclude the base image during scanning |
| Name | Default | Description |
|------------|--------------|---------------------------------------------------------------------------------------------------------------|
| `image` | required | name of image to scan |
| `tag` | `latest` | tag of image to scan |
| `file` | `Dockerfile` | specify the location of the Dockerfile associated with the image. This option displays a detailed scan result |
| `severity` | `medium` | only report vulnerabilities of provided level or higher (low, medium, high) |
| `args` | N/A | Additional arguments to pass to Snyk |
| `fail-on` | `all` | Fail only when there are vulnerabilities that can be fixed. |

### Outputs

No outputs

### Environment variables

The `SNYK_TOKEN` environment variable should be set.

### Example

```yaml
Expand All @@ -42,7 +45,8 @@ jobs:
- uses: conventional-actions/docker-scan@v1
with:
image: octo/kit
token: ${{ secrets.SNYK_TOKEN }}
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
```

## License
Expand Down
26 changes: 0 additions & 26 deletions __tests__/main.test.ts

This file was deleted.

54 changes: 40 additions & 14 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,57 @@ inputs:
required: false
description: 'version of docker scan to use'
default: latest
deprecationMessage: 'no longer available'
token:
required: false
description: 'use the authentication token to log into the third-party scanning provider'
deprecationMessage: 'no longer available'
exclude-base:
required: false
description: 'exclude the base image during scanning'
default: 'false'
deprecationMessage: 'no longer available'
image:
required: true
description: 'name of image to scan'
tag:
required: false
description: 'tag of image to scan'
severity:
required: false
description: 'only report vulnerabilities of provided level or higher (low, medium, high)'
default: 'medium'
token:
required: false
description: 'use the authentication token to log into the third-party scanning provider'
default: 'latest'
file:
required: false
description: 'specify the location of the Dockerfile associated with the image. This option displays a detailed scan result'
default: Dockerfile
exclude-base:
severity:
required: false
description: 'exclude the base image during scanning'
default: 'false'
description: 'only report vulnerabilities of provided level or higher (low, medium, high, critical)'
default: 'medium'
args:
required: false
description: 'Additional arguments to pass to Snyk'
fail-on:
required: false
default: all
description: 'Fail only when there are vulnerabilities that can be fixed.'
runs:
using: 'node16'
pre: 'dist/setup/index.js'
main: 'dist/main/index.js'
using: "docker"
image: "docker://snyk/snyk:docker"
env:
SNYK_INTEGRATION_NAME: GITHUB_ACTIONS
SNYK_INTEGRATION_VERSION: docker
args:
- snyk
- container
- test
- --sarif
- --severity-threshold
- ${{ inputs.severity }}
- --fail-on
- ${{ inputs.fail-on }}
- --file
- ${{ inputs.file }}
- ${{ inputs.args }}
- ${{ inputs.image }}:${{ inputs.tag }}
branding:
icon: zoom-in
icon: alert-triangle
color: purple
Loading

0 comments on commit 3634baf

Please sign in to comment.