From c718c3ea95fc739d1fd31722f5fba0a645fae0a0 Mon Sep 17 00:00:00 2001 From: nginx-bot <68849795+nginx-bot@users.noreply.github.com> Date: Mon, 24 Jun 2024 01:18:53 -0700 Subject: [PATCH 01/37] Docker image update d41d8cd9 (#5822) --- build/Dockerfile | 6 +++--- tests/Dockerfile | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/Dockerfile b/build/Dockerfile index c0f45b1ed9..a1cfc7422f 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -15,11 +15,11 @@ FROM ghcr.io/nginxinc/k8s-common:nginx-opentracing-1.27.0-alpine@sha256:5dc5c763 FROM ghcr.io/nginxinc/alpine-fips:0.1.0-alpine3.17@sha256:f00b3f266422feaaac7b733b46903bd19eb1cd1caa6991131576f5f767db76f8 AS alpine-fips-3.17 FROM ghcr.io/nginxinc/alpine-fips:0.2.0-alpine3.19@sha256:1744ae3a8e795daf771f3f7df33b83160981545abb1f1597338e2769d06aa1cc AS alpine-fips-3.19 FROM redhat/ubi9-minimal@sha256:a7d837b00520a32502ada85ae339e33510cdfdbc8d2ddf460cc838e12ec5fa5a AS ubi-minimal -FROM golang:1.22-alpine@sha256:32c85006b1edf29c097514e0c81a33334aa1450685a885c10657ec756dbb7703 AS golang-builder +FROM golang:1.22-alpine@sha256:ace6cc3fe58d0c7b12303c57afe6d6724851152df55e08057b43990b927ad5e8 AS golang-builder ############################################# Base image for Alpine ############################################# -FROM nginx:1.27.0-alpine@sha256:d68d230c2c7f0b28c7e5f17ed66d521deeba23aa467568202af72f7f7f61cd94 AS alpine +FROM nginx:1.27.0-alpine@sha256:a45ee5d042aaa9e81e013f97ae40c3dda26fbe98f22b6251acdf28e579560d55 AS alpine RUN --mount=type=bind,from=alpine-opentracing-lib,target=/tmp/ot/ \ apk add --no-cache libcap libstdc++ \ @@ -29,7 +29,7 @@ RUN --mount=type=bind,from=alpine-opentracing-lib,target=/tmp/ot/ \ ############################################# Base image for Debian ############################################# -FROM nginx:1.27.0@sha256:56b388b0d79c738f4cf51bbaf184a14fab19337f4819ceb2cae7d94100262de8 AS debian +FROM nginx:1.27.0@sha256:9c367186df9a6b18c6735357b8eb7f407347e84aea09beb184961cb83543d46e AS debian RUN --mount=type=bind,from=opentracing-lib,target=/tmp/ot/ \ apt-get update \ diff --git a/tests/Dockerfile b/tests/Dockerfile index 57bffe74b5..c89a54f505 100644 --- a/tests/Dockerfile +++ b/tests/Dockerfile @@ -5,7 +5,7 @@ FROM kindest/node:v1.30.0@sha256:047357ac0cfea04663786a612ba1eaba9702bef25227a79 # this is here so we can grab the latest version of skopeo and have dependabot keep it up to date FROM quay.io/skopeo/stable:v1.15.1 -FROM python:3.12@sha256:4584ea46d313a10e849eb7c5ef36be14773418233516ceaa9e52a8ff7d5e35a5 +FROM python:3.12@sha256:f6d04873f0a67146854270e5f6513ed5e0165557c1b10689f1a20e9e65c8fe8e RUN apt-get update \ && apt-get install -y curl git \ From 5b1978c6a0cba10377a31d3514c737256fe6696e Mon Sep 17 00:00:00 2001 From: Paul Abel <128620221+pdabelf5@users.noreply.github.com> Date: Mon, 24 Jun 2024 09:55:05 +0100 Subject: [PATCH 02/37] Run Trivy & DockerScout on main & release branches (#5818) --- .github/workflows/build-plus.yml | 1 - .github/workflows/image-promotion.yml | 272 ++++++++++++++++++++++++++ 2 files changed, 272 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-plus.yml b/.github/workflows/build-plus.yml index 342a6e07fd..86c8b912b9 100644 --- a/.github/workflows/build-plus.yml +++ b/.github/workflows/build-plus.yml @@ -49,7 +49,6 @@ jobs: build: permissions: contents: read # for docker/build-push-action to read repo content - security-events: write # for github/codeql-action/upload-sarif to upload SARIF results id-token: write # for OIDC login to AWS pull-requests: write # for scout report runs-on: ubuntu-22.04 diff --git a/.github/workflows/image-promotion.yml b/.github/workflows/image-promotion.yml index 34f4771b82..43476412d7 100644 --- a/.github/workflows/image-promotion.yml +++ b/.github/workflows/image-promotion.yml @@ -5,6 +5,8 @@ name: Image Promotion # - tag edge for main workflows # - tag release branch name for release branch workflows # - release edge images & helm charts for edge +# - run Trivy & dockerscout scans for main & release branch images +# & upload results to Github security & Github Artifacts on: push: @@ -338,3 +340,273 @@ jobs: image: quay.io/nginx/nginx-ingress:edge-ubi project_id: ${{ secrets.CERTIFICATION_PROJECT_ID }} pyxis_token: ${{ secrets.PYXIS_API_TOKEN }} + + scan-docker-oss: + name: Scan Docker OSS + runs-on: ubuntu-22.04 + needs: [checks] + permissions: + contents: read + id-token: write + security-events: write + if: ${{ !cancelled() && !failure() }} + strategy: + fail-fast: false + matrix: ${{ fromJSON( needs.checks.outputs.image_matrix_oss ) }} + steps: + - name: Checkout Repository + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + + - name: Make directory for security scan results + id: directory + run: | + directory=${{ matrix.image }}-${{ matrix.target }}-results + echo "directory=${directory}" >> $GITHUB_OUTPUT + mkdir -p "${directory}" + + - name: Docker meta + id: meta + uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1 + with: + context: workflow + images: | + name=gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-ingress + flavor: | + suffix=${{ contains(matrix.image, 'ubi') && '-ubi' || '' }}${{ contains(matrix.image, 'alpine') && '-alpine' || '' }} + tags: | + type=raw,value=${{ github.ref_name == github.event.repository.default_branch && 'edge' || github.ref_name }} + + - name: Authenticate to Google Cloud + id: auth + uses: google-github-actions/auth@71fee32a0bb7e97b4d33d548e7d957010649d8fa # v2.1.3 + with: + token_format: access_token + workload_identity_provider: ${{ secrets.GCR_WORKLOAD_IDENTITY }} + service_account: ${{ secrets.GCR_SERVICE_ACCOUNT }} + + - name: Login to GCR + uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0 + with: + registry: gcr.io + username: oauth2accesstoken + password: ${{ steps.auth.outputs.access_token }} + + - name: Run Trivy vulnerability scanner + uses: aquasecurity/trivy-action@7c2007bcb556501da015201bcba5aa14069b74e2 # 0.23.0 + continue-on-error: true + with: + image-ref: ${{ steps.meta.outputs.tags }} + format: "sarif" + output: "${{ steps.directory.outputs.directory }}/trivy.sarif" + ignore-unfixed: "true" + + - name: DockerHub Login for Docker Scount + uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Run Docker Scout vulnerability scanner + id: docker-scout + uses: docker/scout-action@fc749439af4870e8f6feb592250ab728600d10a6 # v1.10.0 + with: + command: cves,recommendations + image: ${{ steps.meta.outputs.tags }} + ignore-base: true + only-fixed: true + sarif-file: "${{ steps.directory.outputs.directory }}/scout.sarif" + write-comment: false + github-token: ${{ secrets.GITHUB_TOKEN }} # to be able to write the comment + summary: true + + - name: Upload Scan Results to Github Artifacts + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 + with: + name: "${{ github.ref_name }}-${{ steps.directory.outputs.directory }}" + path: "${{ steps.directory.outputs.directory }}/" + overwrite: true + + - name: Upload Scan results to GitHub Security tab + uses: github/codeql-action/upload-sarif@3ab4101902695724f9365a384f86c1074d94e18c # v3.24.7 + with: + sarif_file: "${{ steps.directory.outputs.directory }}/" + + scan-docker-plus: + name: Scan Docker Plus + runs-on: ubuntu-22.04 + needs: [checks] + permissions: + contents: read + id-token: write + security-events: write + if: ${{ !cancelled() && !failure() }} + strategy: + fail-fast: false + matrix: ${{ fromJSON( needs.checks.outputs.image_matrix_plus ) }} + steps: + - name: Checkout Repository + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + + - name: Make directory for security scan results + id: directory + run: | + directory=${{ matrix.image }}-${{ matrix.target }}-results + echo "directory=${directory}" >> $GITHUB_OUTPUT + mkdir -p "${directory}" + + - name: Docker meta + id: meta + uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1 + with: + context: workflow + images: | + name=gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-plus-ingress + flavor: | + suffix=${{ contains(matrix.image, 'ubi') && '-ubi' || '' }}${{ contains(matrix.image, 'alpine') && '-alpine' || '' }}${{ contains(matrix.target, 'aws') && '-mktpl' || '' }}${{ contains(matrix.image, 'fips') && '-fips' || ''}} + tags: | + type=raw,value=${{ github.ref_name == github.event.repository.default_branch && 'edge' || github.ref_name }} + + - name: Authenticate to Google Cloud + id: auth + uses: google-github-actions/auth@71fee32a0bb7e97b4d33d548e7d957010649d8fa # v2.1.3 + with: + token_format: access_token + workload_identity_provider: ${{ secrets.GCR_WORKLOAD_IDENTITY }} + service_account: ${{ secrets.GCR_SERVICE_ACCOUNT }} + + - name: Login to GCR + uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0 + with: + registry: gcr.io + username: oauth2accesstoken + password: ${{ steps.auth.outputs.access_token }} + + - name: Run Trivy vulnerability scanner + uses: aquasecurity/trivy-action@7c2007bcb556501da015201bcba5aa14069b74e2 # 0.23.0 + continue-on-error: true + with: + image-ref: ${{ steps.meta.outputs.tags }} + format: "sarif" + output: "${{ steps.directory.outputs.directory }}/trivy.sarif" + ignore-unfixed: "true" + + - name: DockerHub Login for Docker Scount + uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Run Docker Scout vulnerability scanner + id: docker-scout + uses: docker/scout-action@fc749439af4870e8f6feb592250ab728600d10a6 # v1.10.0 + with: + command: cves,recommendations + image: ${{ steps.meta.outputs.tags }} + ignore-base: true + only-fixed: true + sarif-file: "${{ steps.directory.outputs.directory }}/scout.sarif" + write-comment: false + github-token: ${{ secrets.GITHUB_TOKEN }} # to be able to write the comment + summary: true + + - name: Upload Scan Results to Github Artifacts + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 + with: + name: "${{ github.ref_name }}-${{ steps.directory.outputs.directory }}" + path: "${{ steps.directory.outputs.directory }}/" + overwrite: true + + - name: Upload Scan results to GitHub Security tab + uses: github/codeql-action/upload-sarif@3ab4101902695724f9365a384f86c1074d94e18c # v3.24.7 + with: + sarif_file: "${{ steps.directory.outputs.directory }}/" + + scan-docker-nap: + name: Scan Docker Plus + NAP WAF/DOS + runs-on: ubuntu-22.04 + needs: [checks] + permissions: + contents: read + id-token: write + security-events: write + if: ${{ !cancelled() && !failure() }} + strategy: + fail-fast: false + matrix: ${{ fromJSON( needs.checks.outputs.image_matrix_nap ) }} + steps: + - name: Checkout Repository + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + + - name: Make directory for security scan results + id: directory + run: | + directory=${{ matrix.image }}-${{ matrix.target }}-results + echo "directory=${directory}" >> $GITHUB_OUTPUT + mkdir -p "${directory}" + + - name: Docker meta + id: meta + uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1 + with: + context: workflow + images: | + name=gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic${{ contains(matrix.nap_modules, 'dos') && '-dos' || '' }}${{ contains(matrix.nap_modules, 'waf') && '-nap' || '' }}${{ contains(matrix.image, 'v5') && '-v5' || '' }}/nginx-plus-ingress + flavor: | + suffix=${{ contains(matrix.image, 'ubi') && '-ubi' || '' }}${{ contains(matrix.image, 'alpine') && '-alpine' || '' }}${{ contains(matrix.target, 'aws') && '-mktpl' || '' }}${{ contains(matrix.image, 'fips') && '-fips' || ''}} + tags: | + type=raw,value=${{ github.ref_name == github.event.repository.default_branch && 'edge' || github.ref_name }} + + - name: Authenticate to Google Cloud + id: auth + uses: google-github-actions/auth@71fee32a0bb7e97b4d33d548e7d957010649d8fa # v2.1.3 + with: + token_format: access_token + workload_identity_provider: ${{ secrets.GCR_WORKLOAD_IDENTITY }} + service_account: ${{ secrets.GCR_SERVICE_ACCOUNT }} + + - name: Login to GCR + uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0 + with: + registry: gcr.io + username: oauth2accesstoken + password: ${{ steps.auth.outputs.access_token }} + + - name: Run Trivy vulnerability scanner + uses: aquasecurity/trivy-action@7c2007bcb556501da015201bcba5aa14069b74e2 # 0.23.0 + continue-on-error: true + with: + image-ref: ${{ steps.meta.outputs.tags }} + format: "sarif" + output: "${{ steps.directory.outputs.directory }}/trivy.sarif" + ignore-unfixed: "true" + + - name: DockerHub Login for Docker Scount + uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Run Docker Scout vulnerability scanner + id: docker-scout + uses: docker/scout-action@fc749439af4870e8f6feb592250ab728600d10a6 # v1.10.0 + with: + command: cves,recommendations + image: ${{ steps.meta.outputs.tags }} + ignore-base: true + only-fixed: true + sarif-file: "${{ steps.directory.outputs.directory }}/scout.sarif" + write-comment: false + github-token: ${{ secrets.GITHUB_TOKEN }} # to be able to write the comment + summary: true + + - name: Upload Scan Results to Github Artifacts + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 + with: + name: "${{ github.ref_name }}-${{ steps.directory.outputs.directory }}" + path: "${{ steps.directory.outputs.directory }}/" + overwrite: true + + - name: Upload Scan results to GitHub Security tab + uses: github/codeql-action/upload-sarif@3ab4101902695724f9365a384f86c1074d94e18c # v3.24.7 + with: + sarif_file: "${{ steps.directory.outputs.directory }}/" From 1d33ebfcc8a52e84cc7064ad659274a620c1967b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Jun 2024 09:01:30 +0000 Subject: [PATCH 03/37] Bump nginx from `d68d230` to `5c0c227` in /build (#5819) Bumps nginx from `d68d230` to `5c0c227`. --- updated-dependencies: - dependency-name: nginx dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Paul Abel From 379e30b291dbd6a793653b88905ab734448af5b1 Mon Sep 17 00:00:00 2001 From: oseoin Date: Mon, 24 Jun 2024 10:41:27 +0100 Subject: [PATCH 04/37] Skip upload test results on skipped tests (#5827) --- .github/workflows/setup-smoke.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/setup-smoke.yml b/.github/workflows/setup-smoke.yml index 8298c9c019..0fddf00ef9 100644 --- a/.github/workflows/setup-smoke.yml +++ b/.github/workflows/setup-smoke.yml @@ -164,4 +164,4 @@ jobs: with: name: ${{ steps.smoke-tests.outputs.test-results-name }} path: ${{ steps.smoke-tests.outputs.test-results-path }} - if: always() + if: ${{ success() || failure() }} From 7d217f0654b17a878c618295019abbe8d36fae17 Mon Sep 17 00:00:00 2001 From: oseoin Date: Mon, 24 Jun 2024 11:21:27 +0100 Subject: [PATCH 05/37] Change test upload logic to match test run logic (#5829) --- .github/workflows/setup-smoke.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/setup-smoke.yml b/.github/workflows/setup-smoke.yml index 0fddf00ef9..229cb79efa 100644 --- a/.github/workflows/setup-smoke.yml +++ b/.github/workflows/setup-smoke.yml @@ -164,4 +164,4 @@ jobs: with: name: ${{ steps.smoke-tests.outputs.test-results-name }} path: ${{ steps.smoke-tests.outputs.test-results-path }} - if: ${{ success() || failure() }} + if: ${{ !cancelled() && steps.stable_exists.outputs.exists != 'true' }} From 5f56fe0f9d1a3ea0a022f60b63325ca44902d767 Mon Sep 17 00:00:00 2001 From: oseoin Date: Mon, 24 Jun 2024 11:51:53 +0100 Subject: [PATCH 06/37] Fix branch prefix for docker sha updates (#5830) --- .github/workflows/update-docker-sha.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/update-docker-sha.yml b/.github/workflows/update-docker-sha.yml index ee75c7f302..7d1a5c4213 100644 --- a/.github/workflows/update-docker-sha.yml +++ b/.github/workflows/update-docker-sha.yml @@ -6,12 +6,12 @@ on: source_branch: required: true type: string - default: 'main' + default: "main" excludes: description: Comma separated list of strings to exclude images from the update required: false type: string - default: '' + default: "" dry_run: type: boolean default: false @@ -78,7 +78,7 @@ jobs: token: ${{ secrets.NGINX_PAT }} commit-message: Update docker images ${{ steps.update_images.outputs.docker_md5 }} title: Docker image update ${{ steps.update_images.outputs.docker_md5 }} - branch: chore/image-update-${{ needs.vars.outputs.source_branch }}-${{ steps.update_images.outputs.docker_md5 }} + branch: deps/image-update-${{ needs.vars.outputs.source_branch }}-${{ steps.update_images.outputs.docker_md5 }} author: nginx-bot labels: | dependencies From 30832505bf1a955112b177d7348e76147acd438e Mon Sep 17 00:00:00 2001 From: Paul Abel <128620221+pdabelf5@users.noreply.github.com> Date: Mon, 24 Jun 2024 12:20:55 +0100 Subject: [PATCH 07/37] add permissions to update released images (#5831) --- .github/workflows/update-docker-images.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/update-docker-images.yml b/.github/workflows/update-docker-images.yml index 62be001ad9..926973f2e4 100644 --- a/.github/workflows/update-docker-images.yml +++ b/.github/workflows/update-docker-images.yml @@ -244,6 +244,7 @@ jobs: permissions: contents: read id-token: write + packages: write secrets: inherit release-oss-public: From bc13ff7ed676296c26fb454140e005d627896463 Mon Sep 17 00:00:00 2001 From: nginx-bot <68849795+nginx-bot@users.noreply.github.com> Date: Mon, 24 Jun 2024 05:35:57 -0700 Subject: [PATCH 08/37] Version Bump for 3.7.0 (#5828) Co-authored-by: oseoin --- .github/data/version.txt | 4 ++-- charts/nginx-ingress/Chart.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/data/version.txt b/.github/data/version.txt index ad7d39021e..c7de7c8366 100644 --- a/.github/data/version.txt +++ b/.github/data/version.txt @@ -1,2 +1,2 @@ -IC_VERSION=3.6.0 -HELM_CHART_VERSION=1.3.0 +IC_VERSION=3.7.0 +HELM_CHART_VERSION=1.4.0 diff --git a/charts/nginx-ingress/Chart.yaml b/charts/nginx-ingress/Chart.yaml index d17ff02b8d..66c5315c79 100644 --- a/charts/nginx-ingress/Chart.yaml +++ b/charts/nginx-ingress/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: nginx-ingress -version: 1.3.0 -appVersion: 3.6.0 +version: 1.4.0 +appVersion: 3.7.0 kubeVersion: ">= 1.23.0-0" type: application description: NGINX Ingress Controller From 5247156330bb575361282ac292f5cd2ea597c849 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Jun 2024 13:13:44 +0000 Subject: [PATCH 09/37] Bump the go group with 1 update (#5821) Bumps the go group with 1 update: [github.com/go-chi/chi/v5](https://github.com/go-chi/chi). Updates `github.com/go-chi/chi/v5` from 5.0.13 to 5.0.14 - [Release notes](https://github.com/go-chi/chi/releases) - [Changelog](https://github.com/go-chi/chi/blob/master/CHANGELOG.md) - [Commits](https://github.com/go-chi/chi/compare/v5.0.13...v5.0.14) --- updated-dependencies: - dependency-name: github.com/go-chi/chi/v5 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: go ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: oseoin --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 10d2d30e3b..0f35d09aec 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/cert-manager/cert-manager v1.15.0 github.com/dlclark/regexp2 v1.11.0 github.com/gkampitakis/go-snaps v0.5.4 - github.com/go-chi/chi/v5 v5.0.13 + github.com/go-chi/chi/v5 v5.0.14 github.com/golang-jwt/jwt/v4 v4.5.0 github.com/golang/glog v1.2.0 github.com/google/go-cmp v0.6.0 diff --git a/go.sum b/go.sum index 7c66bc7b12..8e57d3c6b1 100644 --- a/go.sum +++ b/go.sum @@ -75,8 +75,8 @@ github.com/gkampitakis/go-snaps v0.5.4/go.mod h1:ZABkO14uCuVxBHAXAfKG+bqNz+aa1bG github.com/go-asn1-ber/asn1-ber v1.5.5/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0= github.com/go-asn1-ber/asn1-ber v1.5.6 h1:CYsqysemXfEaQbyrLJmdsCRuufHoLa3P/gGWGl5TDrM= github.com/go-asn1-ber/asn1-ber v1.5.6/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0= -github.com/go-chi/chi/v5 v5.0.13 h1:JlH2F2M8qnwl0N1+JFFzlX9TlKJYas3aPXdiuTmJL+w= -github.com/go-chi/chi/v5 v5.0.13/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= +github.com/go-chi/chi/v5 v5.0.14 h1:PyEwo2Vudraa0x/Wl6eDRRW2NXBvekgfxyydcM0WGE0= +github.com/go-chi/chi/v5 v5.0.14/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= github.com/go-jose/go-jose/v4 v4.0.2 h1:R3l3kkBds16bO7ZFAEEcofK0MkrAJt3jlJznWZG0nvk= github.com/go-jose/go-jose/v4 v4.0.2/go.mod h1:WVf9LFMHh/QVrmqrOfqun0C45tMe3RoiKJMPvgWwLfY= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= From 7164119d42b5d8ab9d1bbc3813e7200f37acd5c7 Mon Sep 17 00:00:00 2001 From: oseoin Date: Mon, 24 Jun 2024 15:07:48 +0100 Subject: [PATCH 10/37] Forked workflow build (#5835) --- .github/workflows/build-oss.yml | 1 + .github/workflows/build-plus.yml | 1 + .github/workflows/ci.yml | 6 +++--- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-oss.yml b/.github/workflows/build-oss.yml index afde1eb656..2fddf9d092 100644 --- a/.github/workflows/build-oss.yml +++ b/.github/workflows/build-oss.yml @@ -56,6 +56,7 @@ jobs: uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 with: ref: ${{ inputs.branch }} + fetch-depth: 0 - name: Authenticate to Google Cloud id: auth diff --git a/.github/workflows/build-plus.yml b/.github/workflows/build-plus.yml index 86c8b912b9..e271a77bab 100644 --- a/.github/workflows/build-plus.yml +++ b/.github/workflows/build-plus.yml @@ -57,6 +57,7 @@ jobs: uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 with: ref: ${{ inputs.branch }} + fetch-depth: 0 - name: Authenticate to Google Cloud id: auth diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dfda4599cb..6687f0273e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -302,7 +302,7 @@ jobs: authenticated: ${{ needs.checks.outputs.forked_workflow != 'true' }} full-build: ${{ inputs.force && inputs.force || false }} tag: ${{ needs.checks.outputs.build_tag }} - branch: ${{ github.head_ref && github.head_ref || github.ref }} + branch: ${{ (github.head_ref && needs.checks.outputs.forked_workflow != 'true') && github.head_ref || github.ref }} permissions: contents: read actions: read @@ -325,7 +325,7 @@ jobs: target: ${{ matrix.target }} go-md5: ${{ needs.checks.outputs.go_code_md5 }} base-image-md5: ${{ needs.checks.outputs.docker_md5 }} - branch: ${{ github.head_ref && github.head_ref || github.ref }} + branch: ${{ (github.head_ref && needs.checks.outputs.forked_workflow != 'true') && github.head_ref || github.ref }} tag: ${{ needs.checks.outputs.build_tag }} authenticated: ${{ needs.checks.outputs.forked_workflow != 'true' }} full-build: ${{ inputs.force && inputs.force || false }} @@ -349,7 +349,7 @@ jobs: target: ${{ matrix.target }} go-md5: ${{ needs.checks.outputs.go_code_md5 }} base-image-md5: ${{ needs.checks.outputs.docker_md5 }} - branch: ${{ github.head_ref && github.head_ref || github.ref }} + branch: ${{ (github.head_ref && needs.checks.outputs.forked_workflow != 'true') && github.head_ref || github.ref }} tag: ${{ needs.checks.outputs.build_tag }} nap-modules: ${{ matrix.nap_modules }} authenticated: ${{ needs.checks.outputs.forked_workflow != 'true' }} From f31bb5cc43544508cfb2fc333711b85406180a20 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Jun 2024 14:54:15 +0000 Subject: [PATCH 11/37] Bump the actions group across 1 directory with 5 updates (#5825) Bumps the actions group with 5 updates in the / directory: | Package | From | To | | --- | --- | --- | | [actions/checkout](https://github.com/actions/checkout) | `4.1.6` | `4.1.7` | | [docker/build-push-action](https://github.com/docker/build-push-action) | `6.0.2` | `6.1.0` | | [github/codeql-action](https://github.com/github/codeql-action) | `3.24.7` | `3.25.10` | | [reviewdog/action-actionlint](https://github.com/reviewdog/action-actionlint) | `1.50.0` | `1.51.0` | | [nginxinc/aws-marketplace-publish](https://github.com/nginxinc/aws-marketplace-publish) | `1.0.3` | `1.0.4` | Updates `actions/checkout` from 4.1.6 to 4.1.7 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v4.1.6...692973e3d937129bcbf40652eb9f2f61becf3332) Updates `docker/build-push-action` from 6.0.2 to 6.1.0 - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](https://github.com/docker/build-push-action/compare/f6010ea70151369b06f0194be1051fbbdff851b2...31159d49c0d4756269a0940a750801a1ea5d7003) Updates `github/codeql-action` from 3.24.7 to 3.25.10 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/v3.24.7...23acc5c183826b7a8a97bce3cecc52db901f8251) Updates `reviewdog/action-actionlint` from 1.50.0 to 1.51.0 - [Release notes](https://github.com/reviewdog/action-actionlint/releases) - [Commits](https://github.com/reviewdog/action-actionlint/compare/2927e858b45218240af952feb1d702cf6365f39a...afad3b6ab835e5611bda8c8193377e2d5c21413d) Updates `nginxinc/aws-marketplace-publish` from 1.0.3 to 1.0.4 - [Release notes](https://github.com/nginxinc/aws-marketplace-publish/releases) - [Commits](https://github.com/nginxinc/aws-marketplace-publish/compare/be512a7ae9666098bc4429a1afa27a11be6a3995...9f178512e8e7658fe4aab73d1dac15f3f86fb7b4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: docker/build-push-action dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: reviewdog/action-actionlint dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: nginxinc/aws-marketplace-publish dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jakub Jarosz <99677300+jjngx@users.noreply.github.com> Co-authored-by: Venktesh Shivam Patel Co-authored-by: Paul Abel <128620221+pdabelf5@users.noreply.github.com> Co-authored-by: oseoin --- .github/workflows/build-base-images.yml | 6 +++--- .github/workflows/build-oss.yml | 4 ++-- .github/workflows/build-plus.yml | 4 ++-- .github/workflows/build-test-image.yml | 2 +- .github/workflows/ci.yml | 4 ++-- .github/workflows/image-promotion.yml | 6 +++--- .github/workflows/lint-format.yml | 2 +- .github/workflows/patch-image.yml | 2 +- .github/workflows/regression.yml | 8 ++++---- .github/workflows/release.yml | 2 +- .github/workflows/setup-smoke.yml | 4 ++-- 11 files changed, 22 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build-base-images.yml b/.github/workflows/build-base-images.yml index 1490969a10..a19a86772d 100644 --- a/.github/workflows/build-base-images.yml +++ b/.github/workflows/build-base-images.yml @@ -92,7 +92,7 @@ jobs: type=raw,value=${{ needs.checks.outputs.docker_md5 }},enable=${{ needs.checks.outputs.docker_md5 != '' }} - name: Build Base Container - uses: docker/build-push-action@f6010ea70151369b06f0194be1051fbbdff851b2 # v6.0.2 + uses: docker/build-push-action@31159d49c0d4756269a0940a750801a1ea5d7003 # v6.1.0 with: file: build/Dockerfile context: "." @@ -156,7 +156,7 @@ jobs: type=raw,value=${{ needs.checks.outputs.docker_md5 }},enable=${{ needs.checks.outputs.docker_md5 != '' }} - name: Build Base Container - uses: docker/build-push-action@f6010ea70151369b06f0194be1051fbbdff851b2 # v6.0.2 + uses: docker/build-push-action@31159d49c0d4756269a0940a750801a1ea5d7003 # v6.1.0 with: file: build/Dockerfile context: "." @@ -225,7 +225,7 @@ jobs: type=raw,value=${{ needs.checks.outputs.docker_md5 }},enable=${{ needs.checks.outputs.docker_md5 != '' }} - name: Build Base Container - uses: docker/build-push-action@f6010ea70151369b06f0194be1051fbbdff851b2 # v6.0.2 + uses: docker/build-push-action@31159d49c0d4756269a0940a750801a1ea5d7003 # v6.1.0 with: file: build/Dockerfile context: "." diff --git a/.github/workflows/build-oss.yml b/.github/workflows/build-oss.yml index 2fddf9d092..80c998bb4b 100644 --- a/.github/workflows/build-oss.yml +++ b/.github/workflows/build-oss.yml @@ -120,7 +120,7 @@ jobs: if: ${{ steps.images_exist.outputs.target_exists != 'true' }} - name: Build Base Container - uses: docker/build-push-action@f6010ea70151369b06f0194be1051fbbdff851b2 # v6.0.2 + uses: docker/build-push-action@31159d49c0d4756269a0940a750801a1ea5d7003 # v6.1.0 with: file: build/Dockerfile context: "." @@ -152,7 +152,7 @@ jobs: if: ${{ steps.images_exist.outputs.base_exists != 'true' || steps.images_exist.outputs.target_exists != 'true' }} - name: Build Docker image - uses: docker/build-push-action@f6010ea70151369b06f0194be1051fbbdff851b2 # v6.0.2 + uses: docker/build-push-action@31159d49c0d4756269a0940a750801a1ea5d7003 # v6.1.0 id: build-push with: file: build/Dockerfile diff --git a/.github/workflows/build-plus.yml b/.github/workflows/build-plus.yml index e271a77bab..638ec738e2 100644 --- a/.github/workflows/build-plus.yml +++ b/.github/workflows/build-plus.yml @@ -124,7 +124,7 @@ jobs: if: ${{ steps.images_exist.outputs.target_exists != 'true' }} - name: Build Base Container - uses: docker/build-push-action@f6010ea70151369b06f0194be1051fbbdff851b2 # v6.0.2 + uses: docker/build-push-action@31159d49c0d4756269a0940a750801a1ea5d7003 # v6.1.0 with: file: build/Dockerfile context: "." @@ -161,7 +161,7 @@ jobs: if: ${{ steps.images_exist.outputs.base_exists != 'true' || steps.images_exist.outputs.target_exists != 'true' }} - name: Build Docker image - uses: docker/build-push-action@f6010ea70151369b06f0194be1051fbbdff851b2 # v6.0.2 + uses: docker/build-push-action@31159d49c0d4756269a0940a750801a1ea5d7003 # v6.1.0 id: build-push with: file: build/Dockerfile diff --git a/.github/workflows/build-test-image.yml b/.github/workflows/build-test-image.yml index e51a9ad662..d3fbab8bcd 100644 --- a/.github/workflows/build-test-image.yml +++ b/.github/workflows/build-test-image.yml @@ -49,7 +49,7 @@ jobs: password: ${{ steps.auth.outputs.access_token }} - name: Build Test-Runner Container - uses: docker/build-push-action@f6010ea70151369b06f0194be1051fbbdff851b2 # v6.0.2 + uses: docker/build-push-action@31159d49c0d4756269a0940a750801a1ea5d7003 # v6.1.0 with: file: tests/Dockerfile context: "." diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6687f0273e..cc2fc330f6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -441,7 +441,7 @@ jobs: if: ${{ needs.checks.outputs.forked_workflow == 'true' && needs.checks.outputs.docs_only == 'false' }} - name: Build Docker Image ${{ matrix.base-os }} - uses: docker/build-push-action@f6010ea70151369b06f0194be1051fbbdff851b2 # v6.0.2 + uses: docker/build-push-action@31159d49c0d4756269a0940a750801a1ea5d7003 # v6.1.0 with: file: build/Dockerfile context: "." @@ -559,7 +559,7 @@ jobs: if: ${{ needs.checks.outputs.forked_workflow == 'false' && needs.checks.outputs.docs_only == 'false' }} - name: Build Test-Runner Container - uses: docker/build-push-action@f6010ea70151369b06f0194be1051fbbdff851b2 # v6.0.2 + uses: docker/build-push-action@31159d49c0d4756269a0940a750801a1ea5d7003 # v6.1.0 with: file: tests/Dockerfile context: "." diff --git a/.github/workflows/image-promotion.yml b/.github/workflows/image-promotion.yml index 43476412d7..1ae86669e6 100644 --- a/.github/workflows/image-promotion.yml +++ b/.github/workflows/image-promotion.yml @@ -427,7 +427,7 @@ jobs: overwrite: true - name: Upload Scan results to GitHub Security tab - uses: github/codeql-action/upload-sarif@3ab4101902695724f9365a384f86c1074d94e18c # v3.24.7 + uses: github/codeql-action/upload-sarif@23acc5c183826b7a8a97bce3cecc52db901f8251 # v3.25.10 with: sarif_file: "${{ steps.directory.outputs.directory }}/" @@ -517,7 +517,7 @@ jobs: overwrite: true - name: Upload Scan results to GitHub Security tab - uses: github/codeql-action/upload-sarif@3ab4101902695724f9365a384f86c1074d94e18c # v3.24.7 + uses: github/codeql-action/upload-sarif@23acc5c183826b7a8a97bce3cecc52db901f8251 # v3.25.10 with: sarif_file: "${{ steps.directory.outputs.directory }}/" @@ -607,6 +607,6 @@ jobs: overwrite: true - name: Upload Scan results to GitHub Security tab - uses: github/codeql-action/upload-sarif@3ab4101902695724f9365a384f86c1074d94e18c # v3.24.7 + uses: github/codeql-action/upload-sarif@23acc5c183826b7a8a97bce3cecc52db901f8251 # v3.25.10 with: sarif_file: "${{ steps.directory.outputs.directory }}/" diff --git a/.github/workflows/lint-format.yml b/.github/workflows/lint-format.yml index a3bea5f7c3..8cb01057e0 100644 --- a/.github/workflows/lint-format.yml +++ b/.github/workflows/lint-format.yml @@ -63,7 +63,7 @@ jobs: - name: Checkout Repository uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - uses: reviewdog/action-actionlint@2927e858b45218240af952feb1d702cf6365f39a # v1.50.0 + - uses: reviewdog/action-actionlint@afad3b6ab835e5611bda8c8193377e2d5c21413d # v1.51.0 with: actionlint_flags: -shellcheck "" diff --git a/.github/workflows/patch-image.yml b/.github/workflows/patch-image.yml index de4d8467ef..d110b229da 100644 --- a/.github/workflows/patch-image.yml +++ b/.github/workflows/patch-image.yml @@ -70,7 +70,7 @@ jobs: password: ${{ steps.auth.outputs.access_token }} - name: Apply OS patches to Container - uses: docker/build-push-action@f6010ea70151369b06f0194be1051fbbdff851b2 # v6.0.2 + uses: docker/build-push-action@31159d49c0d4756269a0940a750801a1ea5d7003 # v6.1.0 with: file: build/Dockerfile context: "." diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index 34782a4232..19038d92aa 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -36,7 +36,7 @@ jobs: branch: ${{ steps.vars.outputs.branch }} steps: - name: Checkout Repository - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 with: ref: ${{ inputs.branch && inputs.branch || github.event.repository.default_branch }} @@ -101,7 +101,7 @@ jobs: id-token: write steps: - name: Checkout Repository - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 with: ref: ${{ needs.checks.outputs.branch }} @@ -180,7 +180,7 @@ jobs: matrix: ${{ steps.set-matrix.outputs.matrix }} steps: - name: Checkout Repository - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 with: ref: ${{ needs.checks.outputs.branch }} @@ -200,7 +200,7 @@ jobs: id-token: write steps: - name: Checkout Repository - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 with: ref: ${{ needs.checks.outputs.branch }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f2a2e99601..3a55fa1d53 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -275,7 +275,7 @@ jobs: ref: ${{ inputs.release_branch }} - name: Publish to AWS Marketplace - uses: nginxinc/aws-marketplace-publish@be512a7ae9666098bc4429a1afa27a11be6a3995 # v1.0.3 + uses: nginxinc/aws-marketplace-publish@9f178512e8e7658fe4aab73d1dac15f3f86fb7b4 # v1.0.4 continue-on-error: true with: version: ${{ inputs.nic_version }} diff --git a/.github/workflows/setup-smoke.yml b/.github/workflows/setup-smoke.yml index 229cb79efa..4d4855e97d 100644 --- a/.github/workflows/setup-smoke.yml +++ b/.github/workflows/setup-smoke.yml @@ -112,7 +112,7 @@ jobs: if: ${{ inputs.authenticated }} - name: Build Test-Runner Container - uses: docker/build-push-action@f6010ea70151369b06f0194be1051fbbdff851b2 # v6.0.2 + uses: docker/build-push-action@31159d49c0d4756269a0940a750801a1ea5d7003 # v6.1.0 with: file: tests/Dockerfile context: "." @@ -124,7 +124,7 @@ jobs: if: ${{ ( !inputs.authenticated || steps.check-image.outcome == 'failure' ) }} - name: Build ${{ inputs.image }} Container - uses: docker/build-push-action@f6010ea70151369b06f0194be1051fbbdff851b2 # v6.0.2 + uses: docker/build-push-action@31159d49c0d4756269a0940a750801a1ea5d7003 # v6.1.0 with: file: build/Dockerfile context: "." From b9f41901ecc833d8d313d14c95e5b1b83e6bb23b Mon Sep 17 00:00:00 2001 From: Paul Abel <128620221+pdabelf5@users.noreply.github.com> Date: Tue, 25 Jun 2024 08:54:40 +0100 Subject: [PATCH 12/37] Add actionlint pre commit plugin (#5839) --- .github/workflows/build-oss.yml | 1 - .github/workflows/ci.yml | 5 +---- .pre-commit-config.yaml | 12 ++++++++++++ 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-oss.yml b/.github/workflows/build-oss.yml index 80c998bb4b..f155469d6a 100644 --- a/.github/workflows/build-oss.yml +++ b/.github/workflows/build-oss.yml @@ -44,7 +44,6 @@ jobs: runs-on: ubuntu-22.04 permissions: contents: read # for docker/build-push-action to read repo content - security-events: write # for github/codeql-action/upload-sarif to upload SARIF results id-token: write # for OIDC login to GCR packages: write # for docker/build-push-action to push to GHCR pull-requests: write # for scout report diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cc2fc330f6..fdd6cdba4f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -306,7 +306,6 @@ jobs: permissions: contents: read actions: read - security-events: write id-token: write packages: write pull-requests: write # for scout report @@ -331,7 +330,6 @@ jobs: full-build: ${{ inputs.force && inputs.force || false }} permissions: contents: read - security-events: write id-token: write pull-requests: write # for scout report secrets: inherit @@ -356,8 +354,7 @@ jobs: full-build: ${{ inputs.force && inputs.force || false }} permissions: contents: read - security-events: write - id-token: write + id-token: write # gcr login pull-requests: write # for scout report secrets: inherit diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 829e8a3dfd..612316ee66 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -77,5 +77,17 @@ repos: hooks: - id: markdownlint-cli2 + - repo: https://github.com/rhysd/actionlint + rev: v1.7.1 + hooks: + - id: actionlint + name: Lint GitHub Actions workflow files + description: Runs actionlint to lint GitHub Actions workflow files + language: golang + types: ["yaml"] + files: ^\.github/workflows/ + entry: actionlint + args: ["-shellcheck",""] + ci: skip: [golang-diff, golangci-lint, check-jsonschema, markdownlint-cli2] From a37af7395b31490383c0759b4e4a2f5fa5e82fe2 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 25 Jun 2024 09:08:41 +0100 Subject: [PATCH 13/37] [pre-commit.ci] pre-commit autoupdate (#5841) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 612316ee66..ac364e6dc1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -64,7 +64,7 @@ repos: - id: black - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.28.5 + rev: 0.28.6 hooks: - id: check-jsonschema name: "Check Helm Chart JSON Schema" From 7f2e66c9a7451aa74b4692ba1b5adb900951e022 Mon Sep 17 00:00:00 2001 From: Jakub Jarosz <99677300+jjngx@users.noreply.github.com> Date: Tue, 25 Jun 2024 10:00:45 +0100 Subject: [PATCH 14/37] WAF v5 docs update (#5719) --- .../building-nginx-ingress-controller.md | 3 + .../integrations/app-protect-dos/_index.md | 2 +- .../integrations/app-protect-waf-v5/_index.md | 8 + .../app-protect-waf-v5/configuration.md | 184 +++++++++ .../app-protect-waf-v5/installation.md | 349 ++++++++++++++++++ .../troubleshooting-app-protect-waf.md | 30 +- .../integrations/f5-ingresslink.md | 2 +- .../installation/integrations/opentracing.md | 2 +- .../pulling-ingress-controller-image.md | 32 ++ docs/content/overview/about.md | 2 +- docs/go.mod | 2 +- docs/go.sum | 6 +- .../service-insight/README.md | 4 +- 13 files changed, 601 insertions(+), 25 deletions(-) create mode 100644 docs/content/installation/integrations/app-protect-waf-v5/_index.md create mode 100644 docs/content/installation/integrations/app-protect-waf-v5/configuration.md create mode 100644 docs/content/installation/integrations/app-protect-waf-v5/installation.md diff --git a/docs/content/installation/building-nginx-ingress-controller.md b/docs/content/installation/building-nginx-ingress-controller.md index 09160100ba..5adfd012de 100644 --- a/docs/content/installation/building-nginx-ingress-controller.md +++ b/docs/content/installation/building-nginx-ingress-controller.md @@ -143,14 +143,17 @@ Key targets include: | _alpine-image_ | Builds an Alpine-based image with NGINX. | | _alpine-image-plus_ | Builds an Alpine-based image with NGINX Plus. | | _alpine-image-plus-fips_ | Builds an Alpine-based image with NGINX Plus and FIPS. | +| _alpine-image-nap-v5-plus-fips_ | Builds an Alpine-based image with NGINX Plus, the [NGINX App Protect WAF v5](/nginx-app-protect/) module and FIPS. | | _debian-image_ | Builds a Debian-based image with NGINX. | | _debian-image-plus_ | Builds a Debian-based image with NGINX Plus. | | _debian-image-nap-plus_ | Builds a Debian-based image with NGINX Plus and the [NGINX App Protect WAF](/nginx-app-protect/) module. | +| _debian-image-nap-v5-plus_ | Builds a Debian-based image with NGINX Plus and the [NGINX App Protect WAF v5](/nginx-app-protect/) module. | | _debian-image-dos-plus_ | Builds a Debian-based image with NGINX Plus and the [NGINX App Protect DoS](/nginx-app-protect-dos/) module. | | _debian-image-nap-dos-plus_ | Builds a Debian-based image with NGINX Plus, [NGINX App Protect WAF](/nginx-app-protect/) and [NGINX App Protect DoS](/nginx-app-protect-dos/) modules. | | _ubi-image_ | Builds a UBI-based image with NGINX for [OpenShift](https://www.openshift.com/) clusters. | | _ubi-image-plus_ | Builds a UBI-based image with NGINX Plus for [OpenShift](https://www.openshift.com/) clusters. | | _ubi-image-nap-plus_ | Builds a UBI-based image with NGINX Plus and the [NGINX App Protect WAF](/nginx-app-protect/) module for [OpenShift](https://www.openshift.com/) clusters. | +| _ubi-image-nap-v5-plus_ | Builds a UBI-based image with NGINX Plus and the [NGINX App Protect WAF v5](/nginx-app-protect/) module for [OpenShift](https://www.openshift.com/) clusters. | | _ubi-image-dos-plus_ | Builds a UBI-based image with NGINX Plus and the [NGINX App Protect DoS](/nginx-app-protect-dos/) module for [OpenShift](https://www.openshift.com/) clusters. | | _ubi-image-nap-dos-plus_ |

Builds a UBI-based image with NGINX Plus, [NGINX App Protect WAF](/nginx-app-protect/) and the [NGINX App Protect DoS](/nginx-app-protect-dos/) module for [OpenShift](https://www.openshift.com/) clusters.

**Important**: Save your RHEL organization and activation keys in a file named _rhel_license_ at the project root.

For instance:

RHEL_ORGANIZATION=1111111
RHEL_ACTIVATION_KEY=your-key
| {{}} diff --git a/docs/content/installation/integrations/app-protect-dos/_index.md b/docs/content/installation/integrations/app-protect-dos/_index.md index 2cd1a1fd30..6f26859961 100644 --- a/docs/content/installation/integrations/app-protect-dos/_index.md +++ b/docs/content/installation/integrations/app-protect-dos/_index.md @@ -1,7 +1,7 @@ --- title: NGINX App Protect DoS description: Learn how to use NGINX Ingress Controller for Kubernetes with NGINX App Protect DoS. -weight: 200 +weight: 300 menu: docs: parent: Integrations diff --git a/docs/content/installation/integrations/app-protect-waf-v5/_index.md b/docs/content/installation/integrations/app-protect-waf-v5/_index.md new file mode 100644 index 0000000000..01bf182df7 --- /dev/null +++ b/docs/content/installation/integrations/app-protect-waf-v5/_index.md @@ -0,0 +1,8 @@ +--- +title: NGINX App Protect WAF v5 +description: Learn how to use NGINX Ingress Controller for Kubernetes with NGINX App Protect version 5. +weight: 200 +menu: + docs: + parent: NGINX Ingress Controller +--- diff --git a/docs/content/installation/integrations/app-protect-waf-v5/configuration.md b/docs/content/installation/integrations/app-protect-waf-v5/configuration.md new file mode 100644 index 0000000000..ca6c53ac12 --- /dev/null +++ b/docs/content/installation/integrations/app-protect-waf-v5/configuration.md @@ -0,0 +1,184 @@ +--- +docs: DOCS-000 +title: Configuration +toc: true +weight: 200 +--- + + +## Overview + +This document explains how to use F5 NGINX Ingress Controller to configure [NGINX App Protect WAF v5](https://docs.nginx.com/nginx-app-protect-waf/v5/). + +{{< note >}} Check out the complete NGINX Ingress Controller with NGINX App Protect WAF example resources on GitHub [for VirtualServer resources](https://github.com/nginxinc/kubernetes-ingress/tree/v3.6.0/examples/custom-resources/app-protect-waf-v5) and [for Ingress resources](https://github.com/nginxinc/kubernetes-ingress/tree/v3.6.0/examples/ingress-resources/app-protect-waf-v5).{{< /note >}} + + +## Global Configuration + +NGINX Ingress Controller has global configuration parameters that match those in NGINX App Protect WAF. They are found in the [ConfigMap resource]({{< relref "configuration/global-configuration/configmap-resource.md#modules" >}}): the NGINX App Protect WAF parameters are prefixed with `app-protect*`. + +## Enable NGINX App Protect WAF v5 + +NGINX App Protect WAF can be enabled and configured for custom resources (VirtualServer, VirtualServerRoute) or Ingress resources. + +- For custom resources, you need to create a Policy Custom Resource referencing a policy bundle, then add it to the VirtualServer definition. Additional detail can be found in the [Policy Resource documentation]({{< relref "configuration/policy-resource.md#waf" >}}). +- For Ingress resources, apply the [`app-protect` annotations]({{< relref "configuration/ingress-resources/advanced-configuration-with-annotations.md#app-protect" >}}) to each desired resource. + + + +## NGINX App Protect WAF Bundles {#waf-bundles} + +You define App Protect WAF bundles for VirtualServer custom resources by creating policy bundles and putting them on a mounted volume accessible from NGINX Ingress Controller. + +Before applying a policy, a WAF policy bundle must be created, then copied to a volume mounted to `/etc/app_protect/bundles`. + +{{< note >}} NGINX Ingress Controller supports `securityLogs` for policy bundles. Log bundles must also be copied to a volume mounted to `/etc/app_protect/bundles`. {{< /note >}} + +This example shows how a policy is configured by referencing a generated WAF Policy Bundle: + + +```yaml +apiVersion: k8s.nginx.org/v1 +kind: Policy +metadata: + name: +spec: + waf: + enable: true + apBundle: ".tgz" +``` + +This example shows the same policy as above but with a log bundle used for security log configuration: + + +```yaml +apiVersion: k8s.nginx.org/v1 +kind: Policy +metadata: + name: +spec: + waf: + enable: true + apBundle: ".tgz" + securityLogs: + - enable: true + apLogBundle: ".tgz" + logDest: "syslog:server=syslog-svc.default:514" +``` + +## Configuration in NGINX Plus Ingress Controller using Virtual Server Resource + +This example shows how to deploy NGINX Ingress Controller with NGINX Plus and NGINX App Protect WAF v5, deploy a simple web application, and then configure load balancing and WAF protection for that application using the VirtualServer resource. + +{{< note >}} You can find the files for this example on [GitHub](https://github.com/nginxinc/kubernetes-ingress/tree/v3.6.0/examples/custom-resources/app-protect-waf/app-protect-waf-v5).{{< /note >}} + +## Prerequisites + +1. Follow the installation [instructions]({{< relref "installation/integrations/app-protect-waf-v5/installation.md" >}}) to deploy NGINX Ingress Controller with NGINX Plus and NGINX App Protect WAF version 5. + +2. Save the public IP address of NGINX Ingress Controller into a shell variable: + + ```shell + IC_IP=XXX.YYY.ZZZ.III + ``` + +3. Save the HTTP port of NGINX Ingress Controller into a shell variable: + + ```shell + IC_HTTP_PORT= + ``` + +### Step 1. Deploy a Web Application + +Create the application deployment and service: + + ```shell + kubectl apply -f https://raw.githubusercontent.com/nginxinc/kubernetes-ingress/v3.6.0/examples/custom-resources/app-protect-waf-v5/webapp.yaml + ``` + +### Step 2. Create the Syslog Service + +Create the syslog service and pod for the NGINX App Protect WAF security logs: + + + ```shell + kubectl apply -f https://raw.githubusercontent.com/nginxinc/kubernetes-ingress/v3.6.0/examples/custom-resources/app-protect-waf-v5/syslog.yaml + ``` + +### Step 3 - Deploy the WAF Policy + + +{{< note >}} Configuration settings in the Policy resource enable WAF protection by configuring NGINX App Protect WAF with the log configuration created in the previous step. The policy bundle referenced as `your_policy_bundle_name.tgz` need to be created and placed in the `/etc/app_protect/bundles` volume first.{{}} + +Create and deploy the WAF policy. + + ```shell + kubectl apply -f https://raw.githubusercontent.com/nginxinc/kubernetes-ingress/v3.6.0/examples/custom-resources/app-protect-waf-v5/waf.yaml + ``` + + +### Step 4 - Configure Load Balancing + + +{{< note >}} VirtualServer references the `waf-policy` created in Step 3.{{}} + +1. Create the VirtualServer Resource: + + ```shell + kubectl apply -f https://raw.githubusercontent.com/nginxinc/kubernetes-ingress/v3.6.0/examples/custom-resources/app-protect-waf-v5/virtual-server.yaml + ``` + + +### Step 5 - Test the Application + +To access the application, curl the coffee and the tea services. We'll use the `--resolve` option to set the Host header of a request with `webapp.example.com` + +1. Send a request to the application: + + ```shell + curl --resolve webapp.example.com:$IC_HTTP_PORT:$IC_IP http://webapp.example.com:$IC_HTTP_PORT/ + ``` + + ```shell + Server address: 10.12.0.18:80 + Server name: webapp-7586895968-r26zn + ``` + +1. Try to send a request with a suspicious URL: + + ```shell + curl --resolve webapp.example.com:$IC_HTTP_PORT:$IC_IP "http://webapp.example.com:$IC_HTTP_PORT/