From de2a5d8961b976468ee321dc18e0611f4a9e2555 Mon Sep 17 00:00:00 2001 From: roger90827 Date: Fri, 5 Jul 2024 05:20:32 +0000 Subject: [PATCH 01/12] test --- .github/workflows/image-scan.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/image-scan.yaml b/.github/workflows/image-scan.yaml index dd9a342..7b2a4bb 100644 --- a/.github/workflows/image-scan.yaml +++ b/.github/workflows/image-scan.yaml @@ -9,7 +9,8 @@ on: jobs: scan: name: Scan Docker Image - runs-on: [runner-2, self-hosted] + #runs-on: [runner-2, self-hosted] + runs-on:ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v3 @@ -18,9 +19,11 @@ 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' ignore-unfixed: true vuln-type: 'os,library' - severity: 'CRITICAL,HIGH' \ No newline at end of file + severity: 'CRITICAL,HIGH' + image-ref: 'wordpress:latest' + image-ref: 'mysql:8' From bf7b6588043b11a964996e75d477c27af066fe2a Mon Sep 17 00:00:00 2001 From: roger90827 Date: Fri, 5 Jul 2024 05:23:43 +0000 Subject: [PATCH 02/12] test2 --- .github/workflows/image-scan.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/image-scan.yaml b/.github/workflows/image-scan.yaml index 7b2a4bb..6a8c3f9 100644 --- a/.github/workflows/image-scan.yaml +++ b/.github/workflows/image-scan.yaml @@ -25,5 +25,21 @@ jobs: ignore-unfixed: true vuln-type: 'os,library' severity: 'CRITICAL,HIGH' + name: Run Trivy vulnerability scanner + uses: aquasecurity/trivy-action@master + with: image-ref: 'wordpress:latest' + format: 'table' + exit-code: '1' + ignore-unfixed: true + vuln-type: 'os,library' + severity: 'CRITICAL,HIGH' + name: Run Trivy vulnerability scanner + uses: aquasecurity/trivy-action@master + with: image-ref: 'mysql:8' + format: 'table' + exit-code: '1' + ignore-unfixed: true + vuln-type: 'os,library' + severity: 'CRITICAL,HIGH' From 963a6d84fd35a03a0ada67ee8a5caae5c8c88cf6 Mon Sep 17 00:00:00 2001 From: roger90827 Date: Fri, 5 Jul 2024 05:26:47 +0000 Subject: [PATCH 03/12] test3 --- .github/workflows/image-scan.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/image-scan.yaml b/.github/workflows/image-scan.yaml index 6a8c3f9..a26396f 100644 --- a/.github/workflows/image-scan.yaml +++ b/.github/workflows/image-scan.yaml @@ -16,7 +16,7 @@ jobs: uses: actions/checkout@v3 # https://github.com/aquasecurity/trivy-action?tab=readme-ov-file#inputs - - name: Run Trivy vulnerability scanner + - name: Nginx uses: aquasecurity/trivy-action@master with: image-ref: 'nginx:latest' @@ -25,7 +25,7 @@ jobs: ignore-unfixed: true vuln-type: 'os,library' severity: 'CRITICAL,HIGH' - name: Run Trivy vulnerability scanner + name: Wordpress uses: aquasecurity/trivy-action@master with: image-ref: 'wordpress:latest' @@ -34,7 +34,7 @@ jobs: ignore-unfixed: true vuln-type: 'os,library' severity: 'CRITICAL,HIGH' - name: Run Trivy vulnerability scanner + name: Mysql uses: aquasecurity/trivy-action@master with: image-ref: 'mysql:8' From 1101660a99ec5a7ca5b1dc8da7d8673a677b97a3 Mon Sep 17 00:00:00 2001 From: roger90827 Date: Fri, 5 Jul 2024 05:31:47 +0000 Subject: [PATCH 04/12] test4 --- .github/workflows/image-scan.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/image-scan.yaml b/.github/workflows/image-scan.yaml index a26396f..9d126ee 100644 --- a/.github/workflows/image-scan.yaml +++ b/.github/workflows/image-scan.yaml @@ -10,7 +10,7 @@ jobs: scan: name: Scan Docker Image #runs-on: [runner-2, self-hosted] - runs-on:ubuntu-latest + runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v3 From 95a4bbc2380054cbaf4c31f312624206fc41f776 Mon Sep 17 00:00:00 2001 From: roger90827 Date: Fri, 5 Jul 2024 05:35:45 +0000 Subject: [PATCH 05/12] test5 --- .github/workflows/image-scan.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/image-scan.yaml b/.github/workflows/image-scan.yaml index 9d126ee..8753620 100644 --- a/.github/workflows/image-scan.yaml +++ b/.github/workflows/image-scan.yaml @@ -25,7 +25,7 @@ jobs: ignore-unfixed: true vuln-type: 'os,library' severity: 'CRITICAL,HIGH' - name: Wordpress + - name: Wordpress uses: aquasecurity/trivy-action@master with: image-ref: 'wordpress:latest' @@ -34,12 +34,12 @@ jobs: ignore-unfixed: true vuln-type: 'os,library' severity: 'CRITICAL,HIGH' - name: Mysql + - name: Mysql uses: aquasecurity/trivy-action@master with: image-ref: 'mysql:8' format: 'table' - exit-code: '1' + exit-code: '0' ignore-unfixed: true vuln-type: 'os,library' severity: 'CRITICAL,HIGH' From 6ccfced180bea09a579e8d284e19a2be9f00e09f Mon Sep 17 00:00:00 2001 From: roger90827 Date: Fri, 5 Jul 2024 05:51:44 +0000 Subject: [PATCH 06/12] test6 --- .github/workflows/image-scan.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/image-scan.yaml b/.github/workflows/image-scan.yaml index 8753620..e6d94f1 100644 --- a/.github/workflows/image-scan.yaml +++ b/.github/workflows/image-scan.yaml @@ -9,8 +9,8 @@ on: jobs: scan: name: Scan Docker Image - #runs-on: [runner-2, self-hosted] - runs-on: ubuntu-latest + runs-on: [runner-1, self-hosted] + #runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v3 @@ -43,3 +43,8 @@ jobs: ignore-unfixed: true vuln-type: 'os,library' severity: 'CRITICAL,HIGH' + + - name: test-run + run: + ls + shell:bash From 90f218b9ce05499f93f1ed912a431443d930af5a Mon Sep 17 00:00:00 2001 From: roger90827 Date: Fri, 5 Jul 2024 05:59:58 +0000 Subject: [PATCH 07/12] test7 --- .github/workflows/image-scan.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/image-scan.yaml b/.github/workflows/image-scan.yaml index e6d94f1..903e8b7 100644 --- a/.github/workflows/image-scan.yaml +++ b/.github/workflows/image-scan.yaml @@ -21,7 +21,7 @@ jobs: with: image-ref: 'nginx:latest' format: 'table' - exit-code: '1' + exit-code: '0' ignore-unfixed: true vuln-type: 'os,library' severity: 'CRITICAL,HIGH' @@ -30,7 +30,7 @@ jobs: with: image-ref: 'wordpress:latest' format: 'table' - exit-code: '1' + exit-code: '0' ignore-unfixed: true vuln-type: 'os,library' severity: 'CRITICAL,HIGH' @@ -44,7 +44,7 @@ jobs: vuln-type: 'os,library' severity: 'CRITICAL,HIGH' - - name: test-run + - name: Test run: - ls + docker ps shell:bash From 5be4a40ae161aa6eaa6256c31cb14fb8dac5d50b Mon Sep 17 00:00:00 2001 From: roger90827 Date: Fri, 5 Jul 2024 06:08:35 +0000 Subject: [PATCH 08/12] test8 --- .github/workflows/image-scan.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/image-scan.yaml b/.github/workflows/image-scan.yaml index 903e8b7..98c6ddf 100644 --- a/.github/workflows/image-scan.yaml +++ b/.github/workflows/image-scan.yaml @@ -9,8 +9,8 @@ on: jobs: scan: name: Scan Docker Image - runs-on: [runner-1, self-hosted] - #runs-on: ubuntu-latest + runs-on: [runner-1, self-hosted] + #runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v3 From 926eb8b8af9755d4695884277321b2a9b9d96e7e Mon Sep 17 00:00:00 2001 From: roger90827 Date: Fri, 5 Jul 2024 06:17:40 +0000 Subject: [PATCH 09/12] test8 --- .github/workflows/image-scan.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/image-scan.yaml b/.github/workflows/image-scan.yaml index 98c6ddf..257efc2 100644 --- a/.github/workflows/image-scan.yaml +++ b/.github/workflows/image-scan.yaml @@ -10,7 +10,6 @@ jobs: scan: name: Scan Docker Image runs-on: [runner-1, self-hosted] - #runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v3 From 7341d838f771d7b2e3622f935b991a04277be1fc Mon Sep 17 00:00:00 2001 From: roger90827 Date: Fri, 5 Jul 2024 06:21:26 +0000 Subject: [PATCH 10/12] test9 --- .github/workflows/image-scan.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/image-scan.yaml b/.github/workflows/image-scan.yaml index 257efc2..5a8284f 100644 --- a/.github/workflows/image-scan.yaml +++ b/.github/workflows/image-scan.yaml @@ -46,4 +46,4 @@ jobs: - name: Test run: docker ps - shell:bash + shell: bash From 9e9d003d4a8e97e02edaff7f5fcd29f3ad51c575 Mon Sep 17 00:00:00 2001 From: roger90827 Date: Fri, 5 Jul 2024 06:25:23 +0000 Subject: [PATCH 11/12] test10 --- .cache/ans/single/compose.yaml | 6 +++--- .github/workflows/image-scan.yaml | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.cache/ans/single/compose.yaml b/.cache/ans/single/compose.yaml index babe355..fda941d 100644 --- a/.cache/ans/single/compose.yaml +++ b/.cache/ans/single/compose.yaml @@ -1,7 +1,7 @@ services: nginx: image: nginx:latest - container_name: nginx + container_name: user-20-nginx volumes: - ./nginx.conf:/etc/nginx/nginx.conf:ro ports: @@ -21,7 +21,7 @@ services: wordpress: image: wordpress:latest - container_name: wordpress + container_name: user-20-wordpress environment: WORDPRESS_DB_HOST: db WORDPRESS_DB_USER: exampleuser @@ -43,7 +43,7 @@ services: db: image: mysql:8 - container_name: db + container_name: user-20-db environment: MYSQL_ROOT_PASSWORD: examplepass MYSQL_DATABASE: exampledb diff --git a/.github/workflows/image-scan.yaml b/.github/workflows/image-scan.yaml index 5a8284f..2e5e93f 100644 --- a/.github/workflows/image-scan.yaml +++ b/.github/workflows/image-scan.yaml @@ -45,5 +45,6 @@ jobs: - name: Test run: - docker ps + cd .cache/ans/single + docker compose up -d shell: bash From 8744145847376a1ccbe88224e95096b27a8bd3dc Mon Sep 17 00:00:00 2001 From: roger90827 Date: Fri, 5 Jul 2024 06:31:05 +0000 Subject: [PATCH 12/12] test-11 --- .github/workflows/image-scan.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/image-scan.yaml b/.github/workflows/image-scan.yaml index 2e5e93f..93bba35 100644 --- a/.github/workflows/image-scan.yaml +++ b/.github/workflows/image-scan.yaml @@ -44,7 +44,7 @@ jobs: severity: 'CRITICAL,HIGH' - name: Test - run: + run: | cd .cache/ans/single docker compose up -d shell: bash