Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Hadolint and Trivy Checks #557

Merged
merged 19 commits into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
a2d7495
Add Hadolint and Trivy Checks
samuelarogbonlo Apr 11, 2022
ea6fa59
Modify docker-hub-parachain.yml to be dependent on docker-parachain-s…
samuelarogbonlo Feb 10, 2023
5116758
Modify docker-hub.yml to be dependent on docker-scan.yml success (#557)
samuelarogbonlo Feb 10, 2023
95d4be8
Add .github/workflows/docker-parachain-scan.yml (#557)
samuelarogbonlo Feb 10, 2023
59ea542
Add .github/workflows/docker-scan.yml (#557)
samuelarogbonlo Feb 10, 2023
bf12681
Modify hadolint action and actions/checkout version no. (#557)
samuelarogbonlo Feb 10, 2023
b56966b
fix: Resolve Hadolint notices and warnings
samuelarogbonlo Jul 10, 2023
209b601
Revert "fix: Resolve Hadolint notices and warnings"
samuelarogbonlo Jul 10, 2023
8712918
fix: Resolve Hadolint notices and warnings (#557)
samuelarogbonlo Jul 10, 2023
714ed9c
Merge branch 'main' into samuel/cicd
samuelarogbonlo Jul 11, 2023
bc45484
fix: Add .hadolint.yml to ingore rules
samuelarogbonlo Jul 11, 2023
67e16b2
fix: Edit .hadolint.yml
samuelarogbonlo Jul 11, 2023
db9e145
fix: Edit .hadolint.yml
samuelarogbonlo Jul 11, 2023
504a2a8
fix: Edit .github/workflows/docker-parachain-scan.yml
samuelarogbonlo Jul 11, 2023
6f25f55
chore: Comment 'Upload Trivy scan results to Github Security tab'
samuelarogbonlo Jul 11, 2023
52f1bea
fix: Resolve 'no more disk space'
samuelarogbonlo Jul 19, 2023
15cefa9
fix: Set workflow trigger on pull request to main
samuelarogbonlo Jul 19, 2023
a48763a
Merge branch 'main' into samuel/cicd
samuelarogbonlo Jul 24, 2023
ad9819d
Update .github/workflows/docker-hub.yml
sea212 Aug 3, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions .github/workflows/docker-hub-parachain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,17 @@ on:
- '^v[0-9]+.[0-9]+.[0-9]+$'

jobs:
hadolint:
runs-on: ubuntu-20.04
name: "Hadolint"
steps:
- uses: actions/checkout@v3
- uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: "./Dockerfile"

publish:
needs: hadolint
name: Publish
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -48,7 +58,15 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}


- name: Trivy Scan
uses: aquasecurity/trivy-action@master
with:
image-ref: 'zeitgeistpm/zeitgeist-node-parachain:latest'
format: 'sarif'
output: 'zeitgeist-node-parachain-report.sarif'
severity: 'HIGH,CRITICAL'

- name: Update image version of the existing Zeitgeist network spec
uses: "OnFinality-io/action-onf-release@v1"
with:
Expand All @@ -69,4 +87,4 @@ jobs:
onf-network-key: ${{ secrets.ONF_NETWORK_KEY_BS }}
onf-sub-command: image
onf-action: add
image-version: ${{ steps.vars.outputs.tag }}
image-version: ${{ steps.vars.outputs.tag }}
18 changes: 18 additions & 0 deletions .github/workflows/docker-hub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,17 @@ on:
tags: [ '*' ]

jobs:
hadolint:
runs-on: ubuntu-20.04
name: "Hadolint"
steps:
- uses: actions/checkout@v3
- uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: "./Dockerfile"

publish:
needs: hadolint
name: Publish
runs-on: ubuntu-latest
steps:
Expand All @@ -28,3 +38,11 @@ jobs:
else
./scripts/docker-hub-publish.sh ${GITHUB_SHA}
fi

- name: Trivy Scan
uses: aquasecurity/trivy-action@master
with:
image-ref: 'zeitgeistpm/zeitgeist-node:latest'
format: 'sarif'
output: 'zetgeist-node-report.sarif'
severity: 'HIGH,CRITICAL'
3 changes: 3 additions & 0 deletions .hadolint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ignored:
- SC1091
- SC2115
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ WORKDIR /zeitgeist
COPY . /zeitgeist

RUN apt-get update && \
apt-get dist-upgrade -y -o Dpkg::Options::="--force-confold"

apt-get upgrade -y -o Dpkg::Options::="--force-confold"

SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN ./scripts/init.sh nosudo

SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN . "$HOME/.cargo/env" && cargo build --profile "$PROFILE" --features "$FEATURES"

# ==== SECOND STAGE ====
Expand Down