Skip to content

Commit

Permalink
Merge branch 'master' into kics-all
Browse files Browse the repository at this point in the history
  • Loading branch information
Baruch Odem (Rothkoff) authored Mar 11, 2024
2 parents 7648586 + 6c03103 commit 3f3828f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
11 changes: 3 additions & 8 deletions .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,9 @@ jobs:
uses: docker/setup-buildx-action@v3

Check warning on line 48 in .github/workflows/pr-validation.yml

View workflow job for this annotation

GitHub Actions / kics

[MEDIUM] Unpinned Actions Full Length Commit SHA

Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload. When selecting a SHA, you should verify it is from the action's repository and not a repository fork.

- run: make build
- name: Run docker and check its output
run:
if docker run -v "$(pwd)":/repo -t checkmarx/2ms:latest git /repo | grep -A 5 "totalitemsscanned:"; then
echo "Docker ran as expected";
else
echo "Docker did not run as expected";
exit 1;
fi
- name: docker run
run: |
docker run -v "$(pwd)":/repo -t checkmarx/2ms:latest git /repo --report-path /output/results.json --ignore-on-exit results
kics:
runs-on: ubuntu-latest
Expand Down
10 changes: 4 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# kics-scan disable=b03a748a-542d-44f4-bb86-9199ab4fd2d5,fd54f200-402c-4333-a5a4-36ef6709af2f
# disable kics Healthcheck result
# and "Missing User Instruction" since 2ms container is stopped after scan

# Builder image
FROM golang:1.20.5-alpine3.18 AS builder

Expand All @@ -10,17 +14,11 @@ COPY . .
RUN go build -o /app/2ms .

# Runtime image
# kics-scan disable=b03a748a-542d-44f4-bb86-9199ab4fd2d5
# ^^^^ disable kics Healthcheck result
FROM alpine:3.18

RUN apk add --no-cache git=2.40.1-r0

RUN addgroup -S 2ms && adduser -S 2ms -G 2ms
USER 2ms

RUN git config --global --add safe.directory /repo

COPY --from=builder /app/2ms /2ms
ENTRYPOINT ["/2ms"]

0 comments on commit 3f3828f

Please sign in to comment.