forked from hyperledger-cacti/cacti
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e42cac7
commit bdc8526
Showing
5 changed files
with
115 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: azure-container-image-scan | ||
|
||
on: | ||
push: | ||
pull_request: | ||
# Publish `main` as Docker `latest` image. | ||
branches: | ||
- main | ||
|
||
# Publish `v1.2.3` tags as releases. | ||
tags: | ||
- v* | ||
|
||
|
||
jobs: | ||
build-secure-and-push: | ||
name: Scan cactus-example-carbon-accounting image | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/[email protected] | ||
env: | ||
# (Required) The token to use to make API calls to GitHub. | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
|
||
- uses: actions/checkout@v1 | ||
- name: Login to DockerHub Registry | ||
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | ||
|
||
|
||
- name: Build Images from Dockerfile | ||
run: DOCKER_BUILDKIT=1 docker build -f ./examples/carbon-accounting/Dockerfile . -t cactus-example-carbon-accounting | ||
|
||
- uses: Azure/[email protected] | ||
name: Scan image for vulnerabilities | ||
id: container-scan | ||
continue-on-error: true | ||
with: | ||
image-name: cactus-example-carbon-accounting |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: trivy-container-image-scan | ||
|
||
on: | ||
push: | ||
pull_request: | ||
# Publish `main` as Docker `latest` image. | ||
branches: | ||
- main | ||
|
||
# Publish `v1.2.3` tags as releases. | ||
tags: | ||
- v* | ||
|
||
|
||
jobs: | ||
|
||
build: | ||
name: Scan cactus-example-carbon-accounting table image | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Build an image from Dockerfile | ||
run: DOCKER_BUILDKIT=1 docker build . -f ./examples/carbon-accounting/Dockerfile -t cactus-example-carbon-accounting | ||
- name: Run Trivy vulnerability scan for cactus-example-carbon-accounting | ||
uses: aquasecurity/[email protected] | ||
with: | ||
image-ref: 'cactus-example-carbon-accounting' | ||
format: 'table' | ||
exit-code: '0' | ||
ignore-unfixed: true | ||
vuln-type: 'os,library' | ||
severity: 'CRITICAL,HIGH' | ||
|
||
build2: | ||
name: Scan cactus-example-carbon-accounting json image | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Build an image from Dockerfile | ||
run: | | ||
DOCKER_BUILDKIT=1 docker build ./ -f ./examples/carbon-accounting/Dockerfile -t cactus-example-carbon-accounting | ||
- name: Run Trivy vulnerability scanner | ||
uses: aquasecurity/[email protected] | ||
with: | ||
image-ref: 'cactus-example-carbon-accounting' | ||
format: 'json' | ||
exit-code: '0' | ||
ignore-unfixed: true | ||
vuln-type: 'os,library' | ||
severity: 'CRITICAL,HIGH' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM cruizba/ubuntu-dind:19.03.11 as runner | ||
FROM cruizba/ubuntu-dind:20.10.18 as runner | ||
|
||
USER root | ||
|
||
|
@@ -33,12 +33,13 @@ WORKDIR ${APP} | |
|
||
SHELL ["/bin/bash", "--login", "-i", "-c"] | ||
# Installing Node Version Manager (nvm) | ||
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash | ||
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash | ||
RUN source ~/.bashrc && \ | ||
nvm install 16.15.1 && \ | ||
npm install -g yarn && \ | ||
yarn add @hyperledger/cactus-example-carbon-accounting-backend@0.9.1-ci-942.cbb849c6.35 --ignore-engines --production | ||
|
||
nvm install 20.11.1 && \ | ||
npm install --location=global yarn && \ | ||
yarn set version 4.1.0 && \ | ||
yarn add @hyperledger/[email protected] | ||
|
||
SHELL ["/bin/bash", "--login", "-c"] | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters