From 4a342991a0b81e035a703e29787a7d30c0a95cd1 Mon Sep 17 00:00:00 2001 From: eu9572 Date: Fri, 5 Jul 2024 06:11:24 +0000 Subject: [PATCH 1/2] Test scan --- .github/workflows/image-scan.yaml | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/.github/workflows/image-scan.yaml b/.github/workflows/image-scan.yaml index dd9a342..d1e276c 100644 --- a/.github/workflows/image-scan.yaml +++ b/.github/workflows/image-scan.yaml @@ -18,9 +18,32 @@ jobs: - name: Run Trivy vulnerability scanner uses: aquasecurity/trivy-action@master with: - image-ref: 'ubuntu:impish-20210711' + image-ref: 'nginx:latest' format: 'table' - exit-code: '1' + exit-code: '0' ignore-unfixed: true vuln-type: 'os,library' - severity: 'CRITICAL,HIGH' \ No newline at end of file + severity: 'CRITICAL,HIGH' + + - name: wordpress + uses: aquasecurity/trivy-action@master + with: + image-ref: 'wordpress:latest' + format: 'table' + exit-code: '0' + ignore-unfixed: true + vuln-type: 'os,library' + severity: 'CRITICAL,HIGH' + - name: mysql + uses: aquasecurity/trivy-action@master + with: + image-ref: 'mysql:8' + format: 'table' + exit-code: '0' + ignore-unfixed: true + vuln-type: 'os,library' + severity: 'CRITICAL,HIGH' + - name: Test + run: + docker ps + shell: bash' From 824ade536f3438008d7c11ae1614d4f81ae6009f Mon Sep 17 00:00:00 2001 From: eu9572 Date: Fri, 5 Jul 2024 06:27:44 +0000 Subject: [PATCH 2/2] test compose --- .cache/ans/single/compose.yaml | 10 +++++----- .github/workflows/image-scan.yaml | 7 ++++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.cache/ans/single/compose.yaml b/.cache/ans/single/compose.yaml index babe355..b29ad1e 100644 --- a/.cache/ans/single/compose.yaml +++ b/.cache/ans/single/compose.yaml @@ -1,5 +1,5 @@ services: - nginx: + nginx-eu9572: image: nginx:latest container_name: nginx volumes: @@ -7,7 +7,7 @@ services: ports: - '12345:80' depends_on: - - wordpress + - wordpress-eu9572 logging: driver: gelf options: @@ -19,7 +19,7 @@ services: retries: 3 restart: unless-stopped - wordpress: + wordpress-eu9572: image: wordpress:latest container_name: wordpress environment: @@ -28,7 +28,7 @@ services: WORDPRESS_DB_PASSWORD: examplepass WORDPRESS_DB_NAME: exampledb depends_on: - - db + - db-eu9572 logging: driver: gelf options: @@ -41,7 +41,7 @@ services: retries: 3 restart: unless-stopped - db: + db-eu9572: image: mysql:8 container_name: db environment: diff --git a/.github/workflows/image-scan.yaml b/.github/workflows/image-scan.yaml index d1e276c..7a5868b 100644 --- a/.github/workflows/image-scan.yaml +++ b/.github/workflows/image-scan.yaml @@ -44,6 +44,7 @@ jobs: vuln-type: 'os,library' severity: 'CRITICAL,HIGH' - name: Test - run: - docker ps - shell: bash' + run: | + cd ./cache/ans/single + docker compose up -d + shell: bash