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

[CI] Add Trivy vulnerables check #85

Merged
merged 1 commit into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
33 changes: 33 additions & 0 deletions .github/workflows/trivy_check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Trivy check for sub repos

on:
pull_request:
push:
branches:
- main

jobs:
test:
name: Trivy check for sub repos
runs-on: [self-hosted, regular]

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Prepare sub repo
run: |
version=v`grep "version :=" images/agent/werf.inc.yaml | awk -F'"' '{ print $2}'`
git clone --depth 1 --branch $version ${{ secrets.SOURCE_REPO }}/util-linux/util-linux.git ./util-linux
git clone ${{ secrets.SOURCE_REPO }}/lvmteam/lvm2.git ./lvm2
version=`grep "version :=" images/sds-utils-installer/werf.inc.yaml | awk -F'"' '{ print $2}'`
cd ./lvm2
git checkout $version
cd ..

- name: Run Trivy vulnerability scanner in fs mode
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
scan-ref: '.'
trivy-config: trivy.yaml
4 changes: 2 additions & 2 deletions images/agent/werf.inc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{{- $_ := set . "BASE_ALT_DEV" "registry.deckhouse.ru/base_images/dev-alt:p10@sha256:76e6e163fa982f03468166203488b569e6d9fc10855d6a259c662706436cdcad" }}

{{ $binaries := "/opt/deckhouse/sds/lib/libblkid.so.1 /opt/deckhouse/sds/lib/libmount.so.1 /opt/deckhouse/sds/lib/libsmartcols.so.1 /opt/deckhouse/sds/bin/nsenter.static /opt/deckhouse/sds/lib/x86_64-linux-gnu/libudev.so.1 /opt/deckhouse/sds/lib/x86_64-linux-gnu/libcap.so.2 ld-linux-x86-64.so.2 /opt/deckhouse/sds/bin/lsblk.dynamic" }}
{{ $util_linux_version := "2.39.3" }}
{{ $version := "2.39.3" }}
---
image: {{ $.ImageName }}-binaries-artifact
from: {{ $.BASE_ALT_DEV }}
Expand Down Expand Up @@ -32,7 +32,7 @@ shell:
- cd /
- git clone {{ env "SOURCE_REPO" }}/util-linux/util-linux.git
- cd /util-linux
- git checkout v{{ $util_linux_version }}
- git checkout v{{ $version }}
- ./autogen.sh
- ./configure LDFLAGS="-static" --enable-static-programs -disable-all-programs --enable-nsenter
- make install-strip
Expand Down
4 changes: 2 additions & 2 deletions images/sds-utils-installer/werf.inc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{{- $_ := set . "BASE_ALT_DEV" "registry.deckhouse.ru/base_images/dev-alt:p10@sha256:76e6e163fa982f03468166203488b569e6d9fc10855d6a259c662706436cdcad" }}

{{ $binaries := "/sds-utils/bin/lvm.static" }}
{{ $lvm_version := "d786a8f820d54ce87a919e6af5426c333c173b11" }}
{{ $version := "d786a8f820d54ce87a919e6af5426c333c173b11" }}
---
image: {{ $.ImageName }}-binaries-artifact
from: {{ $.BASE_ALT_DEV }}
Expand All @@ -28,7 +28,7 @@ shell:
- cd /
- git clone {{ env "SOURCE_REPO" }}/lvmteam/lvm2.git
- cd /lvm2
- git checkout {{ $lvm_version }}
- git checkout {{ $version }}
- ./configure --enable-static_link --disable-silent-rules --disable-readline --enable-blkid_wiping --build=x86_64-linux-gnu
- make
- mkdir -p /sds-utils/bin/
Expand Down
Loading