From c67373315e583bd0b1bd51e47bf4e0203a57fb3c Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 5 Jul 2024 03:38:30 +0000 Subject: [PATCH 1/9] commit memo in here --- .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 dd9a342..798482d 100644 --- a/.github/workflows/image-scan.yaml +++ b/.github/workflows/image-scan.yaml @@ -9,7 +9,7 @@ on: jobs: scan: name: Scan Docker Image - runs-on: [runner-2, self-hosted] + #runs-on: [runner-2, self-hosted] steps: - name: Checkout code uses: actions/checkout@v3 @@ -18,9 +18,9 @@ jobs: - name: Run Trivy vulnerability scanner uses: aquasecurity/trivy-action@master with: - image-ref: 'ubuntu:impish-20210711' + image-ref: 'mysql:oracle' format: 'table' exit-code: '1' ignore-unfixed: true vuln-type: 'os,library' - severity: 'CRITICAL,HIGH' \ No newline at end of file + severity: 'CRITICAL,HIGH' From e1d8c49be38b38b8c9c897c754ebd5dabd674e7f Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 5 Jul 2024 05:09:38 +0000 Subject: [PATCH 2/9] commit memo in here --- .github/workflows/image-scan.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/image-scan.yaml b/.github/workflows/image-scan.yaml index 798482d..f8a7cb2 100644 --- a/.github/workflows/image-scan.yaml +++ b/.github/workflows/image-scan.yaml @@ -10,6 +10,7 @@ jobs: scan: name: Scan Docker Image #runs-on: [runner-2, self-hosted] + runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v3 From cf8997c9f1e3e0bc86d7888f72e485c3e48c0878 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 5 Jul 2024 05:16:05 +0000 Subject: [PATCH 3/9] scan blog image --- .github/workflows/image-scan.yaml | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/image-scan.yaml b/.github/workflows/image-scan.yaml index f8a7cb2..4fcd57b 100644 --- a/.github/workflows/image-scan.yaml +++ b/.github/workflows/image-scan.yaml @@ -16,10 +16,28 @@ jobs: uses: actions/checkout@v3 # https://github.com/aquasecurity/trivy-action?tab=readme-ov-file#inputs - - name: Run Trivy vulnerability scanner + - name: Run Trivy vulnerability scanner:nginx uses: aquasecurity/trivy-action@master with: - image-ref: 'mysql:oracle' + image-ref: 'nginx:latest' + format: 'table' + exit-code: '1' + ignore-unfixed: true + vuln-type: 'os,library' + severity: 'CRITICAL,HIGH' + - name: Run Trivy vulnerability scanner:wordpress + 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:mysql + uses: aquasecurity/trivy-action@master + with: + image-ref: 'mysql:8' format: 'table' exit-code: '1' ignore-unfixed: true From 28b9a4c785e8253e1d0f14dbf85f6fbb0ea9c8ca Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 5 Jul 2024 05:35:05 +0000 Subject: [PATCH 4/9] scan blog image --- .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 4fcd57b..f0a4356 100644 --- a/.github/workflows/image-scan.yaml +++ b/.github/workflows/image-scan.yaml @@ -39,7 +39,7 @@ jobs: with: image-ref: 'mysql:8' format: 'table' - exit-code: '1' + exit-code: '0' ignore-unfixed: true vuln-type: 'os,library' severity: 'CRITICAL,HIGH' From 698b8ab6580f82da1fc20b98939338692a1fb04e Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 5 Jul 2024 05:52:48 +0000 Subject: [PATCH 5/9] scan blog image --- .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 f0a4356..9e9a5c7 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 From 44dcd953fa09cfd2f47565a2d8c0cdb623231466 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 5 Jul 2024 06:01:16 +0000 Subject: [PATCH 6/9] scan blog image --- .github/workflows/image-scan.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/image-scan.yaml b/.github/workflows/image-scan.yaml index 9e9a5c7..d0e0a6f 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' @@ -43,3 +43,7 @@ jobs: ignore-unfixed: true vuln-type: 'os,library' severity: 'CRITICAL,HIGH' + - name: Test + run: | + docker ps + shell: bash From 3255f3c0fc125573cc16d16cdad184c30129a2b0 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 5 Jul 2024 06:24:09 +0000 Subject: [PATCH 7/9] run compose --- .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..12503d6 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-9-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-9-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-9-db environment: MYSQL_ROOT_PASSWORD: examplepass MYSQL_DATABASE: exampledb diff --git a/.github/workflows/image-scan.yaml b/.github/workflows/image-scan.yaml index d0e0a6f..5d18c20 100644 --- a/.github/workflows/image-scan.yaml +++ b/.github/workflows/image-scan.yaml @@ -45,5 +45,6 @@ jobs: severity: 'CRITICAL,HIGH' - name: Test run: | - docker ps + cd .cache/ans/single/ + docker compose -d up shell: bash From 80504fd63c38ba2b7830cada3e6f90c8c55bd2e7 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 5 Jul 2024 06:27:48 +0000 Subject: [PATCH 8/9] run compose --- .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 5d18c20..bacfd34 100644 --- a/.github/workflows/image-scan.yaml +++ b/.github/workflows/image-scan.yaml @@ -46,5 +46,5 @@ jobs: - name: Test run: | cd .cache/ans/single/ - docker compose -d up + docker compose up -d shell: bash From 06e5c795cf24535155f7807c9b9099c1c0bc478f Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 5 Jul 2024 06:33:31 +0000 Subject: [PATCH 9/9] run compose --- .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 bacfd34..d0fe213 100644 --- a/.github/workflows/image-scan.yaml +++ b/.github/workflows/image-scan.yaml @@ -45,6 +45,6 @@ jobs: severity: 'CRITICAL,HIGH' - name: Test run: | - cd .cache/ans/single/ + cd .cache/ans/single docker compose up -d shell: bash