Skip to content

Commit

Permalink
Remove path from semgrep command to output relative paths
Browse files Browse the repository at this point in the history
  • Loading branch information
Zharktas committed Sep 30, 2024
1 parent 30c9fd0 commit 754c5e7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:

- name: Run sast scanner
run: |
docker run --rm -v "${{ github.workspace }}:${{ github.workspace }}" -e LEVEL=HIGH -e TARGET=app -e FORMAT=sarif -e SRCDIR=${{ github.workspace }} -e OUTDIR=${{ github.workspace }} $REPOSITORY/sast-scanner-meta:latest
docker run --rm -v "${{ github.workspace }}:/src" -e LEVEL=HIGH -e TARGET=APP -e FORMAT=sarif $REPOSITORY/sast-scanner-meta:latest
env:
REPOSITORY: ${{ secrets.TOOLS_REPOSITORY }}

Expand Down
2 changes: 2 additions & 0 deletions docker/sast-scanner-meta/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ FROM 373155601093.dkr.ecr.eu-west-1.amazonaws.com/dvv/sast-scanner-meta:v1.0.0
COPY ./entrypoint.sh /app/
RUN ["chmod", "+x", "/app/entrypoint.sh"]

WORKDIR /src

ENTRYPOINT ["sh", "-c", "/app/entrypoint.sh ${LEVEL} ${TARGET} ${SRCDIR} ${IACDIR} ${OUTDIR} ${FORMAT} ${EXCLUDE_RULES}"]
2 changes: 1 addition & 1 deletion docker/sast-scanner-meta/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ run_semgrep() {
echo "[*] JUNIT-XML format will be used."
OUTPUT_ARGS="--junit-xml --output $OUTDIR/semgrep-$1-report.xml"
fi
semgrep scan $3 --metrics=off $EXCLUDES $RULE_EXCLUSIONS $OUTPUT_ARGS $SEMGREP_SEVERITY --no-error $2 $ARGS
semgrep scan $3 --metrics=off $EXCLUDES $RULE_EXCLUSIONS $OUTPUT_ARGS $SEMGREP_SEVERITY --no-error $ARGS
}

if [ $2 = "APP" ]
Expand Down

0 comments on commit 754c5e7

Please sign in to comment.