Skip to content

Commit

Permalink
Correct action name
Browse files Browse the repository at this point in the history
  • Loading branch information
Gary Duan committed Sep 22, 2022
1 parent a58d97e commit e7da517
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 20 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
run: |
docker build -t registry.organization.com/org/image-name:${{ github.sha }} .
- name: Scan Image
uses: bashofmann/neuvector-image-scan-action@main
uses: neuvector/scan-action@main
with:
image-repository: registry.organization.com/org/image-name
image-tag: ${{ github.sha }}
Expand All @@ -58,7 +58,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2
- name: Scan Remote Image
uses: bashofmann/neuvector-image-scan-action@main
uses: neuvector/scan-action@main
with:
image-registry: https://registry.organization.com/
image-registry-username: ${{ secrets.RegistryUsername }}
Expand Down Expand Up @@ -110,7 +110,7 @@ The following inputs can be used in `step.with`:
<!-- start usage -->

```yaml
- uses: bashofmann/neuvector-image-scan-action@main
- uses: neuvector/scan-action@main
with:
# Registry of the image to scan, e.g. `https://registry.organization.com/`
# Default:
Expand Down Expand Up @@ -158,9 +158,9 @@ The following inputs can be used in `step.with`:
<!-- end usage -->
[release]: https://github.com/bashofmann/neuvector-image-scan-action/releases/latest
[release-img]: https://img.shields.io/github/release/bashofmann/neuvector-image-scan-action.svg?logo=github
[marketplace]: https://github.com/marketplace/actions/bashofmann/neuvector-image-scan
[marketplace-img]: https://img.shields.io/badge/marketplace-bashofmann/neuvector-image-scan--action-blue?logo=github
[license]: https://github.com/bashofmann/neuvector-image-scan-action/blob/master/LICENSE
[license-img]: https://img.shields.io/github/license/bashofmann/neuvector-image-scan-action
[release]: https://github.com/neuvector/scan-action/releases/latest
[release-img]: https://img.shields.io/github/release/neuvector/scan-action.svg?logo=github
[marketplace]: https://github.com/marketplace/actions/neuvector/scan-action
[marketplace-img]: https://img.shields.io/badge/marketplace-neuvector/scan--action-blue?logo=github
[license]: https://github.com/neuvector/scan-action/blob/master/LICENSE
[license-img]: https://img.shields.io/github/license/neuvector/scan-action
3 changes: 2 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: 'NeuVector Image Scan'
name: 'NeuVector Vulnerability Scan Action'
description: 'Scans a container image for vulnerabilities with [NeuVector](https://neuvector.com)'
author: 'SUSE NeuVector'
inputs:
image-registry:
description: 'Registry of the image to scan, e.g. `https://registry.organization.com/`'
Expand Down
20 changes: 10 additions & 10 deletions test/scan-image.bats
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/usr/bin/env bats

setup_file() {
docker build . -t bashofmann/neuvector-image-scan-action
docker build . -t neuvector/scan-action
}

