Skip to content

Commit

Permalink
github action for grype
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanFl committed Jan 24, 2023
1 parent 4376d4a commit ac9f30b
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
6 changes: 6 additions & 0 deletions SCA/grype_image/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM stefanfle/secobserve-scanners:latest

WORKDIR /
COPY entrypoint.sh .
RUN chmod +x entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
23 changes: 23 additions & 0 deletions SCA/grype_image/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: 'SecObserve Grype image'
description: 'Scans Docker images for vulnerabilities with Grype'
author: 'MaibornWolff'
inputs:
target:
description: 'The target to be scanned, here the name of the docker image.'
required: true
default: '.'
report_name:
description: 'The name of the report to be written.'
required: true
further_parameters:
description: 'Further parameters to be given to the scanner.'
required: false
default: ''

runs:
using: 'docker'
image: "Dockerfile"
env:
INPUT_TARGET: ${{ inputs.target }}
INPUT_REPORT_NAME: ${{ inputs.report_name }}
INPUT_FURTHER_PARAMETERS: ${{ inputs.further_parameters }}
8 changes: 8 additions & 0 deletions SCA/grype_image/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
set -e

cd "$GITHUB_WORKSPACE"
docker pull "$INPUT_TARGET"
grype docker:"$INPUT_TARGET" $INPUT_FURTHER_PARAMETERS --output cyclonedx-json --file "$INPUT_REPORT_NAME"

exit 0

0 comments on commit ac9f30b

Please sign in to comment.