@test "docker daemon not reachable" {
run docker run --rm -e SCANNER_REGISTRY=https://index.docker.io/ -e SCANNER_REPOSITORY=library/debian -e SCANNER_TAG=11.0 bashofmann/neuvector-image-scan-action
run docker run --rm -e SCANNER_REGISTRY=https://index.docker.io/ -e SCANNER_REPOSITORY=library/debian -e SCANNER_TAG=11.0 neuvector/scan-action
echo "Status $status"
echo "Output"
echo -e $output
Expand All @@ -14,7 +14,7 @@ setup_file() {
}

@test "invalid scanner image" {
run docker run --rm -e NV_SCANNER_IMAGE=invalid-image:latest -e SCANNER_REGISTRY=https://index.docker.io/ -e SCANNER_REPOSITORY=library/debian -e SCANNER_TAG=11.0 -v /var/run/docker.sock:/var/run/docker.sock bashofmann/neuvector-image-scan-action
run docker run --rm -e NV_SCANNER_IMAGE=invalid-image:latest -e SCANNER_REGISTRY=https://index.docker.io/ -e SCANNER_REPOSITORY=library/debian -e SCANNER_TAG=11.0 -v /var/run/docker.sock:/var/run/docker.sock neuvector/scan-action
echo "Status $status"
echo "Output"
echo -e $output
Expand All @@ -23,7 +23,7 @@ setup_file() {
}

@test "scan image with vulnerabilities but don't fail" {
run docker run --rm -e SCANNER_REGISTRY=https://index.docker.io/ -e SCANNER_REPOSITORY=library/debian -e SCANNER_TAG=11.0 -v /var/run/docker.sock:/var/run/docker.sock bashofmann/neuvector-image-scan-action
run docker run --rm -e SCANNER_REGISTRY=https://index.docker.io/ -e SCANNER_REPOSITORY=library/debian -e SCANNER_TAG=11.0 -v /var/run/docker.sock:/var/run/docker.sock neuvector/scan-action
echo "Status $status"
echo "Output"
echo -e $output
Expand All @@ -32,7 +32,7 @@ setup_file() {
}

@test "scan image with vulnerabilities and high severity fail" {
run docker run --rm -e HIGH_VUL_TO_FAIL=1 -e SCANNER_REGISTRY=https://index.docker.io/ -e SCANNER_REPOSITORY=library/debian -e SCANNER_TAG=11.0 -v /var/run/docker.sock:/var/run/docker.sock bashofmann/neuvector-image-scan-action
run docker run --rm -e HIGH_VUL_TO_FAIL=1 -e SCANNER_REGISTRY=https://index.docker.io/ -e SCANNER_REPOSITORY=library/debian -e SCANNER_TAG=11.0 -v /var/run/docker.sock:/var/run/docker.sock neuvector/scan-action
echo "Status $status"
echo "Output"
echo -e $output
Expand All @@ -41,7 +41,7 @@ setup_file() {
}

@test "scan image with vulnerabilities and medium severity fail" {
run docker run --rm -e MEDIUM_VUL_TO_FAIL=1 -e SCANNER_REGISTRY=https://index.docker.io/ -e SCANNER_REPOSITORY=library/debian -e SCANNER_TAG=11.0 -v /var/run/docker.sock:/var/run/docker.sock bashofmann/neuvector-image-scan-action
run docker run --rm -e MEDIUM_VUL_TO_FAIL=1 -e SCANNER_REGISTRY=https://index.docker.io/ -e SCANNER_REPOSITORY=library/debian -e SCANNER_TAG=11.0 -v /var/run/docker.sock:/var/run/docker.sock neuvector/scan-action
echo "Status $status"
echo "Output"
echo -e $output
Expand All @@ -50,7 +50,7 @@ setup_file() {
}

@test "scan image with vulnerabilities and specific CVE fail" {
run docker run --rm -e VUL_NAMES_TO_FAIL=invalid,CVE-2020-16156 -e SCANNER_REGISTRY=https://index.docker.io/ -e SCANNER_REPOSITORY=library/debian -e SCANNER_TAG=11.0 -v /var/run/docker.sock:/var/run/docker.sock bashofmann/neuvector-image-scan-action
run docker run --rm -e VUL_NAMES_TO_FAIL=invalid,CVE-2020-16156 -e SCANNER_REGISTRY=https://index.docker.io/ -e SCANNER_REPOSITORY=library/debian -e SCANNER_TAG=11.0 -v /var/run/docker.sock:/var/run/docker.sock neuvector/scan-action
echo "Status $status"
echo "Output"
echo -e $output
Expand All @@ -59,7 +59,7 @@ setup_file() {
}

@test "scan image with json output" {
run docker run --rm -e OUTPUT=json -e SCANNER_REGISTRY=https://index.docker.io/ -e SCANNER_REPOSITORY=library/debian -e SCANNER_TAG=11.0 -v /var/run/docker.sock:/var/run/docker.sock bashofmann/neuvector-image-scan-action
run docker run --rm -e OUTPUT=json -e SCANNER_REGISTRY=https://index.docker.io/ -e SCANNER_REPOSITORY=library/debian -e SCANNER_TAG=11.0 -v /var/run/docker.sock:/var/run/docker.sock neuvector/scan-action
echo "Status $status"
echo "Output"
echo -e $output
Expand All @@ -68,10 +68,10 @@ setup_file() {
}

@test "scan image with csv output" {
run docker run --rm -e OUTPUT=csv -e SCANNER_REGISTRY=https://index.docker.io/ -e SCANNER_REPOSITORY=library/debian -e SCANNER_TAG=11.0 -v /var/run/docker.sock:/var/run/docker.sock bashofmann/neuvector-image-scan-action
run docker run --rm -e OUTPUT=csv -e SCANNER_REGISTRY=https://index.docker.io/ -e SCANNER_REPOSITORY=library/debian -e SCANNER_TAG=11.0 -v /var/run/docker.sock:/var/run/docker.sock neuvector/scan-action
echo "Status $status"
echo "Output"
echo -e $output
[ "$status" -eq 0 ]
[[ "$output" =~ '"severity"' ]]
}
}

0 comments on commit e7da517

Please sign in to comment.