From ff784a422c888b626fde3371469e39756d47baac Mon Sep 17 00:00:00 2001 From: aswin-in-philips Date: Tue, 28 Mar 2023 10:59:23 +0530 Subject: [PATCH 01/44] blackduck test --- .github/workflows/ci.yaml | 460 +++++++++++++++++++------------------- 1 file changed, 230 insertions(+), 230 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d23dd9aa..835fc23a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -13,260 +13,260 @@ on: workflow_dispatch: jobs: - Wokflow-Queue: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: ahmadnassri/action-workflow-queue@v1 - - Init: - needs: [Wokflow-Queue] - runs-on: ubuntu-20.04 - outputs: - Version: ${{ steps.setVariables.outputs.version }} - steps: - - uses: actions/checkout@v2 - with: - token: ${{ secrets.ADMIN_TOKEN }} - - - name: Extract branch name - uses: vazco/github-actions-branch-name@v1 - id: branch - - - name: Bump version - if: github.ref == 'refs/heads/edi-foundation-integration' - id: setVariables - run: | - sudo apt update - sudo apt install bumpversion - bumpversion patch - new_version=`cat VERSION` - echo "New version is: $new_version" - echo "version=$new_version" >> $GITHUB_OUTPUT - git config --global user.name "CI Build" - git config --global user.email "ci.build@philips.com" - git commit -am "Bump version $new_version" - git push --force - - unit-test: - needs: [Init] - env: - COVER: true - runs-on: ubuntu-20.04 - steps: - - - name: Check out code - uses: actions/checkout@v2 - - - name: Set up Go 1.16 - uses: actions/setup-go@v2 - with: - go-version: 1.16.x - id: go - - - name: Get dependencies - run: | - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.36.0 - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter - chmod +x ./cc-test-reporter - - - name: Verify Code Generation - run: | - make verify-generate - - - name: Lint - run: | - make lint - - - name: Build - run: | - make build - - - name: Test - env: - CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} - run: | - ./.github/workflows/test.sh - - # Blackduck: - # needs: [Init] - # runs-on: builder_blr + # Wokflow-Queue: + # runs-on: ubuntu-latest # steps: - # - name: checkout - # uses: actions/checkout@v2 + # - uses: actions/checkout@v2 + # - uses: ahmadnassri/action-workflow-queue@v1 + + # Init: + # needs: [Wokflow-Queue] + # runs-on: ubuntu-20.04 + # outputs: + # Version: ${{ steps.setVariables.outputs.version }} + # steps: + # - uses: actions/checkout@v2 + # with: + # token: ${{ secrets.ADMIN_TOKEN }} - # - name: blackduck scan - # run: powershell -ExecutionPolicy RemoteSigned -NoExit -File ${{ github.workspace }}\Build\PS\Invoke-BlackduckDetect.ps1 -SourcePath ${{ github.workspace }} -ApiToken ${{ secrets.BLACKDUCK_TOKEN }} - - Fortify: - needs: [Init] + # - name: Extract branch name + # uses: vazco/github-actions-branch-name@v1 + # id: branch + + # - name: Bump version + # if: github.ref == 'refs/heads/edi-foundation-integration' + # id: setVariables + # run: | + # sudo apt update + # sudo apt install bumpversion + # bumpversion patch + # new_version=`cat VERSION` + # echo "New version is: $new_version" + # echo "version=$new_version" >> $GITHUB_OUTPUT + # git config --global user.name "CI Build" + # git config --global user.email "ci.build@philips.com" + # git commit -am "Bump version $new_version" + # git push --force + + # unit-test: + # needs: [Init] + # env: + # COVER: true + # runs-on: ubuntu-20.04 + # steps: + + # - name: Check out code + # uses: actions/checkout@v2 + + # - name: Set up Go 1.16 + # uses: actions/setup-go@v2 + # with: + # go-version: 1.16.x + # id: go + + # - name: Get dependencies + # run: | + # curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.36.0 + # curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter + # chmod +x ./cc-test-reporter + + # - name: Verify Code Generation + # run: | + # make verify-generate + + # - name: Lint + # run: | + # make lint + + # - name: Build + # run: | + # make build + + # - name: Test + # env: + # CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} + # run: | + # ./.github/workflows/test.sh + + Blackduck: + #needs: [Init] runs-on: builder_blr_2 steps: - name: checkout uses: actions/checkout@v2 - - - name: Fortify scan - run: powershell -ExecutionPolicy RemoteSigned -NoExit -File ${{ github.workspace }}\build\ps\Invoke-FortifyScan.ps1 -PublishAuthToken ${{ secrets.FORTIFY_TOKEN }} - - CodeAnalysis: - runs-on: builder_blr - needs: [Init] - steps: - - uses: actions/checkout@v2 - - name: Set up Go 1.16 - uses: actions/setup-go@v2 - with: - go-version: 1.16.x - id: go + - name: blackduck scan + run: java -jar C:/blackduck/blackduck/synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.source.path=${{ github.workspace }} --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --blackduck.trust.cert=true --blackduck.api.token=${{ secrets.BLACKDUCK_TOKEN }} --detect.tools.excluded=BINARY_SCAN + + # Fortify: + # needs: [Init] + # runs-on: builder_blr_2 + # steps: + # - name: checkout + # uses: actions/checkout@v2 + + # - name: Fortify scan + # run: powershell -ExecutionPolicy RemoteSigned -NoExit -File ${{ github.workspace }}\build\ps\Invoke-FortifyScan.ps1 -PublishAuthToken ${{ secrets.FORTIFY_TOKEN }} + + # CodeAnalysis: + # runs-on: builder_blr + # needs: [Init] + # steps: + # - uses: actions/checkout@v2 - - name: coverage - run: | - go test -coverprofile=${{ github.workspace }}\coverage.out + # - name: Set up Go 1.16 + # uses: actions/setup-go@v2 + # with: + # go-version: 1.16.x + # id: go + + # - name: coverage + # run: | + # go test -coverprofile=${{ github.workspace }}\coverage.out - - name: sonar - run: | - D:\SonarQube\Sonar-Scanner\sonar-scanner-cli-4.4.0.2170-windows\sonar-scanner-4.4.0.2170-windows\bin\sonar-scanner.bat -D"sonar.projectKey=EDI-hds-oauth2-proxy" -D"sonar.sources=." -D"sonar.tests=." -D"sonar.go.coverage.reportPaths=${{ github.workspace }}\coverage.out" -D"sonar.host.url=https://sonarqube.ta.philips.com/" -D"sonar.login=${{ secrets.SONAR_TOKEN }}" + # - name: sonar + # run: | + # D:\SonarQube\Sonar-Scanner\sonar-scanner-cli-4.4.0.2170-windows\sonar-scanner-4.4.0.2170-windows\bin\sonar-scanner.bat -D"sonar.projectKey=EDI-hds-oauth2-proxy" -D"sonar.sources=." -D"sonar.tests=." -D"sonar.go.coverage.reportPaths=${{ github.workspace }}\coverage.out" -D"sonar.host.url=https://sonarqube.ta.philips.com/" -D"sonar.login=${{ secrets.SONAR_TOKEN }}" - Build: - needs: [Init] - runs-on: ubuntu-20.04 - outputs: - oauth2proxyPRTag: ${{ steps.setVariables.outputs.prTag }} - oauth2proxyCITag: ${{ steps.setVariables.outputs.betaTag }} - steps: - - uses: actions/checkout@v2 + # Build: + # needs: [Init] + # runs-on: ubuntu-20.04 + # outputs: + # oauth2proxyPRTag: ${{ steps.setVariables.outputs.prTag }} + # oauth2proxyCITag: ${{ steps.setVariables.outputs.betaTag }} + # steps: + # - uses: actions/checkout@v2 - - name: Import Secrets - id: secrets - uses: hashicorp/vault-action@v2.3.1 - with: - url: ${{ secrets.VAULT_HOST }} - method: approle - roleId: ${{ secrets.VAULT_ROLE_ID }} - secretId: ${{ secrets.VAULT_SECRET_ID }} - exportEnv: true - secrets: | - devops/data/docker-repos/hsdp-edi endPoint | HSDP_DOCKER_REGISTRY ; - devops/data/docker-repos/hsdp-edi user | HSDP_DOCKER_USER ; - devops/data/docker-repos/hsdp-edi password | HSDP_DOCKER_PASSWORD ; - devops/data/github/users/sal-devops token | GITHUB_TOKEN ; + # - name: Import Secrets + # id: secrets + # uses: hashicorp/vault-action@v2.3.1 + # with: + # url: ${{ secrets.VAULT_HOST }} + # method: approle + # roleId: ${{ secrets.VAULT_ROLE_ID }} + # secretId: ${{ secrets.VAULT_SECRET_ID }} + # exportEnv: true + # secrets: | + # devops/data/docker-repos/hsdp-edi endPoint | HSDP_DOCKER_REGISTRY ; + # devops/data/docker-repos/hsdp-edi user | HSDP_DOCKER_USER ; + # devops/data/docker-repos/hsdp-edi password | HSDP_DOCKER_PASSWORD ; + # devops/data/github/users/sal-devops token | GITHUB_TOKEN ; - - name: Extract branch name - uses: vazco/github-actions-branch-name@v1 - id: branch + # - name: Extract branch name + # uses: vazco/github-actions-branch-name@v1 + # id: branch - - name: Set env variables - run: | - new_version=${{ needs.Init.outputs.Version }} - pr_tag="PR-${{ github.run_id }}" - beta_tag="${new_version}-beta" - echo "New version is: $new_version" - echo "VERSION=$new_version" >> "$GITHUB_ENV" - echo "CI_IMAGE=${{ env.HSDP_DOCKER_REGISTRY }}/edi-foundation-oauth2-proxy:${beta_tag}" >> "$GITHUB_ENV" - echo "PR_IMAGE=${{ env.HSDP_DOCKER_REGISTRY }}/edi-foundation-oauth2-proxy:${pr_tag}" >> "$GITHUB_ENV" - echo "prTag=${pr_tag}" >> $GITHUB_OUTPUT - echo "betaTag=${beta_tag}" >> $GITHUB_OUTPUT + # - name: Set env variables + # run: | + # new_version=${{ needs.Init.outputs.Version }} + # pr_tag="PR-${{ github.run_id }}" + # beta_tag="${new_version}-beta" + # echo "New version is: $new_version" + # echo "VERSION=$new_version" >> "$GITHUB_ENV" + # echo "CI_IMAGE=${{ env.HSDP_DOCKER_REGISTRY }}/edi-foundation-oauth2-proxy:${beta_tag}" >> "$GITHUB_ENV" + # echo "PR_IMAGE=${{ env.HSDP_DOCKER_REGISTRY }}/edi-foundation-oauth2-proxy:${pr_tag}" >> "$GITHUB_ENV" + # echo "prTag=${pr_tag}" >> $GITHUB_OUTPUT + # echo "betaTag=${beta_tag}" >> $GITHUB_OUTPUT - - name: Docker Build - run: | - make docker + # - name: Docker Build + # run: | + # make docker - - name: Docker login - run: | - docker login --username '${{ secrets.DOCKER_USER }}' --password '${{ secrets.DOCKER_PSWD }}' '${{ secrets.DOCKER_REPO }}' + # - name: Docker login + # run: | + # docker login --username '${{ secrets.DOCKER_USER }}' --password '${{ secrets.DOCKER_PSWD }}' '${{ secrets.DOCKER_REPO }}' - - name: Docker tag - run: | - docker tag '${{ secrets.DOCKER_REPO }}'/oauth2-proxy:latest ${{ env.PR_IMAGE }} + # - name: Docker tag + # run: | + # docker tag '${{ secrets.DOCKER_REPO }}'/oauth2-proxy:latest ${{ env.PR_IMAGE }} - - name: PR Image Docker Push - if: github.event_name == 'pull_request' - run: | - docker push ${{ env.PR_IMAGE }} + # - name: PR Image Docker Push + # if: github.event_name == 'pull_request' + # run: | + # docker push ${{ env.PR_IMAGE }} - - name: Docker Push - if: github.ref == 'refs/heads/edi-foundation-integration' - run: | - docker tag ${{ env.PR_IMAGE }} ${{ env.CI_IMAGE }} - docker push ${{ env.CI_IMAGE }} + # - name: Docker Push + # if: github.ref == 'refs/heads/edi-foundation-integration' + # run: | + # docker tag ${{ env.PR_IMAGE }} ${{ env.CI_IMAGE }} + # docker push ${{ env.CI_IMAGE }} - PR_Deploy_Test_HDS_AUTH_GATEWAY: - if: github.event_name == 'pull_request' - needs: [Build, Fortify, unit-test, CodeAnalysis] - uses: ./.github/workflows/deploy-hds-auth-gateway.yaml - with: - OAUTH2_PROXY_IMAGE: ${{ needs.Build.outputs.envoyPRTag }} - secrets: - VAULT_HOST: ${{ secrets.VAULT_HOST }} - VAULT_ROLE_ID: ${{ secrets.VAULT_ROLE_ID }} - VAULT_SECRET_ID: ${{ secrets.VAULT_SECRET_ID }} + # PR_Deploy_Test_HDS_AUTH_GATEWAY: + # if: github.event_name == 'pull_request' + # needs: [Build, Fortify, unit-test, CodeAnalysis] + # uses: ./.github/workflows/deploy-hds-auth-gateway.yaml + # with: + # OAUTH2_PROXY_IMAGE: ${{ needs.Build.outputs.envoyPRTag }} + # secrets: + # VAULT_HOST: ${{ secrets.VAULT_HOST }} + # VAULT_ROLE_ID: ${{ secrets.VAULT_ROLE_ID }} + # VAULT_SECRET_ID: ${{ secrets.VAULT_SECRET_ID }} - CI_Deploy_Test_HDS_AUTH_GATEWAY: - if: github.ref == 'refs/heads/edi-foundation-integration' - needs: [Build, Fortify, unit-test, CodeAnalysis] - uses: ./.github/workflows/api-gw-integrated-test.yaml - with: - OAUTH2_PROXY_IMAGE: ${{ needs.Build.outputs.envoyCITag }} - secrets: - VAULT_HOST: ${{ secrets.VAULT_HOST }} - VAULT_ROLE_ID: ${{ secrets.VAULT_ROLE_ID }} - VAULT_SECRET_ID: ${{ secrets.VAULT_SECRET_ID }} + # CI_Deploy_Test_HDS_AUTH_GATEWAY: + # if: github.ref == 'refs/heads/edi-foundation-integration' + # needs: [Build, Fortify, unit-test, CodeAnalysis] + # uses: ./.github/workflows/api-gw-integrated-test.yaml + # with: + # OAUTH2_PROXY_IMAGE: ${{ needs.Build.outputs.envoyCITag }} + # secrets: + # VAULT_HOST: ${{ secrets.VAULT_HOST }} + # VAULT_ROLE_ID: ${{ secrets.VAULT_ROLE_ID }} + # VAULT_SECRET_ID: ${{ secrets.VAULT_SECRET_ID }} - Promote_Version: - needs: [CI_Deploy_Test_HDS_AUTH_GATEWAY] - if: github.ref == 'refs/heads/edi-foundation-integration' - runs-on: ubuntu-20.04 - outputs: - versionTag: ${{ steps.setVariables.outputs.versionTag }} - steps: - - uses: actions/checkout@v2 + # Promote_Version: + # needs: [CI_Deploy_Test_HDS_AUTH_GATEWAY] + # if: github.ref == 'refs/heads/edi-foundation-integration' + # runs-on: ubuntu-20.04 + # outputs: + # versionTag: ${{ steps.setVariables.outputs.versionTag }} + # steps: + # - uses: actions/checkout@v2 - - name: Import Secrets - id: secrets - uses: hashicorp/vault-action@v2.3.1 - with: - url: ${{ secrets.VAULT_HOST }} - method: approle - roleId: ${{ secrets.VAULT_ROLE_ID }} - secretId: ${{ secrets.VAULT_SECRET_ID }} - exportEnv: true - secrets: | - devops/data/docker-repos/hsdp-edi endPoint | HSDP_DOCKER_REGISTRY ; - devops/data/docker-repos/hsdp-edi user | HSDP_DOCKER_USER ; - devops/data/docker-repos/hsdp-edi password | HSDP_DOCKER_PASSWORD ; + # - name: Import Secrets + # id: secrets + # uses: hashicorp/vault-action@v2.3.1 + # with: + # url: ${{ secrets.VAULT_HOST }} + # method: approle + # roleId: ${{ secrets.VAULT_ROLE_ID }} + # secretId: ${{ secrets.VAULT_SECRET_ID }} + # exportEnv: true + # secrets: | + # devops/data/docker-repos/hsdp-edi endPoint | HSDP_DOCKER_REGISTRY ; + # devops/data/docker-repos/hsdp-edi user | HSDP_DOCKER_USER ; + # devops/data/docker-repos/hsdp-edi password | HSDP_DOCKER_PASSWORD ; - - name: Set env variables - id: setVariables - run: | - sudo apt update - sudo apt install bumpversion - bumpversion patch - new_version=`cat VERSION` - echo "New version is: $new_version" - echo "CI_IMAGE=${{ env.HSDP_DOCKER_REGISTRY }}/edi-foundation-oauth2-proxy:${new_version}-beta" >> "$GITHUB_ENV" - echo "RC_IMAGE=docker.na1.hsdp.io/edisp-releases/edi-foundation-oauth2-proxy:${new_version}-rc" >> "$GITHUB_ENV" - echo "versionTag=${new_version}-rc" >> $GITHUB_OUTPUT - echo "${new_version}-rc" + # - name: Set env variables + # id: setVariables + # run: | + # sudo apt update + # sudo apt install bumpversion + # bumpversion patch + # new_version=`cat VERSION` + # echo "New version is: $new_version" + # echo "CI_IMAGE=${{ env.HSDP_DOCKER_REGISTRY }}/edi-foundation-oauth2-proxy:${new_version}-beta" >> "$GITHUB_ENV" + # echo "RC_IMAGE=docker.na1.hsdp.io/edisp-releases/edi-foundation-oauth2-proxy:${new_version}-rc" >> "$GITHUB_ENV" + # echo "versionTag=${new_version}-rc" >> $GITHUB_OUTPUT + # echo "${new_version}-rc" - - name: Docker login - run: | - docker login --username '${{ secrets.DOCKER_USER }}' --password '${{ secrets.DOCKER_PSWD }}' '${{ secrets.DOCKER_REPO }}' + # - name: Docker login + # run: | + # docker login --username '${{ secrets.DOCKER_USER }}' --password '${{ secrets.DOCKER_PSWD }}' '${{ secrets.DOCKER_REPO }}' - - name: Docker Push - run: | - docker pull ${{ env.CI_IMAGE }} - docker tag ${{ env.CI_IMAGE }} ${{ env.RC_IMAGE }} - docker push ${{ env.RC_IMAGE }} + # - name: Docker Push + # run: | + # docker pull ${{ env.CI_IMAGE }} + # docker tag ${{ env.CI_IMAGE }} ${{ env.RC_IMAGE }} + # docker push ${{ env.RC_IMAGE }} - Replace_OAuth2_Proxy_Tag_in_Terraform_API_Gateway: - needs: [Promote_Version] - if: github.ref == 'refs/heads/edi-foundation-integration' - uses: ./.github/workflows/update-oauth2-proxy-version-at-api-gw.yaml - with: - OAUTH2_PROXY_IMAGE: ${{ needs.Promote_Version.outputs.versionTag }} - secrets: - VAULT_HOST: ${{ secrets.VAULT_HOST }} - VAULT_ROLE_ID: ${{ secrets.VAULT_ROLE_ID }} - VAULT_SECRET_ID: ${{ secrets.VAULT_SECRET_ID }} + # Replace_OAuth2_Proxy_Tag_in_Terraform_API_Gateway: + # needs: [Promote_Version] + # if: github.ref == 'refs/heads/edi-foundation-integration' + # uses: ./.github/workflows/update-oauth2-proxy-version-at-api-gw.yaml + # with: + # OAUTH2_PROXY_IMAGE: ${{ needs.Promote_Version.outputs.versionTag }} + # secrets: + # VAULT_HOST: ${{ secrets.VAULT_HOST }} + # VAULT_ROLE_ID: ${{ secrets.VAULT_ROLE_ID }} + # VAULT_SECRET_ID: ${{ secrets.VAULT_SECRET_ID }} From f681b83e3363aa666c6206c395cd14c61e3cb467 Mon Sep 17 00:00:00 2001 From: aswin-in-philips Date: Tue, 28 Mar 2023 11:02:38 +0530 Subject: [PATCH 02/44] checking blackduck --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 835fc23a..b1c7c76b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -3,7 +3,7 @@ name: CI on: push: branches: - - 'edi-foundation-integration' + - 'blackduck-image' # - $default-branch paths-ignore: - 'VERSION' From 4b938a9b0f52724ae1b765516c3e008295786680 Mon Sep 17 00:00:00 2001 From: aswin-in-philips Date: Tue, 28 Mar 2023 11:20:53 +0530 Subject: [PATCH 03/44] test --- .github/workflows/ci.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b1c7c76b..3e3bb115 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -94,9 +94,14 @@ jobs: steps: - name: checkout uses: actions/checkout@v2 + + - uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '11' - - name: blackduck scan - run: java -jar C:/blackduck/blackduck/synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.source.path=${{ github.workspace }} --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --blackduck.trust.cert=true --blackduck.api.token=${{ secrets.BLACKDUCK_TOKEN }} --detect.tools.excluded=BINARY_SCAN + # - name: blackduck scan + # run: java -jar C:/blackduck/blackduck/synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.source.path=${{ github.workspace }} --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --blackduck.trust.cert=true --blackduck.api.token=${{ secrets.BLACKDUCK_TOKEN }} --detect.tools.excluded=BINARY_SCAN # Fortify: # needs: [Init] From a408e7a859f19981ac72f08f04dc2e3a3702db74 Mon Sep 17 00:00:00 2001 From: aswin-in-philips Date: Tue, 28 Mar 2023 11:24:47 +0530 Subject: [PATCH 04/44] installing java --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3e3bb115..64087c56 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -97,7 +97,7 @@ jobs: - uses: actions/setup-java@v3 with: - distribution: 'temurin' + distribution: 'zulu' java-version: '11' # - name: blackduck scan From ea9e1e2c80f7df28e77ce0192f7d4ab54fd815f9 Mon Sep 17 00:00:00 2001 From: aswin-in-philips Date: Tue, 28 Mar 2023 11:28:46 +0530 Subject: [PATCH 05/44] java setup --- .github/workflows/ci.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 64087c56..8a73242a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -95,10 +95,12 @@ jobs: - name: checkout uses: actions/checkout@v2 - - uses: actions/setup-java@v3 + - name: 'Set up archived Oracle JDK 11.0.1' + uses: oracle-actions/setup-java@v1 with: - distribution: 'zulu' - java-version: '11' + website: oracle.com + release: 11 + version: 11.0.1 # - name: blackduck scan # run: java -jar C:/blackduck/blackduck/synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.source.path=${{ github.workspace }} --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --blackduck.trust.cert=true --blackduck.api.token=${{ secrets.BLACKDUCK_TOKEN }} --detect.tools.excluded=BINARY_SCAN From 26196b3fccf1cbe2bb7e4421f3c3b3923f8874d8 Mon Sep 17 00:00:00 2001 From: aswin-in-philips Date: Tue, 28 Mar 2023 11:32:19 +0530 Subject: [PATCH 06/44] test --- .github/workflows/ci.yaml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8a73242a..df3319f3 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -94,16 +94,9 @@ jobs: steps: - name: checkout uses: actions/checkout@v2 - - - name: 'Set up archived Oracle JDK 11.0.1' - uses: oracle-actions/setup-java@v1 - with: - website: oracle.com - release: 11 - version: 11.0.1 - # - name: blackduck scan - # run: java -jar C:/blackduck/blackduck/synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.source.path=${{ github.workspace }} --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --blackduck.trust.cert=true --blackduck.api.token=${{ secrets.BLACKDUCK_TOKEN }} --detect.tools.excluded=BINARY_SCAN + - name: blackduck scan + run: C:\Program Files\Eclipse Adoptium\jdk-11.0.18.10-hotspot\bin\java.exe -jar C:/blackduck/blackduck/synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.source.path=${{ github.workspace }} --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --blackduck.trust.cert=true --blackduck.api.token=${{ secrets.BLACKDUCK_TOKEN }} --detect.tools.excluded=BINARY_SCAN # Fortify: # needs: [Init] From e245d75d80a087e558a326a86bcdc8817eb95ef8 Mon Sep 17 00:00:00 2001 From: aswin-in-philips Date: Tue, 28 Mar 2023 11:47:11 +0530 Subject: [PATCH 07/44] test --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index df3319f3..0446fcc0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -96,7 +96,7 @@ jobs: uses: actions/checkout@v2 - name: blackduck scan - run: C:\Program Files\Eclipse Adoptium\jdk-11.0.18.10-hotspot\bin\java.exe -jar C:/blackduck/blackduck/synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.source.path=${{ github.workspace }} --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --blackduck.trust.cert=true --blackduck.api.token=${{ secrets.BLACKDUCK_TOKEN }} --detect.tools.excluded=BINARY_SCAN + run: java.exe -jar C:/blackduck/blackduck/synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.source.path=${{ github.workspace }} --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --blackduck.trust.cert=true --blackduck.api.token=${{ secrets.BLACKDUCK_TOKEN }} --detect.tools.excluded=BINARY_SCAN # Fortify: # needs: [Init] From 87a423834c50041353a2dc16e782cd2993057c2f Mon Sep 17 00:00:00 2001 From: aswin-in-philips Date: Tue, 28 Mar 2023 11:54:50 +0530 Subject: [PATCH 08/44] blackduck test --- .github/workflows/ci.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0446fcc0..68a5ac95 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -96,7 +96,9 @@ jobs: uses: actions/checkout@v2 - name: blackduck scan - run: java.exe -jar C:/blackduck/blackduck/synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.source.path=${{ github.workspace }} --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --blackduck.trust.cert=true --blackduck.api.token=${{ secrets.BLACKDUCK_TOKEN }} --detect.tools.excluded=BINARY_SCAN + run: | + cd C:\Program Files\Eclipse Adoptium\jdk-11.0.18.10-hotspot\bin + java.exe -jar C:/blackduck/blackduck/synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.source.path=${{ github.workspace }} --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --blackduck.trust.cert=true --blackduck.api.token=${{ secrets.BLACKDUCK_TOKEN }} --detect.tools.excluded=BINARY_SCAN # Fortify: # needs: [Init] From dab087ab220ce00fea85d9ba8d3bb1e79efd1cd1 Mon Sep 17 00:00:00 2001 From: aswin-in-philips Date: Tue, 28 Mar 2023 12:15:21 +0530 Subject: [PATCH 09/44] adding java action --- .github/workflows/ci.yaml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 68a5ac95..6e3f41bb 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -94,11 +94,16 @@ jobs: steps: - name: checkout uses: actions/checkout@v2 + + - uses: actions/setup-java@v3 + with: + distribution: 'microsoft' + java-version: '11' - - name: blackduck scan - run: | - cd C:\Program Files\Eclipse Adoptium\jdk-11.0.18.10-hotspot\bin - java.exe -jar C:/blackduck/blackduck/synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.source.path=${{ github.workspace }} --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --blackduck.trust.cert=true --blackduck.api.token=${{ secrets.BLACKDUCK_TOKEN }} --detect.tools.excluded=BINARY_SCAN + # - name: blackduck scan + # run: | + # cd C:\Program Files\Eclipse Adoptium\jdk-11.0.18.10-hotspot\bin + # java.exe -jar C:/blackduck/blackduck/synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.source.path=${{ github.workspace }} --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --blackduck.trust.cert=true --blackduck.api.token=${{ secrets.BLACKDUCK_TOKEN }} --detect.tools.excluded=BINARY_SCAN # Fortify: # needs: [Init] From bb66257a24a6ef6da46dc2aa5c93512ee777fd28 Mon Sep 17 00:00:00 2001 From: aswin-in-philips Date: Tue, 28 Mar 2023 12:26:30 +0530 Subject: [PATCH 10/44] blackduck test --- .github/workflows/ci.yaml | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6e3f41bb..11e1be49 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -95,15 +95,25 @@ jobs: - name: checkout uses: actions/checkout@v2 - - uses: actions/setup-java@v3 - with: - distribution: 'microsoft' - java-version: '11' + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2.4.1 - # - name: blackduck scan - # run: | - # cd C:\Program Files\Eclipse Adoptium\jdk-11.0.18.10-hotspot\bin - # java.exe -jar C:/blackduck/blackduck/synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.source.path=${{ github.workspace }} --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --blackduck.trust.cert=true --blackduck.api.token=${{ secrets.BLACKDUCK_TOKEN }} --detect.tools.excluded=BINARY_SCAN + - name: Scan blackduck + run: | + docker run -v ${{ github.workspace}}:/code \ + philipssoftware/blackduck:8.5 \ + /bin/bash -c \ + "(cd /code && \ + /app/detect.sh \ + --blackduck.url=https://blackduck.philips.com \ + --blackduck.api.token=${{ secrets.BLACKDUCK_TOKEN }} \ + --blackduck.trust.cert=true \ + --detect.policy.check=true \ + --detect.source.path=/code \ + --detect.project.name=SA_edifoundation-oauth2proxy \ + --detect.project.version.name=1.0 \ + --detect.blackduck.signature.scanner.individual.file.matching=ALL \ + --detect.bom.aggregate.name={agregator})" # Fortify: # needs: [Init] From 1095a14cddfea10db7b03023668bd7d07b9a28da Mon Sep 17 00:00:00 2001 From: aswin-in-philips Date: Tue, 28 Mar 2023 12:41:04 +0530 Subject: [PATCH 11/44] updating runner --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 11e1be49..f6cf5e76 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -90,7 +90,7 @@ jobs: Blackduck: #needs: [Init] - runs-on: builder_blr_2 + runs-on: ubuntu-20.04 steps: - name: checkout uses: actions/checkout@v2 From 65dd81dd10a489b1dc472a872406a56f4d57b72b Mon Sep 17 00:00:00 2001 From: aswin-in-philips Date: Tue, 28 Mar 2023 13:50:49 +0530 Subject: [PATCH 12/44] blackduck test --- .github/workflows/ci.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f6cf5e76..48c3b232 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -90,13 +90,11 @@ jobs: Blackduck: #needs: [Init] - runs-on: ubuntu-20.04 + runs-on: builder_blr steps: - name: checkout uses: actions/checkout@v2 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2.4.1 - name: Scan blackduck run: | From 94136258787d96cd1e4505d9beb05d3ce761b6c8 Mon Sep 17 00:00:00 2001 From: aswin-in-philips Date: Tue, 28 Mar 2023 13:57:11 +0530 Subject: [PATCH 13/44] blackduck test --- .github/workflows/ci.yaml | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 48c3b232..e08d9b08 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -98,20 +98,7 @@ jobs: - name: Scan blackduck run: | - docker run -v ${{ github.workspace}}:/code \ - philipssoftware/blackduck:8.5 \ - /bin/bash -c \ - "(cd /code && \ - /app/detect.sh \ - --blackduck.url=https://blackduck.philips.com \ - --blackduck.api.token=${{ secrets.BLACKDUCK_TOKEN }} \ - --blackduck.trust.cert=true \ - --detect.policy.check=true \ - --detect.source.path=/code \ - --detect.project.name=SA_edifoundation-oauth2proxy \ - --detect.project.version.name=1.0 \ - --detect.blackduck.signature.scanner.individual.file.matching=ALL \ - --detect.bom.aggregate.name={agregator})" + docker run -v ${{ github.workspace}}:/code philipssoftware/blackduck:8.5 /bin/bash -c "(cd /code && /app/detect.sh --blackduck.url=https://blackduck.philips.com --blackduck.api.token=${{ secrets.BLACKDUCK_TOKEN }} --blackduck.trust.cert=true --detect.policy.check=true --detect.source.path=/code --detect.project.name=SA_edifoundation-oauth2proxy --detect.project.version.name=1.0 --detect.blackduck.signature.scanner.individual.file.matching=ALL --detect.bom.aggregate.name={agregator})" # Fortify: # needs: [Init] From 45dbb96b94a9ce8af981dc0d24b8a7c4e3c118e6 Mon Sep 17 00:00:00 2001 From: aswin-in-philips Date: Tue, 28 Mar 2023 14:35:40 +0530 Subject: [PATCH 14/44] docker test --- .github/workflows/ci.yaml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e08d9b08..0118bbe8 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -95,10 +95,14 @@ jobs: - name: checkout uses: actions/checkout@v2 - - - name: Scan blackduck + - name: Pull docker Image run: | - docker run -v ${{ github.workspace}}:/code philipssoftware/blackduck:8.5 /bin/bash -c "(cd /code && /app/detect.sh --blackduck.url=https://blackduck.philips.com --blackduck.api.token=${{ secrets.BLACKDUCK_TOKEN }} --blackduck.trust.cert=true --detect.policy.check=true --detect.source.path=/code --detect.project.name=SA_edifoundation-oauth2proxy --detect.project.version.name=1.0 --detect.blackduck.signature.scanner.individual.file.matching=ALL --detect.bom.aggregate.name={agregator})" + docker login docker.na1.hsdp.io --username '${{ secrets.DOCKER_USER }}' --password '${{ secrets.DOCKER_PSWD }}' + docker pull docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:1.0.27-beta + + # - name: Scan blackduck + # run: | + # docker run -v ${{ github.workspace}}:/code philipssoftware/blackduck:8.5 /bin/bash -c "(cd /code && /app/detect.sh --blackduck.url=https://blackduck.philips.com --blackduck.api.token=${{ secrets.BLACKDUCK_TOKEN }} --blackduck.trust.cert=true --detect.policy.check=true --detect.source.path=/code --detect.project.name=SA_edifoundation-oauth2proxy --detect.project.version.name=1.0 --detect.blackduck.signature.scanner.individual.file.matching=ALL --detect.bom.aggregate.name={agregator})" # Fortify: # needs: [Init] From 837d2748eb487de30fc2bb6c91dae046efb27be5 Mon Sep 17 00:00:00 2001 From: aswin-in-philips Date: Tue, 28 Mar 2023 14:41:17 +0530 Subject: [PATCH 15/44] adding blackduck scan --- .github/workflows/ci.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0118bbe8..e4e08cdd 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -100,9 +100,9 @@ jobs: docker login docker.na1.hsdp.io --username '${{ secrets.DOCKER_USER }}' --password '${{ secrets.DOCKER_PSWD }}' docker pull docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:1.0.27-beta - # - name: Scan blackduck - # run: | - # docker run -v ${{ github.workspace}}:/code philipssoftware/blackduck:8.5 /bin/bash -c "(cd /code && /app/detect.sh --blackduck.url=https://blackduck.philips.com --blackduck.api.token=${{ secrets.BLACKDUCK_TOKEN }} --blackduck.trust.cert=true --detect.policy.check=true --detect.source.path=/code --detect.project.name=SA_edifoundation-oauth2proxy --detect.project.version.name=1.0 --detect.blackduck.signature.scanner.individual.file.matching=ALL --detect.bom.aggregate.name={agregator})" + - name: Scan blackduck + run: | + docker run -v ${{ github.workspace}}:/code philipssoftware/blackduck:8.5 /bin/bash -c "(cd /code && /app/detect.sh --detect.project.name=SA_edifoundation-oauth2proxy --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --blackduck.trust.cert=true --blackduck.api.token=${{ secrets.BLACKDUCK_TOKEN }} --detect.tools.excluded=BINARY_SCAN --detect.docker.image=docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:1.0.27-beta)" # Fortify: # needs: [Init] From cb04ec366f8735264344c1e6c865fbc4f85d4b02 Mon Sep 17 00:00:00 2001 From: aswin-in-philips Date: Tue, 28 Mar 2023 14:48:08 +0530 Subject: [PATCH 16/44] blackduck test --- .github/workflows/ci.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e4e08cdd..4b8ebb29 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -95,14 +95,17 @@ jobs: - name: checkout uses: actions/checkout@v2 + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + - name: Pull docker Image run: | docker login docker.na1.hsdp.io --username '${{ secrets.DOCKER_USER }}' --password '${{ secrets.DOCKER_PSWD }}' docker pull docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:1.0.27-beta - - name: Scan blackduck - run: | - docker run -v ${{ github.workspace}}:/code philipssoftware/blackduck:8.5 /bin/bash -c "(cd /code && /app/detect.sh --detect.project.name=SA_edifoundation-oauth2proxy --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --blackduck.trust.cert=true --blackduck.api.token=${{ secrets.BLACKDUCK_TOKEN }} --detect.tools.excluded=BINARY_SCAN --detect.docker.image=docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:1.0.27-beta)" + # Fortify: # needs: [Init] From 4cbf2ca4a9d60943993d34895f0d046e1c3cf8f0 Mon Sep 17 00:00:00 2001 From: aswin-in-philips Date: Tue, 28 Mar 2023 16:02:18 +0530 Subject: [PATCH 17/44] blackduck test --- .github/workflows/ci.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4b8ebb29..18d258d6 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -105,8 +105,11 @@ jobs: docker login docker.na1.hsdp.io --username '${{ secrets.DOCKER_USER }}' --password '${{ secrets.DOCKER_PSWD }}' docker pull docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:1.0.27-beta + - name: Blackduck Image Scan + run: | + java -jar D:\synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --blackduck.trust.cert=true --blackduck.api.token=${{ secrets.BLACKDUCK_TOKEN }} --detect.tools.excluded=BINARY_SCAN --detect.docker.image=docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:1.0.27-beta + - # Fortify: # needs: [Init] # runs-on: builder_blr_2 From a0e6c53c95e0cbdcd11a98a3fa2c94451edbd0b7 Mon Sep 17 00:00:00 2001 From: aswin-in-philips Date: Tue, 28 Mar 2023 16:05:51 +0530 Subject: [PATCH 18/44] blackduck scan fix --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 18d258d6..c8cc2967 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -107,7 +107,7 @@ jobs: - name: Blackduck Image Scan run: | - java -jar D:\synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --blackduck.trust.cert=true --blackduck.api.token=${{ secrets.BLACKDUCK_TOKEN }} --detect.tools.excluded=BINARY_SCAN --detect.docker.image=docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:1.0.27-beta + java -jar D:\synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --blackduck.trust.cert=true --blackduck.api.token=NmNjYmM4ODgtZjc0Ni00NTIwLTk3NDQtMjdiNzU1ZmFiYmE0OjBjNGQyODU1LTU1MDctNDkwMC1hNzI1LTJiZDg3YWZhZjJmMQ== --detect.tools.excluded=BINARY_SCAN --detect.docker.image=docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:1.0.27-beta # Fortify: From 41482702586a44ed9dedc757442a5277c5c8c102 Mon Sep 17 00:00:00 2001 From: aswin-in-philips Date: Tue, 28 Mar 2023 17:34:10 +0530 Subject: [PATCH 19/44] blackduck test --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c8cc2967..a191c054 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -107,7 +107,7 @@ jobs: - name: Blackduck Image Scan run: | - java -jar D:\synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --blackduck.trust.cert=true --blackduck.api.token=NmNjYmM4ODgtZjc0Ni00NTIwLTk3NDQtMjdiNzU1ZmFiYmE0OjBjNGQyODU1LTU1MDctNDkwMC1hNzI1LTJiZDg3YWZhZjJmMQ== --detect.tools.excluded=BINARY_SCAN --detect.docker.image=docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:1.0.27-beta + java -jar D:\synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --blackduck.trust.cert=true --blackduck.api.token=NmNjYmM4ODgtZjc0Ni00NTIwLTk3NDQtMjdiNzU1ZmFiYmE0OjBjNGQyODU1LTU1MDctNDkwMC1hNzI1LTJiZDg3YWZhZjJmMQ== --detect.tools.excluded=BINARY_SCAN --detect.docker.image=docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:1.0.27-beta --detect.blackduck.signature.scanner.local.path="C:\Users\ing07422\blackduck\tools\Black_Duck_Scan_Installation\scan.cli-2022.7.2" # Fortify: From 781c8044ca7cb0cb4f0b4d63aeaa8f7fd24c2f66 Mon Sep 17 00:00:00 2001 From: aswin-in-philips Date: Wed, 29 Mar 2023 09:39:37 +0530 Subject: [PATCH 20/44] blackduck test --- .github/workflows/ci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a191c054..5966c598 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -104,6 +104,7 @@ jobs: run: | docker login docker.na1.hsdp.io --username '${{ secrets.DOCKER_USER }}' --password '${{ secrets.DOCKER_PSWD }}' docker pull docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:1.0.27-beta + - name: Blackduck Image Scan run: | From 37479c277aa13a5edc4fb0e556b9d42e40990fe1 Mon Sep 17 00:00:00 2001 From: aswin-in-philips Date: Wed, 29 Mar 2023 09:46:43 +0530 Subject: [PATCH 21/44] adding go path --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5966c598..ff727a2b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -108,7 +108,7 @@ jobs: - name: Blackduck Image Scan run: | - java -jar D:\synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --blackduck.trust.cert=true --blackduck.api.token=NmNjYmM4ODgtZjc0Ni00NTIwLTk3NDQtMjdiNzU1ZmFiYmE0OjBjNGQyODU1LTU1MDctNDkwMC1hNzI1LTJiZDg3YWZhZjJmMQ== --detect.tools.excluded=BINARY_SCAN --detect.docker.image=docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:1.0.27-beta --detect.blackduck.signature.scanner.local.path="C:\Users\ing07422\blackduck\tools\Black_Duck_Scan_Installation\scan.cli-2022.7.2" + java -jar D:\synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --detect.go.path="C:\Program Files\Go\bin" --blackduck.trust.cert=true --blackduck.api.token=NmNjYmM4ODgtZjc0Ni00NTIwLTk3NDQtMjdiNzU1ZmFiYmE0OjBjNGQyODU1LTU1MDctNDkwMC1hNzI1LTJiZDg3YWZhZjJmMQ== --detect.tools.excluded=BINARY_SCAN --detect.docker.image=docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:1.0.27-beta --detect.blackduck.signature.scanner.local.path="C:\Users\ing07422\blackduck\tools\Black_Duck_Scan_Installation\scan.cli-2022.7.2" # Fortify: From b93b48d2f7368f3af56b53be62894959c7a81fcd Mon Sep 17 00:00:00 2001 From: aswin-in-philips Date: Wed, 29 Mar 2023 09:56:47 +0530 Subject: [PATCH 22/44] blackduck test --- .github/workflows/ci.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ff727a2b..4cebb3c7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -105,7 +105,6 @@ jobs: docker login docker.na1.hsdp.io --username '${{ secrets.DOCKER_USER }}' --password '${{ secrets.DOCKER_PSWD }}' docker pull docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:1.0.27-beta - - name: Blackduck Image Scan run: | java -jar D:\synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --detect.go.path="C:\Program Files\Go\bin" --blackduck.trust.cert=true --blackduck.api.token=NmNjYmM4ODgtZjc0Ni00NTIwLTk3NDQtMjdiNzU1ZmFiYmE0OjBjNGQyODU1LTU1MDctNDkwMC1hNzI1LTJiZDg3YWZhZjJmMQ== --detect.tools.excluded=BINARY_SCAN --detect.docker.image=docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:1.0.27-beta --detect.blackduck.signature.scanner.local.path="C:\Users\ing07422\blackduck\tools\Black_Duck_Scan_Installation\scan.cli-2022.7.2" From a574e9df6b4dc8505ea852d0c38f9e0c2858674a Mon Sep 17 00:00:00 2001 From: aswin-in-philips Date: Wed, 29 Mar 2023 10:14:30 +0530 Subject: [PATCH 23/44] test --- .github/workflows/ci.yaml | 12 +++--------- build/ps/Invoke-BlackDuckDetect.ps1 | 2 +- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4cebb3c7..7acc52f5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -95,19 +95,13 @@ jobs: - name: checkout uses: actions/checkout@v2 - - name: Set up JDK 11 - uses: actions/setup-java@v1 - with: - java-version: 11 - - name: Pull docker Image run: | docker login docker.na1.hsdp.io --username '${{ secrets.DOCKER_USER }}' --password '${{ secrets.DOCKER_PSWD }}' docker pull docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:1.0.27-beta - - - name: Blackduck Image Scan - run: | - java -jar D:\synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --detect.go.path="C:\Program Files\Go\bin" --blackduck.trust.cert=true --blackduck.api.token=NmNjYmM4ODgtZjc0Ni00NTIwLTk3NDQtMjdiNzU1ZmFiYmE0OjBjNGQyODU1LTU1MDctNDkwMC1hNzI1LTJiZDg3YWZhZjJmMQ== --detect.tools.excluded=BINARY_SCAN --detect.docker.image=docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:1.0.27-beta --detect.blackduck.signature.scanner.local.path="C:\Users\ing07422\blackduck\tools\Black_Duck_Scan_Installation\scan.cli-2022.7.2" + + - name: blackduck scan + run: powershell -ExecutionPolicy RemoteSigned -NoExit -File ${{ github.workspace }}\Build\PS\Invoke-BlackduckDetect.ps1 -DockerImage docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:1.0.27-beta -ApiToken ${{ secrets.BLACKDUCK_TOKEN }} # Fortify: diff --git a/build/ps/Invoke-BlackDuckDetect.ps1 b/build/ps/Invoke-BlackDuckDetect.ps1 index 04c541d1..2f6190ee 100644 --- a/build/ps/Invoke-BlackDuckDetect.ps1 +++ b/build/ps/Invoke-BlackDuckDetect.ps1 @@ -1,7 +1,7 @@ param( $ProjectName = "SA_edifoundation-oauth2proxy", $ProjectVersionName = "1.0", - $SourcePath, + $DockerImage, $BlackduckUrl = "https://blackduck.philips.com/", $ApiToken, $ProxyHost = "apac.zscaler.philips.com", From 7c65c05e609dff66a1dfe5b697c2c9b07a774e7e Mon Sep 17 00:00:00 2001 From: aswin-in-philips Date: Wed, 29 Mar 2023 10:28:23 +0530 Subject: [PATCH 24/44] blackduck test --- .github/workflows/ci.yaml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7acc52f5..15225eac 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -95,13 +95,19 @@ jobs: - name: checkout uses: actions/checkout@v2 + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + - name: Pull docker Image run: | docker login docker.na1.hsdp.io --username '${{ secrets.DOCKER_USER }}' --password '${{ secrets.DOCKER_PSWD }}' docker pull docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:1.0.27-beta - - - name: blackduck scan - run: powershell -ExecutionPolicy RemoteSigned -NoExit -File ${{ github.workspace }}\Build\PS\Invoke-BlackduckDetect.ps1 -DockerImage docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:1.0.27-beta -ApiToken ${{ secrets.BLACKDUCK_TOKEN }} + + - name: Blackduck Image Scan + run: | + java -jar D:\synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --detect.go.path="C:\Program Files\Go\bin" --blackduck.trust.cert=true --blackduck.api.token=NmNjYmM4ODgtZjc0Ni00NTIwLTk3NDQtMjdiNzU1ZmFiYmE0OjBjNGQyODU1LTU1MDctNDkwMC1hNzI1LTJiZDg3YWZhZjJmMQ== --blackduck.proxy.host=apac.zscaler.philips.com --blackduck.proxy.port=10015 --blackduck.proxy.ignored.hosts=blackduck.philips.com --detect.tools.excluded=BINARY_SCAN --detect.docker.image=docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:1.0.27-beta --detect.blackduck.signature.scanner.local.path="C:\Users\ing07422\blackduck\tools\Black_Duck_Scan_Installation\scan.cli-2022.7.2" # Fortify: From 29abc70b36304c484184d36af1758f38692f8e84 Mon Sep 17 00:00:00 2001 From: aswin-in-philips Date: Wed, 29 Mar 2023 10:39:28 +0530 Subject: [PATCH 25/44] adding go path file --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 15225eac..a7b7c6ae 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -107,7 +107,7 @@ jobs: - name: Blackduck Image Scan run: | - java -jar D:\synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --detect.go.path="C:\Program Files\Go\bin" --blackduck.trust.cert=true --blackduck.api.token=NmNjYmM4ODgtZjc0Ni00NTIwLTk3NDQtMjdiNzU1ZmFiYmE0OjBjNGQyODU1LTU1MDctNDkwMC1hNzI1LTJiZDg3YWZhZjJmMQ== --blackduck.proxy.host=apac.zscaler.philips.com --blackduck.proxy.port=10015 --blackduck.proxy.ignored.hosts=blackduck.philips.com --detect.tools.excluded=BINARY_SCAN --detect.docker.image=docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:1.0.27-beta --detect.blackduck.signature.scanner.local.path="C:\Users\ing07422\blackduck\tools\Black_Duck_Scan_Installation\scan.cli-2022.7.2" + java -jar D:\synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --detect.go.path="C:\Program Files\Go\bin\go.exe" --blackduck.trust.cert=true --blackduck.api.token=NmNjYmM4ODgtZjc0Ni00NTIwLTk3NDQtMjdiNzU1ZmFiYmE0OjBjNGQyODU1LTU1MDctNDkwMC1hNzI1LTJiZDg3YWZhZjJmMQ== --blackduck.proxy.host=apac.zscaler.philips.com --blackduck.proxy.port=10015 --blackduck.proxy.ignored.hosts=blackduck.philips.com --detect.tools.excluded=BINARY_SCAN --detect.docker.image=docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:1.0.27-beta --detect.blackduck.signature.scanner.local.path="C:\Users\ing07422\blackduck\tools\Black_Duck_Scan_Installation\scan.cli-2022.7.2" # Fortify: From 99075fba8f4b1b83b95a357d2a092520f72c99f2 Mon Sep 17 00:00:00 2001 From: aswin-in-philips Date: Wed, 29 Mar 2023 11:15:36 +0530 Subject: [PATCH 26/44] blackduck test --- .github/workflows/ci.yaml | 167 +++++++++++++++++++++----------------- 1 file changed, 92 insertions(+), 75 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a7b7c6ae..34934000 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -87,27 +87,6 @@ jobs: # CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} # run: | # ./.github/workflows/test.sh - - Blackduck: - #needs: [Init] - runs-on: builder_blr - steps: - - name: checkout - uses: actions/checkout@v2 - - - name: Set up JDK 11 - uses: actions/setup-java@v1 - with: - java-version: 11 - - - name: Pull docker Image - run: | - docker login docker.na1.hsdp.io --username '${{ secrets.DOCKER_USER }}' --password '${{ secrets.DOCKER_PSWD }}' - docker pull docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:1.0.27-beta - - - name: Blackduck Image Scan - run: | - java -jar D:\synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --detect.go.path="C:\Program Files\Go\bin\go.exe" --blackduck.trust.cert=true --blackduck.api.token=NmNjYmM4ODgtZjc0Ni00NTIwLTk3NDQtMjdiNzU1ZmFiYmE0OjBjNGQyODU1LTU1MDctNDkwMC1hNzI1LTJiZDg3YWZhZjJmMQ== --blackduck.proxy.host=apac.zscaler.philips.com --blackduck.proxy.port=10015 --blackduck.proxy.ignored.hosts=blackduck.philips.com --detect.tools.excluded=BINARY_SCAN --detect.docker.image=docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:1.0.27-beta --detect.blackduck.signature.scanner.local.path="C:\Users\ing07422\blackduck\tools\Black_Duck_Scan_Installation\scan.cli-2022.7.2" # Fortify: @@ -141,68 +120,106 @@ jobs: # D:\SonarQube\Sonar-Scanner\sonar-scanner-cli-4.4.0.2170-windows\sonar-scanner-4.4.0.2170-windows\bin\sonar-scanner.bat -D"sonar.projectKey=EDI-hds-oauth2-proxy" -D"sonar.sources=." -D"sonar.tests=." -D"sonar.go.coverage.reportPaths=${{ github.workspace }}\coverage.out" -D"sonar.host.url=https://sonarqube.ta.philips.com/" -D"sonar.login=${{ secrets.SONAR_TOKEN }}" - # Build: - # needs: [Init] - # runs-on: ubuntu-20.04 - # outputs: - # oauth2proxyPRTag: ${{ steps.setVariables.outputs.prTag }} - # oauth2proxyCITag: ${{ steps.setVariables.outputs.betaTag }} - # steps: - # - uses: actions/checkout@v2 + Build: + #needs: [Init] + runs-on: ubuntu-20.04 + outputs: + oauth2proxyPRTag: ${{ steps.setVariables.outputs.prTag }} + oauth2proxyCITag: ${{ steps.setVariables.outputs.betaTag }} + blackduckPRImage: ${{ steps.setVariables.outputs.blackduck_pr_image }} + blackduckCIImage: ${{ steps.setVariables.outputs.blackduck_ci_image }} + steps: + - uses: actions/checkout@v2 - # - name: Import Secrets - # id: secrets - # uses: hashicorp/vault-action@v2.3.1 - # with: - # url: ${{ secrets.VAULT_HOST }} - # method: approle - # roleId: ${{ secrets.VAULT_ROLE_ID }} - # secretId: ${{ secrets.VAULT_SECRET_ID }} - # exportEnv: true - # secrets: | - # devops/data/docker-repos/hsdp-edi endPoint | HSDP_DOCKER_REGISTRY ; - # devops/data/docker-repos/hsdp-edi user | HSDP_DOCKER_USER ; - # devops/data/docker-repos/hsdp-edi password | HSDP_DOCKER_PASSWORD ; - # devops/data/github/users/sal-devops token | GITHUB_TOKEN ; + - name: Import Secrets + id: secrets + uses: hashicorp/vault-action@v2.3.1 + with: + url: ${{ secrets.VAULT_HOST }} + method: approle + roleId: ${{ secrets.VAULT_ROLE_ID }} + secretId: ${{ secrets.VAULT_SECRET_ID }} + exportEnv: true + secrets: | + devops/data/docker-repos/hsdp-edi endPoint | HSDP_DOCKER_REGISTRY ; + devops/data/docker-repos/hsdp-edi user | HSDP_DOCKER_USER ; + devops/data/docker-repos/hsdp-edi password | HSDP_DOCKER_PASSWORD ; + devops/data/github/users/sal-devops token | GITHUB_TOKEN ; - # - name: Extract branch name - # uses: vazco/github-actions-branch-name@v1 - # id: branch + - name: Extract branch name + uses: vazco/github-actions-branch-name@v1 + id: branch - # - name: Set env variables - # run: | - # new_version=${{ needs.Init.outputs.Version }} - # pr_tag="PR-${{ github.run_id }}" - # beta_tag="${new_version}-beta" - # echo "New version is: $new_version" - # echo "VERSION=$new_version" >> "$GITHUB_ENV" - # echo "CI_IMAGE=${{ env.HSDP_DOCKER_REGISTRY }}/edi-foundation-oauth2-proxy:${beta_tag}" >> "$GITHUB_ENV" - # echo "PR_IMAGE=${{ env.HSDP_DOCKER_REGISTRY }}/edi-foundation-oauth2-proxy:${pr_tag}" >> "$GITHUB_ENV" - # echo "prTag=${pr_tag}" >> $GITHUB_OUTPUT - # echo "betaTag=${beta_tag}" >> $GITHUB_OUTPUT + - name: Set env variables + run: | + new_version=${{ needs.Init.outputs.Version }} + pr_tag="PR-${{ github.run_id }}" + beta_tag="${new_version}-beta" + echo "New version is: $new_version" + echo "VERSION=$new_version" >> "$GITHUB_ENV" + echo "CI_IMAGE=${{ env.HSDP_DOCKER_REGISTRY }}/edi-foundation-oauth2-proxy:${beta_tag}" >> "$GITHUB_ENV" + echo "PR_IMAGE=${{ env.HSDP_DOCKER_REGISTRY }}/edi-foundation-oauth2-proxy:${pr_tag}" >> "$GITHUB_ENV" + echo "prTag=${pr_tag}" >> $GITHUB_OUTPUT + echo "betaTag=${beta_tag}" >> $GITHUB_OUTPUT + echo "blackduck_ci_image=${{ env.HSDP_DOCKER_REGISTRY }}/edi-foundation-oauth2-proxy:${beta_tag}" >> $GITHUB_OUTPUT + echo "blackduck_pr_image=${{ env.HSDP_DOCKER_REGISTRY }}/edi-foundation-oauth2-proxy:${pr_tag}" >> $GITHUB_OUTPUT - # - name: Docker Build - # run: | - # make docker + - name: Docker Build + run: | + make docker - # - name: Docker login - # run: | - # docker login --username '${{ secrets.DOCKER_USER }}' --password '${{ secrets.DOCKER_PSWD }}' '${{ secrets.DOCKER_REPO }}' + - name: Docker login + run: | + docker login --username '${{ secrets.DOCKER_USER }}' --password '${{ secrets.DOCKER_PSWD }}' '${{ secrets.DOCKER_REPO }}' - # - name: Docker tag - # run: | - # docker tag '${{ secrets.DOCKER_REPO }}'/oauth2-proxy:latest ${{ env.PR_IMAGE }} + - name: Docker tag + run: | + docker tag '${{ secrets.DOCKER_REPO }}'/oauth2-proxy:latest ${{ env.PR_IMAGE }} - # - name: PR Image Docker Push - # if: github.event_name == 'pull_request' - # run: | - # docker push ${{ env.PR_IMAGE }} + - name: PR Image Docker Push + #if: github.event_name == 'pull_request' + run: | + docker push ${{ env.PR_IMAGE }} - # - name: Docker Push - # if: github.ref == 'refs/heads/edi-foundation-integration' - # run: | - # docker tag ${{ env.PR_IMAGE }} ${{ env.CI_IMAGE }} - # docker push ${{ env.CI_IMAGE }} + - name: Docker Push + if: github.ref == 'refs/heads/edi-foundation-integration' + run: | + docker tag ${{ env.PR_IMAGE }} ${{ env.CI_IMAGE }} + docker push ${{ env.CI_IMAGE }} + + Blackduck: + needs: [Build] + runs-on: builder_blr + steps: + - name: checkout + uses: actions/checkout@v2 + + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + + - name: Pull PR Docker Image + #if: github.event_name == 'pull_request' + run: | + docker login docker.na1.hsdp.io --username '${{ secrets.DOCKER_USER }}' --password '${{ secrets.DOCKER_PSWD }}' + docker pull ${{ needs.Build.outputs.blackduckPRImage }} + + - name: PR Blackduck Image Scan + #if: github.event_name == 'pull_request' + run: | + java -jar D:\synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --detect.go.path="C:\Program Files\Go\bin\go.exe" --blackduck.trust.cert=true --blackduck.api.token=NmNjYmM4ODgtZjc0Ni00NTIwLTk3NDQtMjdiNzU1ZmFiYmE0OjBjNGQyODU1LTU1MDctNDkwMC1hNzI1LTJiZDg3YWZhZjJmMQ== --blackduck.proxy.host=apac.zscaler.philips.com --blackduck.proxy.port=10015 --blackduck.proxy.ignored.hosts=blackduck.philips.com --detect.tools.excluded=BINARY_SCAN --detect.docker.image=${{ needs.Build.outputs.blackduckPRImage }} --detect.blackduck.signature.scanner.local.path="C:\Users\ing07422\blackduck\tools\Black_Duck_Scan_Installation\scan.cli-2022.7.2" + + - name: Pull CI Docker Image + if: github.ref == 'refs/heads/edi-foundation-integration' + run: | + docker login docker.na1.hsdp.io --username '${{ secrets.DOCKER_USER }}' --password '${{ secrets.DOCKER_PSWD }}' + docker pull ${{ needs.Build.outputs.blackduckCIImage }} + + - name: CI Blackduck Image Scan + if: github.ref == 'refs/heads/edi-foundation-integration' + run: | + java -jar D:\synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --detect.go.path="C:\Program Files\Go\bin\go.exe" --blackduck.trust.cert=true --blackduck.api.token=NmNjYmM4ODgtZjc0Ni00NTIwLTk3NDQtMjdiNzU1ZmFiYmE0OjBjNGQyODU1LTU1MDctNDkwMC1hNzI1LTJiZDg3YWZhZjJmMQ== --blackduck.proxy.host=apac.zscaler.philips.com --blackduck.proxy.port=10015 --blackduck.proxy.ignored.hosts=blackduck.philips.com --detect.tools.excluded=BINARY_SCAN --detect.docker.image=${{ needs.Build.outputs.blackduckCIImage }} --detect.blackduck.signature.scanner.local.path="C:\Users\ing07422\blackduck\tools\Black_Duck_Scan_Installation\scan.cli-2022.7.2" # PR_Deploy_Test_HDS_AUTH_GATEWAY: # if: github.event_name == 'pull_request' From 73024ea000540054ea4811ad23dd6b92f91ab32f Mon Sep 17 00:00:00 2001 From: aswin-in-philips Date: Wed, 29 Mar 2023 11:24:16 +0530 Subject: [PATCH 27/44] adding blackduck scan --- .github/workflows/ci.yaml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 34934000..263308b1 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -126,8 +126,6 @@ jobs: outputs: oauth2proxyPRTag: ${{ steps.setVariables.outputs.prTag }} oauth2proxyCITag: ${{ steps.setVariables.outputs.betaTag }} - blackduckPRImage: ${{ steps.setVariables.outputs.blackduck_pr_image }} - blackduckCIImage: ${{ steps.setVariables.outputs.blackduck_ci_image }} steps: - uses: actions/checkout@v2 @@ -161,8 +159,6 @@ jobs: echo "PR_IMAGE=${{ env.HSDP_DOCKER_REGISTRY }}/edi-foundation-oauth2-proxy:${pr_tag}" >> "$GITHUB_ENV" echo "prTag=${pr_tag}" >> $GITHUB_OUTPUT echo "betaTag=${beta_tag}" >> $GITHUB_OUTPUT - echo "blackduck_ci_image=${{ env.HSDP_DOCKER_REGISTRY }}/edi-foundation-oauth2-proxy:${beta_tag}" >> $GITHUB_OUTPUT - echo "blackduck_pr_image=${{ env.HSDP_DOCKER_REGISTRY }}/edi-foundation-oauth2-proxy:${pr_tag}" >> $GITHUB_OUTPUT - name: Docker Build run: | @@ -203,23 +199,23 @@ jobs: #if: github.event_name == 'pull_request' run: | docker login docker.na1.hsdp.io --username '${{ secrets.DOCKER_USER }}' --password '${{ secrets.DOCKER_PSWD }}' - docker pull ${{ needs.Build.outputs.blackduckPRImage }} + docker pull docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:${{ needs.Build.outputs.envoyPRTag }} - name: PR Blackduck Image Scan #if: github.event_name == 'pull_request' run: | - java -jar D:\synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --detect.go.path="C:\Program Files\Go\bin\go.exe" --blackduck.trust.cert=true --blackduck.api.token=NmNjYmM4ODgtZjc0Ni00NTIwLTk3NDQtMjdiNzU1ZmFiYmE0OjBjNGQyODU1LTU1MDctNDkwMC1hNzI1LTJiZDg3YWZhZjJmMQ== --blackduck.proxy.host=apac.zscaler.philips.com --blackduck.proxy.port=10015 --blackduck.proxy.ignored.hosts=blackduck.philips.com --detect.tools.excluded=BINARY_SCAN --detect.docker.image=${{ needs.Build.outputs.blackduckPRImage }} --detect.blackduck.signature.scanner.local.path="C:\Users\ing07422\blackduck\tools\Black_Duck_Scan_Installation\scan.cli-2022.7.2" + java -jar D:\synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --detect.go.path="C:\Program Files\Go\bin\go.exe" --blackduck.trust.cert=true --blackduck.api.token=NmNjYmM4ODgtZjc0Ni00NTIwLTk3NDQtMjdiNzU1ZmFiYmE0OjBjNGQyODU1LTU1MDctNDkwMC1hNzI1LTJiZDg3YWZhZjJmMQ== --blackduck.proxy.host=apac.zscaler.philips.com --blackduck.proxy.port=10015 --blackduck.proxy.ignored.hosts=blackduck.philips.com --detect.tools.excluded=BINARY_SCAN --detect.docker.image=docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:${{ needs.Build.outputs.envoyPRTag }} --detect.blackduck.signature.scanner.local.path="C:\Users\ing07422\blackduck\tools\Black_Duck_Scan_Installation\scan.cli-2022.7.2" - name: Pull CI Docker Image if: github.ref == 'refs/heads/edi-foundation-integration' run: | docker login docker.na1.hsdp.io --username '${{ secrets.DOCKER_USER }}' --password '${{ secrets.DOCKER_PSWD }}' - docker pull ${{ needs.Build.outputs.blackduckCIImage }} + docker pull docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:${{ needs.Build.outputs.envoyCITag }} - name: CI Blackduck Image Scan if: github.ref == 'refs/heads/edi-foundation-integration' run: | - java -jar D:\synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --detect.go.path="C:\Program Files\Go\bin\go.exe" --blackduck.trust.cert=true --blackduck.api.token=NmNjYmM4ODgtZjc0Ni00NTIwLTk3NDQtMjdiNzU1ZmFiYmE0OjBjNGQyODU1LTU1MDctNDkwMC1hNzI1LTJiZDg3YWZhZjJmMQ== --blackduck.proxy.host=apac.zscaler.philips.com --blackduck.proxy.port=10015 --blackduck.proxy.ignored.hosts=blackduck.philips.com --detect.tools.excluded=BINARY_SCAN --detect.docker.image=${{ needs.Build.outputs.blackduckCIImage }} --detect.blackduck.signature.scanner.local.path="C:\Users\ing07422\blackduck\tools\Black_Duck_Scan_Installation\scan.cli-2022.7.2" + java -jar D:\synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --detect.go.path="C:\Program Files\Go\bin\go.exe" --blackduck.trust.cert=true --blackduck.api.token=NmNjYmM4ODgtZjc0Ni00NTIwLTk3NDQtMjdiNzU1ZmFiYmE0OjBjNGQyODU1LTU1MDctNDkwMC1hNzI1LTJiZDg3YWZhZjJmMQ== --blackduck.proxy.host=apac.zscaler.philips.com --blackduck.proxy.port=10015 --blackduck.proxy.ignored.hosts=blackduck.philips.com --detect.tools.excluded=BINARY_SCAN --detect.docker.image=docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:${{ needs.Build.outputs.envoyCITag }} --detect.blackduck.signature.scanner.local.path="C:\Users\ing07422\blackduck\tools\Black_Duck_Scan_Installation\scan.cli-2022.7.2" # PR_Deploy_Test_HDS_AUTH_GATEWAY: # if: github.event_name == 'pull_request' From 033ed6058b08bad4c9bed83a859d99cb819089fa Mon Sep 17 00:00:00 2001 From: aswin-in-philips Date: Wed, 29 Mar 2023 11:32:42 +0530 Subject: [PATCH 28/44] blackduck test --- .github/workflows/ci.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 263308b1..637dcdad 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -199,30 +199,30 @@ jobs: #if: github.event_name == 'pull_request' run: | docker login docker.na1.hsdp.io --username '${{ secrets.DOCKER_USER }}' --password '${{ secrets.DOCKER_PSWD }}' - docker pull docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:${{ needs.Build.outputs.envoyPRTag }} + docker pull docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:${{ needs.Build.outputs.oauth2proxyPRTag }} - name: PR Blackduck Image Scan #if: github.event_name == 'pull_request' run: | - java -jar D:\synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --detect.go.path="C:\Program Files\Go\bin\go.exe" --blackduck.trust.cert=true --blackduck.api.token=NmNjYmM4ODgtZjc0Ni00NTIwLTk3NDQtMjdiNzU1ZmFiYmE0OjBjNGQyODU1LTU1MDctNDkwMC1hNzI1LTJiZDg3YWZhZjJmMQ== --blackduck.proxy.host=apac.zscaler.philips.com --blackduck.proxy.port=10015 --blackduck.proxy.ignored.hosts=blackduck.philips.com --detect.tools.excluded=BINARY_SCAN --detect.docker.image=docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:${{ needs.Build.outputs.envoyPRTag }} --detect.blackduck.signature.scanner.local.path="C:\Users\ing07422\blackduck\tools\Black_Duck_Scan_Installation\scan.cli-2022.7.2" + java -jar D:\synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --detect.go.path="C:\Program Files\Go\bin\go.exe" --blackduck.trust.cert=true --blackduck.api.token=NmNjYmM4ODgtZjc0Ni00NTIwLTk3NDQtMjdiNzU1ZmFiYmE0OjBjNGQyODU1LTU1MDctNDkwMC1hNzI1LTJiZDg3YWZhZjJmMQ== --blackduck.proxy.host=apac.zscaler.philips.com --blackduck.proxy.port=10015 --blackduck.proxy.ignored.hosts=blackduck.philips.com --detect.tools.excluded=BINARY_SCAN --detect.docker.image=docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:${{ needs.Build.outputs.oauth2proxyPRTag }} --detect.blackduck.signature.scanner.local.path="C:\Users\ing07422\blackduck\tools\Black_Duck_Scan_Installation\scan.cli-2022.7.2" - name: Pull CI Docker Image if: github.ref == 'refs/heads/edi-foundation-integration' run: | docker login docker.na1.hsdp.io --username '${{ secrets.DOCKER_USER }}' --password '${{ secrets.DOCKER_PSWD }}' - docker pull docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:${{ needs.Build.outputs.envoyCITag }} + docker pull docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:${{ needs.Build.outputs.oauth2proxyCITag }} - name: CI Blackduck Image Scan if: github.ref == 'refs/heads/edi-foundation-integration' run: | - java -jar D:\synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --detect.go.path="C:\Program Files\Go\bin\go.exe" --blackduck.trust.cert=true --blackduck.api.token=NmNjYmM4ODgtZjc0Ni00NTIwLTk3NDQtMjdiNzU1ZmFiYmE0OjBjNGQyODU1LTU1MDctNDkwMC1hNzI1LTJiZDg3YWZhZjJmMQ== --blackduck.proxy.host=apac.zscaler.philips.com --blackduck.proxy.port=10015 --blackduck.proxy.ignored.hosts=blackduck.philips.com --detect.tools.excluded=BINARY_SCAN --detect.docker.image=docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:${{ needs.Build.outputs.envoyCITag }} --detect.blackduck.signature.scanner.local.path="C:\Users\ing07422\blackduck\tools\Black_Duck_Scan_Installation\scan.cli-2022.7.2" + java -jar D:\synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --detect.go.path="C:\Program Files\Go\bin\go.exe" --blackduck.trust.cert=true --blackduck.api.token=NmNjYmM4ODgtZjc0Ni00NTIwLTk3NDQtMjdiNzU1ZmFiYmE0OjBjNGQyODU1LTU1MDctNDkwMC1hNzI1LTJiZDg3YWZhZjJmMQ== --blackduck.proxy.host=apac.zscaler.philips.com --blackduck.proxy.port=10015 --blackduck.proxy.ignored.hosts=blackduck.philips.com --detect.tools.excluded=BINARY_SCAN --detect.docker.image=docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:${{ needs.Build.outputs.oauth2proxyCITag }} --detect.blackduck.signature.scanner.local.path="C:\Users\ing07422\blackduck\tools\Black_Duck_Scan_Installation\scan.cli-2022.7.2" # PR_Deploy_Test_HDS_AUTH_GATEWAY: # if: github.event_name == 'pull_request' # needs: [Build, Fortify, unit-test, CodeAnalysis] # uses: ./.github/workflows/deploy-hds-auth-gateway.yaml # with: - # OAUTH2_PROXY_IMAGE: ${{ needs.Build.outputs.envoyPRTag }} + # OAUTH2_PROXY_IMAGE: ${{ needs.Build.outputs.oauth2proxyPRTag }} # secrets: # VAULT_HOST: ${{ secrets.VAULT_HOST }} # VAULT_ROLE_ID: ${{ secrets.VAULT_ROLE_ID }} @@ -233,7 +233,7 @@ jobs: # needs: [Build, Fortify, unit-test, CodeAnalysis] # uses: ./.github/workflows/api-gw-integrated-test.yaml # with: - # OAUTH2_PROXY_IMAGE: ${{ needs.Build.outputs.envoyCITag }} + # OAUTH2_PROXY_IMAGE: ${{ needs.Build.outputs.oauth2proxyCITag }} # secrets: # VAULT_HOST: ${{ secrets.VAULT_HOST }} # VAULT_ROLE_ID: ${{ secrets.VAULT_ROLE_ID }} From fa6a5d4fe7259427bdb12e1b59d070ce1ea68347 Mon Sep 17 00:00:00 2001 From: aswin-in-philips Date: Wed, 29 Mar 2023 11:45:03 +0530 Subject: [PATCH 29/44] test --- .github/workflows/ci.yaml | 72 ++++++++++++++++++++++++--------------- 1 file changed, 44 insertions(+), 28 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 637dcdad..b90cb42e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -182,40 +182,56 @@ jobs: run: | docker tag ${{ env.PR_IMAGE }} ${{ env.CI_IMAGE }} docker push ${{ env.CI_IMAGE }} + + - name: PR Image Artifact + #if: github.event_name == 'pull_request' + uses: actions/upload-artifact@v2 + with: + name: ${{ env.PR_IMAGE }} + path: /tmp/output.txt + if-no-files-found: error + + - name: CI Image Artifact + if: github.ref == 'refs/heads/edi-foundation-integration' + uses: actions/upload-artifact@v2 + with: + name: ${{ env.CI_IMAGE }} + path: /tmp/output.txt + if-no-files-found: error - Blackduck: - needs: [Build] - runs-on: builder_blr - steps: - - name: checkout - uses: actions/checkout@v2 + # Blackduck: + # needs: [Build] + # runs-on: builder_blr + # steps: + # - name: checkout + # uses: actions/checkout@v2 - - name: Set up JDK 11 - uses: actions/setup-java@v1 - with: - java-version: 11 + # - name: Set up JDK 11 + # uses: actions/setup-java@v1 + # with: + # java-version: 11 - - name: Pull PR Docker Image - #if: github.event_name == 'pull_request' - run: | - docker login docker.na1.hsdp.io --username '${{ secrets.DOCKER_USER }}' --password '${{ secrets.DOCKER_PSWD }}' - docker pull docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:${{ needs.Build.outputs.oauth2proxyPRTag }} + # - name: Pull PR Docker Image + # #if: github.event_name == 'pull_request' + # run: | + # docker login docker.na1.hsdp.io --username '${{ secrets.DOCKER_USER }}' --password '${{ secrets.DOCKER_PSWD }}' + # docker pull docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:${{ needs.Build.outputs.oauth2proxyPRTag }} - - name: PR Blackduck Image Scan - #if: github.event_name == 'pull_request' - run: | - java -jar D:\synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --detect.go.path="C:\Program Files\Go\bin\go.exe" --blackduck.trust.cert=true --blackduck.api.token=NmNjYmM4ODgtZjc0Ni00NTIwLTk3NDQtMjdiNzU1ZmFiYmE0OjBjNGQyODU1LTU1MDctNDkwMC1hNzI1LTJiZDg3YWZhZjJmMQ== --blackduck.proxy.host=apac.zscaler.philips.com --blackduck.proxy.port=10015 --blackduck.proxy.ignored.hosts=blackduck.philips.com --detect.tools.excluded=BINARY_SCAN --detect.docker.image=docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:${{ needs.Build.outputs.oauth2proxyPRTag }} --detect.blackduck.signature.scanner.local.path="C:\Users\ing07422\blackduck\tools\Black_Duck_Scan_Installation\scan.cli-2022.7.2" + # - name: PR Blackduck Image Scan + # #if: github.event_name == 'pull_request' + # run: | + # java -jar D:\synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --detect.go.path="C:\Program Files\Go\bin\go.exe" --blackduck.trust.cert=true --blackduck.api.token=NmNjYmM4ODgtZjc0Ni00NTIwLTk3NDQtMjdiNzU1ZmFiYmE0OjBjNGQyODU1LTU1MDctNDkwMC1hNzI1LTJiZDg3YWZhZjJmMQ== --blackduck.proxy.host=apac.zscaler.philips.com --blackduck.proxy.port=10015 --blackduck.proxy.ignored.hosts=blackduck.philips.com --detect.tools.excluded=BINARY_SCAN --detect.docker.image=docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:${{ needs.Build.outputs.oauth2proxyPRTag }} --detect.blackduck.signature.scanner.local.path="C:\Users\ing07422\blackduck\tools\Black_Duck_Scan_Installation\scan.cli-2022.7.2" - - name: Pull CI Docker Image - if: github.ref == 'refs/heads/edi-foundation-integration' - run: | - docker login docker.na1.hsdp.io --username '${{ secrets.DOCKER_USER }}' --password '${{ secrets.DOCKER_PSWD }}' - docker pull docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:${{ needs.Build.outputs.oauth2proxyCITag }} + # - name: Pull CI Docker Image + # if: github.ref == 'refs/heads/edi-foundation-integration' + # run: | + # docker login docker.na1.hsdp.io --username '${{ secrets.DOCKER_USER }}' --password '${{ secrets.DOCKER_PSWD }}' + # docker pull docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:${{ needs.Build.outputs.oauth2proxyCITag }} - - name: CI Blackduck Image Scan - if: github.ref == 'refs/heads/edi-foundation-integration' - run: | - java -jar D:\synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --detect.go.path="C:\Program Files\Go\bin\go.exe" --blackduck.trust.cert=true --blackduck.api.token=NmNjYmM4ODgtZjc0Ni00NTIwLTk3NDQtMjdiNzU1ZmFiYmE0OjBjNGQyODU1LTU1MDctNDkwMC1hNzI1LTJiZDg3YWZhZjJmMQ== --blackduck.proxy.host=apac.zscaler.philips.com --blackduck.proxy.port=10015 --blackduck.proxy.ignored.hosts=blackduck.philips.com --detect.tools.excluded=BINARY_SCAN --detect.docker.image=docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:${{ needs.Build.outputs.oauth2proxyCITag }} --detect.blackduck.signature.scanner.local.path="C:\Users\ing07422\blackduck\tools\Black_Duck_Scan_Installation\scan.cli-2022.7.2" + # - name: CI Blackduck Image Scan + # if: github.ref == 'refs/heads/edi-foundation-integration' + # run: | + # java -jar D:\synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --detect.go.path="C:\Program Files\Go\bin\go.exe" --blackduck.trust.cert=true --blackduck.api.token=NmNjYmM4ODgtZjc0Ni00NTIwLTk3NDQtMjdiNzU1ZmFiYmE0OjBjNGQyODU1LTU1MDctNDkwMC1hNzI1LTJiZDg3YWZhZjJmMQ== --blackduck.proxy.host=apac.zscaler.philips.com --blackduck.proxy.port=10015 --blackduck.proxy.ignored.hosts=blackduck.philips.com --detect.tools.excluded=BINARY_SCAN --detect.docker.image=docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:${{ needs.Build.outputs.oauth2proxyCITag }} --detect.blackduck.signature.scanner.local.path="C:\Users\ing07422\blackduck\tools\Black_Duck_Scan_Installation\scan.cli-2022.7.2" # PR_Deploy_Test_HDS_AUTH_GATEWAY: # if: github.event_name == 'pull_request' From d36889a9d94240bc4da92be1b6a1108ff638f2ad Mon Sep 17 00:00:00 2001 From: aswin-in-philips Date: Wed, 29 Mar 2023 11:45:33 +0530 Subject: [PATCH 30/44] test --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b90cb42e..888053b6 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -188,7 +188,7 @@ jobs: uses: actions/upload-artifact@v2 with: name: ${{ env.PR_IMAGE }} - path: /tmp/output.txt + path: /tmp/output1.txt if-no-files-found: error - name: CI Image Artifact @@ -196,7 +196,7 @@ jobs: uses: actions/upload-artifact@v2 with: name: ${{ env.CI_IMAGE }} - path: /tmp/output.txt + path: /tmp/output2.txt if-no-files-found: error # Blackduck: From 0b0141a7d9eaa5dd6eb3e6d9bdf37aebc0c302c8 Mon Sep 17 00:00:00 2001 From: aswin-in-philips Date: Wed, 29 Mar 2023 12:05:57 +0530 Subject: [PATCH 31/44] test --- .github/workflows/ci.yaml | 59 ++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 32 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 888053b6..2211f920 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -159,45 +159,40 @@ jobs: echo "PR_IMAGE=${{ env.HSDP_DOCKER_REGISTRY }}/edi-foundation-oauth2-proxy:${pr_tag}" >> "$GITHUB_ENV" echo "prTag=${pr_tag}" >> $GITHUB_OUTPUT echo "betaTag=${beta_tag}" >> $GITHUB_OUTPUT + echo "${{ env.HSDP_DOCKER_REGISTRY }}/edi-foundation-oauth2-proxy:${pr_tag}" > /tmp/output.txt + cat /tmp/output.txt - - name: Docker Build - run: | - make docker + # - name: Docker Build + # run: | + # make docker - - name: Docker login - run: | - docker login --username '${{ secrets.DOCKER_USER }}' --password '${{ secrets.DOCKER_PSWD }}' '${{ secrets.DOCKER_REPO }}' + # - name: Docker login + # run: | + # docker login --username '${{ secrets.DOCKER_USER }}' --password '${{ secrets.DOCKER_PSWD }}' '${{ secrets.DOCKER_REPO }}' - - name: Docker tag - run: | - docker tag '${{ secrets.DOCKER_REPO }}'/oauth2-proxy:latest ${{ env.PR_IMAGE }} + # - name: Docker tag + # run: | + # docker tag '${{ secrets.DOCKER_REPO }}'/oauth2-proxy:latest ${{ env.PR_IMAGE }} - - name: PR Image Docker Push - #if: github.event_name == 'pull_request' - run: | - docker push ${{ env.PR_IMAGE }} + # - name: PR Image Docker Push + # #if: github.event_name == 'pull_request' + # run: | + # docker push ${{ env.PR_IMAGE }} - - name: Docker Push - if: github.ref == 'refs/heads/edi-foundation-integration' - run: | - docker tag ${{ env.PR_IMAGE }} ${{ env.CI_IMAGE }} - docker push ${{ env.CI_IMAGE }} + # - name: Docker Push + # if: github.ref == 'refs/heads/edi-foundation-integration' + # run: | + # docker tag ${{ env.PR_IMAGE }} ${{ env.CI_IMAGE }} + # docker push ${{ env.CI_IMAGE }} - - name: PR Image Artifact - #if: github.event_name == 'pull_request' - uses: actions/upload-artifact@v2 - with: - name: ${{ env.PR_IMAGE }} - path: /tmp/output1.txt - if-no-files-found: error - - name: CI Image Artifact - if: github.ref == 'refs/heads/edi-foundation-integration' - uses: actions/upload-artifact@v2 - with: - name: ${{ env.CI_IMAGE }} - path: /tmp/output2.txt - if-no-files-found: error + # - name: CI Image Artifact + # if: github.ref == 'refs/heads/edi-foundation-integration' + # uses: actions/upload-artifact@v2 + # with: + # name: ${{ env.CI_IMAGE }} + # path: /tmp/output.txt + # if-no-files-found: error # Blackduck: # needs: [Build] From 2b60fef2aed330ee6d458132d96f22d4b11baf5e Mon Sep 17 00:00:00 2001 From: aswin-in-philips Date: Wed, 29 Mar 2023 12:10:55 +0530 Subject: [PATCH 32/44] image tag output --- .github/workflows/ci.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 2211f920..ea213fc9 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -160,7 +160,11 @@ jobs: echo "prTag=${pr_tag}" >> $GITHUB_OUTPUT echo "betaTag=${beta_tag}" >> $GITHUB_OUTPUT echo "${{ env.HSDP_DOCKER_REGISTRY }}/edi-foundation-oauth2-proxy:${pr_tag}" > /tmp/output.txt + + - name: Image tag + run: | cat /tmp/output.txt + # - name: Docker Build # run: | @@ -190,7 +194,7 @@ jobs: # if: github.ref == 'refs/heads/edi-foundation-integration' # uses: actions/upload-artifact@v2 # with: - # name: ${{ env.CI_IMAGE }} + # name: Image tag # path: /tmp/output.txt # if-no-files-found: error From 86490c1478a3ddb31cf003c4771dd0ef8d53f488 Mon Sep 17 00:00:00 2001 From: aswin-in-philips Date: Wed, 29 Mar 2023 12:13:06 +0530 Subject: [PATCH 33/44] test --- .github/workflows/ci.yaml | 55 ++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 30 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ea213fc9..85bb5d69 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -160,43 +160,38 @@ jobs: echo "prTag=${pr_tag}" >> $GITHUB_OUTPUT echo "betaTag=${beta_tag}" >> $GITHUB_OUTPUT echo "${{ env.HSDP_DOCKER_REGISTRY }}/edi-foundation-oauth2-proxy:${pr_tag}" > /tmp/output.txt - - - name: Image tag + + - name: Docker Build run: | - cat /tmp/output.txt + make docker - - # - name: Docker Build - # run: | - # make docker + - name: Docker login + run: | + docker login --username '${{ secrets.DOCKER_USER }}' --password '${{ secrets.DOCKER_PSWD }}' '${{ secrets.DOCKER_REPO }}' - # - name: Docker login - # run: | - # docker login --username '${{ secrets.DOCKER_USER }}' --password '${{ secrets.DOCKER_PSWD }}' '${{ secrets.DOCKER_REPO }}' - - # - name: Docker tag - # run: | - # docker tag '${{ secrets.DOCKER_REPO }}'/oauth2-proxy:latest ${{ env.PR_IMAGE }} + - name: Docker tag + run: | + docker tag '${{ secrets.DOCKER_REPO }}'/oauth2-proxy:latest ${{ env.PR_IMAGE }} - # - name: PR Image Docker Push - # #if: github.event_name == 'pull_request' - # run: | - # docker push ${{ env.PR_IMAGE }} + - name: PR Image Docker Push + #if: github.event_name == 'pull_request' + run: | + docker push ${{ env.PR_IMAGE }} - # - name: Docker Push - # if: github.ref == 'refs/heads/edi-foundation-integration' - # run: | - # docker tag ${{ env.PR_IMAGE }} ${{ env.CI_IMAGE }} - # docker push ${{ env.CI_IMAGE }} + - name: Docker Push + if: github.ref == 'refs/heads/edi-foundation-integration' + run: | + docker tag ${{ env.PR_IMAGE }} ${{ env.CI_IMAGE }} + docker push ${{ env.CI_IMAGE }} - # - name: CI Image Artifact - # if: github.ref == 'refs/heads/edi-foundation-integration' - # uses: actions/upload-artifact@v2 - # with: - # name: Image tag - # path: /tmp/output.txt - # if-no-files-found: error + - name: CI Image Artifact + #if: github.ref == 'refs/heads/edi-foundation-integration' + uses: actions/upload-artifact@v2 + with: + name: Image tag + path: /tmp/output.txt + if-no-files-found: error # Blackduck: # needs: [Build] From ec796fd4c626c8a38d9dae86e738a5604d9590c9 Mon Sep 17 00:00:00 2001 From: aswin-in-philips Date: Wed, 29 Mar 2023 12:40:20 +0530 Subject: [PATCH 34/44] test --- .github/workflows/ci.yaml | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 85bb5d69..ec59e41a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -159,7 +159,8 @@ jobs: echo "PR_IMAGE=${{ env.HSDP_DOCKER_REGISTRY }}/edi-foundation-oauth2-proxy:${pr_tag}" >> "$GITHUB_ENV" echo "prTag=${pr_tag}" >> $GITHUB_OUTPUT echo "betaTag=${beta_tag}" >> $GITHUB_OUTPUT - echo "${{ env.HSDP_DOCKER_REGISTRY }}/edi-foundation-oauth2-proxy:${pr_tag}" > /tmp/output.txt + echo "${pr_tag}" > /tmp/output.txt + echo "${beta_tag}" > /tmp/output2.txt - name: Docker Build run: | @@ -184,14 +185,32 @@ jobs: docker tag ${{ env.PR_IMAGE }} ${{ env.CI_IMAGE }} docker push ${{ env.CI_IMAGE }} + - name: PR Image Artifact + #if: github.event_name == 'pull_request' + uses: actions/upload-artifact@v2 + with: + name: Image tag + path: /tmp/output.txt + if-no-files-found: error + - name: CI Image Artifact #if: github.ref == 'refs/heads/edi-foundation-integration' uses: actions/upload-artifact@v2 with: name: Image tag - path: /tmp/output.txt + path: /tmp/output2.txt if-no-files-found: error + + Output: + needs: [Build] + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + + - name: check output + run: | + echo "${{ needs.Build.outputs.oauth2proxyPRTag }}" # Blackduck: # needs: [Build] From 46dbf695a1aca0237f9ed40df3042c7dcb4341b0 Mon Sep 17 00:00:00 2001 From: aswin-in-philips Date: Wed, 29 Mar 2023 12:49:26 +0530 Subject: [PATCH 35/44] test --- .github/workflows/ci.yaml | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ec59e41a..f9d7e9f1 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -149,6 +149,7 @@ jobs: id: branch - name: Set env variables + id: setVariables run: | new_version=${{ needs.Init.outputs.Version }} pr_tag="PR-${{ github.run_id }}" @@ -185,15 +186,6 @@ jobs: docker tag ${{ env.PR_IMAGE }} ${{ env.CI_IMAGE }} docker push ${{ env.CI_IMAGE }} - - name: PR Image Artifact - #if: github.event_name == 'pull_request' - uses: actions/upload-artifact@v2 - with: - name: Image tag - path: /tmp/output.txt - if-no-files-found: error - - - name: CI Image Artifact #if: github.ref == 'refs/heads/edi-foundation-integration' uses: actions/upload-artifact@v2 @@ -224,17 +216,6 @@ jobs: # with: # java-version: 11 - # - name: Pull PR Docker Image - # #if: github.event_name == 'pull_request' - # run: | - # docker login docker.na1.hsdp.io --username '${{ secrets.DOCKER_USER }}' --password '${{ secrets.DOCKER_PSWD }}' - # docker pull docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:${{ needs.Build.outputs.oauth2proxyPRTag }} - - # - name: PR Blackduck Image Scan - # #if: github.event_name == 'pull_request' - # run: | - # java -jar D:\synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --detect.go.path="C:\Program Files\Go\bin\go.exe" --blackduck.trust.cert=true --blackduck.api.token=NmNjYmM4ODgtZjc0Ni00NTIwLTk3NDQtMjdiNzU1ZmFiYmE0OjBjNGQyODU1LTU1MDctNDkwMC1hNzI1LTJiZDg3YWZhZjJmMQ== --blackduck.proxy.host=apac.zscaler.philips.com --blackduck.proxy.port=10015 --blackduck.proxy.ignored.hosts=blackduck.philips.com --detect.tools.excluded=BINARY_SCAN --detect.docker.image=docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:${{ needs.Build.outputs.oauth2proxyPRTag }} --detect.blackduck.signature.scanner.local.path="C:\Users\ing07422\blackduck\tools\Black_Duck_Scan_Installation\scan.cli-2022.7.2" - # - name: Pull CI Docker Image # if: github.ref == 'refs/heads/edi-foundation-integration' # run: | From 6f41618de6012a08f8981c37c4ff4d1972cddc12 Mon Sep 17 00:00:00 2001 From: aswin-in-philips Date: Wed, 29 Mar 2023 13:09:27 +0530 Subject: [PATCH 36/44] blackduck test --- .github/workflows/ci.yaml | 56 +++++++++++++-------------------------- 1 file changed, 18 insertions(+), 38 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f9d7e9f1..f7a2f961 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -160,8 +160,7 @@ jobs: echo "PR_IMAGE=${{ env.HSDP_DOCKER_REGISTRY }}/edi-foundation-oauth2-proxy:${pr_tag}" >> "$GITHUB_ENV" echo "prTag=${pr_tag}" >> $GITHUB_OUTPUT echo "betaTag=${beta_tag}" >> $GITHUB_OUTPUT - echo "${pr_tag}" > /tmp/output.txt - echo "${beta_tag}" > /tmp/output2.txt + echo "${beta_tag}" > /tmp/output.txt - name: Docker Build run: | @@ -185,47 +184,28 @@ jobs: run: | docker tag ${{ env.PR_IMAGE }} ${{ env.CI_IMAGE }} docker push ${{ env.CI_IMAGE }} - - - name: CI Image Artifact - #if: github.ref == 'refs/heads/edi-foundation-integration' - uses: actions/upload-artifact@v2 - with: - name: Image tag - path: /tmp/output2.txt - if-no-files-found: error - - Output: + + Blackduck: needs: [Build] - runs-on: ubuntu-20.04 + #if: github.ref == 'refs/heads/edi-foundation-integration' + runs-on: builder_blr steps: - - uses: actions/checkout@v2 - - - name: check output - run: | - echo "${{ needs.Build.outputs.oauth2proxyPRTag }}" - - # Blackduck: - # needs: [Build] - # runs-on: builder_blr - # steps: - # - name: checkout - # uses: actions/checkout@v2 + - name: checkout + uses: actions/checkout@v2 - # - name: Set up JDK 11 - # uses: actions/setup-java@v1 - # with: - # java-version: 11 + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 - # - name: Pull CI Docker Image - # if: github.ref == 'refs/heads/edi-foundation-integration' - # run: | - # docker login docker.na1.hsdp.io --username '${{ secrets.DOCKER_USER }}' --password '${{ secrets.DOCKER_PSWD }}' - # docker pull docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:${{ needs.Build.outputs.oauth2proxyCITag }} + - name: Pull CI Docker Image + run: | + docker login docker.na1.hsdp.io --username '${{ secrets.DOCKER_USER }}' --password '${{ secrets.DOCKER_PSWD }}' + docker pull docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:${{ needs.Build.outputs.oauth2proxyPRTag }} - # - name: CI Blackduck Image Scan - # if: github.ref == 'refs/heads/edi-foundation-integration' - # run: | - # java -jar D:\synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --detect.go.path="C:\Program Files\Go\bin\go.exe" --blackduck.trust.cert=true --blackduck.api.token=NmNjYmM4ODgtZjc0Ni00NTIwLTk3NDQtMjdiNzU1ZmFiYmE0OjBjNGQyODU1LTU1MDctNDkwMC1hNzI1LTJiZDg3YWZhZjJmMQ== --blackduck.proxy.host=apac.zscaler.philips.com --blackduck.proxy.port=10015 --blackduck.proxy.ignored.hosts=blackduck.philips.com --detect.tools.excluded=BINARY_SCAN --detect.docker.image=docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:${{ needs.Build.outputs.oauth2proxyCITag }} --detect.blackduck.signature.scanner.local.path="C:\Users\ing07422\blackduck\tools\Black_Duck_Scan_Installation\scan.cli-2022.7.2" + - name: CI Blackduck Image Scan + run: | + java -jar D:\synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --detect.go.path="C:\Program Files\Go\bin\go.exe" --blackduck.trust.cert=true --blackduck.api.token=${{ secrets.BLACKDUCK_TOKEN }} --blackduck.proxy.host=apac.zscaler.philips.com --blackduck.proxy.port=10015 --blackduck.proxy.ignored.hosts=blackduck.philips.com --detect.tools.excluded=BINARY_SCAN --detect.docker.image=docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:${{ needs.Build.outputs.oauth2proxyPRTag }} --detect.blackduck.signature.scanner.local.path="C:\Users\ing07422\blackduck\tools\Black_Duck_Scan_Installation\scan.cli-2022.7.2" # PR_Deploy_Test_HDS_AUTH_GATEWAY: # if: github.event_name == 'pull_request' From af823a7934b075fb52461974110050718d5d1e74 Mon Sep 17 00:00:00 2001 From: aswin-in-philips Date: Wed, 29 Mar 2023 13:19:29 +0530 Subject: [PATCH 37/44] adding blackduck image docker scan --- .github/workflows/ci.yaml | 328 +++++++++++++++++++------------------- 1 file changed, 164 insertions(+), 164 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f7a2f961..69ad3ce4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -4,7 +4,7 @@ on: push: branches: - 'blackduck-image' - # - $default-branch + - $default-branch paths-ignore: - 'VERSION' - '.bumpversion.cfg' @@ -13,115 +13,115 @@ on: workflow_dispatch: jobs: - # Wokflow-Queue: - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v2 - # - uses: ahmadnassri/action-workflow-queue@v1 + Wokflow-Queue: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: ahmadnassri/action-workflow-queue@v1 - # Init: - # needs: [Wokflow-Queue] - # runs-on: ubuntu-20.04 - # outputs: - # Version: ${{ steps.setVariables.outputs.version }} - # steps: - # - uses: actions/checkout@v2 - # with: - # token: ${{ secrets.ADMIN_TOKEN }} + Init: + needs: [Wokflow-Queue] + runs-on: ubuntu-20.04 + outputs: + Version: ${{ steps.setVariables.outputs.version }} + steps: + - uses: actions/checkout@v2 + with: + token: ${{ secrets.ADMIN_TOKEN }} - # - name: Extract branch name - # uses: vazco/github-actions-branch-name@v1 - # id: branch + - name: Extract branch name + uses: vazco/github-actions-branch-name@v1 + id: branch - # - name: Bump version - # if: github.ref == 'refs/heads/edi-foundation-integration' - # id: setVariables - # run: | - # sudo apt update - # sudo apt install bumpversion - # bumpversion patch - # new_version=`cat VERSION` - # echo "New version is: $new_version" - # echo "version=$new_version" >> $GITHUB_OUTPUT - # git config --global user.name "CI Build" - # git config --global user.email "ci.build@philips.com" - # git commit -am "Bump version $new_version" - # git push --force + - name: Bump version + if: github.ref == 'refs/heads/edi-foundation-integration' + id: setVariables + run: | + sudo apt update + sudo apt install bumpversion + bumpversion patch + new_version=`cat VERSION` + echo "New version is: $new_version" + echo "version=$new_version" >> $GITHUB_OUTPUT + git config --global user.name "CI Build" + git config --global user.email "ci.build@philips.com" + git commit -am "Bump version $new_version" + git push --force - # unit-test: - # needs: [Init] - # env: - # COVER: true - # runs-on: ubuntu-20.04 - # steps: + unit-test: + needs: [Init] + env: + COVER: true + runs-on: ubuntu-20.04 + steps: - # - name: Check out code - # uses: actions/checkout@v2 + - name: Check out code + uses: actions/checkout@v2 - # - name: Set up Go 1.16 - # uses: actions/setup-go@v2 - # with: - # go-version: 1.16.x - # id: go + - name: Set up Go 1.16 + uses: actions/setup-go@v2 + with: + go-version: 1.16.x + id: go - # - name: Get dependencies - # run: | - # curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.36.0 - # curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter - # chmod +x ./cc-test-reporter + - name: Get dependencies + run: | + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.36.0 + curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter + chmod +x ./cc-test-reporter - # - name: Verify Code Generation - # run: | - # make verify-generate + - name: Verify Code Generation + run: | + make verify-generate - # - name: Lint - # run: | - # make lint + - name: Lint + run: | + make lint - # - name: Build - # run: | - # make build + - name: Build + run: | + make build - # - name: Test - # env: - # CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} - # run: | - # ./.github/workflows/test.sh + - name: Test + env: + CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} + run: | + ./.github/workflows/test.sh - # Fortify: - # needs: [Init] - # runs-on: builder_blr_2 - # steps: - # - name: checkout - # uses: actions/checkout@v2 + Fortify: + needs: [Init] + runs-on: builder_blr_2 + steps: + - name: checkout + uses: actions/checkout@v2 - # - name: Fortify scan - # run: powershell -ExecutionPolicy RemoteSigned -NoExit -File ${{ github.workspace }}\build\ps\Invoke-FortifyScan.ps1 -PublishAuthToken ${{ secrets.FORTIFY_TOKEN }} + - name: Fortify scan + run: powershell -ExecutionPolicy RemoteSigned -NoExit -File ${{ github.workspace }}\build\ps\Invoke-FortifyScan.ps1 -PublishAuthToken ${{ secrets.FORTIFY_TOKEN }} - # CodeAnalysis: - # runs-on: builder_blr - # needs: [Init] - # steps: - # - uses: actions/checkout@v2 + CodeAnalysis: + runs-on: builder_blr + needs: [Init] + steps: + - uses: actions/checkout@v2 - # - name: Set up Go 1.16 - # uses: actions/setup-go@v2 - # with: - # go-version: 1.16.x - # id: go + - name: Set up Go 1.16 + uses: actions/setup-go@v2 + with: + go-version: 1.16.x + id: go - # - name: coverage - # run: | - # go test -coverprofile=${{ github.workspace }}\coverage.out + - name: coverage + run: | + go test -coverprofile=${{ github.workspace }}\coverage.out - # - name: sonar - # run: | - # D:\SonarQube\Sonar-Scanner\sonar-scanner-cli-4.4.0.2170-windows\sonar-scanner-4.4.0.2170-windows\bin\sonar-scanner.bat -D"sonar.projectKey=EDI-hds-oauth2-proxy" -D"sonar.sources=." -D"sonar.tests=." -D"sonar.go.coverage.reportPaths=${{ github.workspace }}\coverage.out" -D"sonar.host.url=https://sonarqube.ta.philips.com/" -D"sonar.login=${{ secrets.SONAR_TOKEN }}" + - name: sonar + run: | + D:\SonarQube\Sonar-Scanner\sonar-scanner-cli-4.4.0.2170-windows\sonar-scanner-4.4.0.2170-windows\bin\sonar-scanner.bat -D"sonar.projectKey=EDI-hds-oauth2-proxy" -D"sonar.sources=." -D"sonar.tests=." -D"sonar.go.coverage.reportPaths=${{ github.workspace }}\coverage.out" -D"sonar.host.url=https://sonarqube.ta.philips.com/" -D"sonar.login=${{ secrets.SONAR_TOKEN }}" Build: - #needs: [Init] + needs: [Init] runs-on: ubuntu-20.04 outputs: oauth2proxyPRTag: ${{ steps.setVariables.outputs.prTag }} @@ -175,7 +175,7 @@ jobs: docker tag '${{ secrets.DOCKER_REPO }}'/oauth2-proxy:latest ${{ env.PR_IMAGE }} - name: PR Image Docker Push - #if: github.event_name == 'pull_request' + if: github.event_name == 'pull_request' run: | docker push ${{ env.PR_IMAGE }} @@ -187,7 +187,7 @@ jobs: Blackduck: needs: [Build] - #if: github.ref == 'refs/heads/edi-foundation-integration' + if: github.ref == 'refs/heads/edi-foundation-integration' runs-on: builder_blr steps: - name: checkout @@ -201,87 +201,87 @@ jobs: - name: Pull CI Docker Image run: | docker login docker.na1.hsdp.io --username '${{ secrets.DOCKER_USER }}' --password '${{ secrets.DOCKER_PSWD }}' - docker pull docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:${{ needs.Build.outputs.oauth2proxyPRTag }} + docker pull docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:${{ needs.Build.outputs.oauth2proxyCITag }} - name: CI Blackduck Image Scan run: | - java -jar D:\synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --detect.go.path="C:\Program Files\Go\bin\go.exe" --blackduck.trust.cert=true --blackduck.api.token=${{ secrets.BLACKDUCK_TOKEN }} --blackduck.proxy.host=apac.zscaler.philips.com --blackduck.proxy.port=10015 --blackduck.proxy.ignored.hosts=blackduck.philips.com --detect.tools.excluded=BINARY_SCAN --detect.docker.image=docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:${{ needs.Build.outputs.oauth2proxyPRTag }} --detect.blackduck.signature.scanner.local.path="C:\Users\ing07422\blackduck\tools\Black_Duck_Scan_Installation\scan.cli-2022.7.2" + java -jar D:\synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --detect.go.path="C:\Program Files\Go\bin\go.exe" --blackduck.trust.cert=true --blackduck.api.token=${{ secrets.BLACKDUCK_TOKEN }} --blackduck.proxy.host=apac.zscaler.philips.com --blackduck.proxy.port=10015 --blackduck.proxy.ignored.hosts=blackduck.philips.com --detect.tools.excluded=BINARY_SCAN --detect.docker.image=docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:${{ needs.Build.outputs.oauth2proxyCITag }} --detect.blackduck.signature.scanner.local.path="C:\Users\ing07422\blackduck\tools\Black_Duck_Scan_Installation\scan.cli-2022.7.2" - # PR_Deploy_Test_HDS_AUTH_GATEWAY: - # if: github.event_name == 'pull_request' - # needs: [Build, Fortify, unit-test, CodeAnalysis] - # uses: ./.github/workflows/deploy-hds-auth-gateway.yaml - # with: - # OAUTH2_PROXY_IMAGE: ${{ needs.Build.outputs.oauth2proxyPRTag }} - # secrets: - # VAULT_HOST: ${{ secrets.VAULT_HOST }} - # VAULT_ROLE_ID: ${{ secrets.VAULT_ROLE_ID }} - # VAULT_SECRET_ID: ${{ secrets.VAULT_SECRET_ID }} + PR_Deploy_Test_HDS_AUTH_GATEWAY: + if: github.event_name == 'pull_request' + needs: [Build, Fortify, unit-test, CodeAnalysis] + uses: ./.github/workflows/deploy-hds-auth-gateway.yaml + with: + OAUTH2_PROXY_IMAGE: ${{ needs.Build.outputs.oauth2proxyPRTag }} + secrets: + VAULT_HOST: ${{ secrets.VAULT_HOST }} + VAULT_ROLE_ID: ${{ secrets.VAULT_ROLE_ID }} + VAULT_SECRET_ID: ${{ secrets.VAULT_SECRET_ID }} - # CI_Deploy_Test_HDS_AUTH_GATEWAY: - # if: github.ref == 'refs/heads/edi-foundation-integration' - # needs: [Build, Fortify, unit-test, CodeAnalysis] - # uses: ./.github/workflows/api-gw-integrated-test.yaml - # with: - # OAUTH2_PROXY_IMAGE: ${{ needs.Build.outputs.oauth2proxyCITag }} - # secrets: - # VAULT_HOST: ${{ secrets.VAULT_HOST }} - # VAULT_ROLE_ID: ${{ secrets.VAULT_ROLE_ID }} - # VAULT_SECRET_ID: ${{ secrets.VAULT_SECRET_ID }} + CI_Deploy_Test_HDS_AUTH_GATEWAY: + if: github.ref == 'refs/heads/edi-foundation-integration' + needs: [Blackduck, Build, Fortify, unit-test, CodeAnalysis] + uses: ./.github/workflows/api-gw-integrated-test.yaml + with: + OAUTH2_PROXY_IMAGE: ${{ needs.Build.outputs.oauth2proxyCITag }} + secrets: + VAULT_HOST: ${{ secrets.VAULT_HOST }} + VAULT_ROLE_ID: ${{ secrets.VAULT_ROLE_ID }} + VAULT_SECRET_ID: ${{ secrets.VAULT_SECRET_ID }} - # Promote_Version: - # needs: [CI_Deploy_Test_HDS_AUTH_GATEWAY] - # if: github.ref == 'refs/heads/edi-foundation-integration' - # runs-on: ubuntu-20.04 - # outputs: - # versionTag: ${{ steps.setVariables.outputs.versionTag }} - # steps: - # - uses: actions/checkout@v2 + Promote_Version: + needs: [CI_Deploy_Test_HDS_AUTH_GATEWAY] + if: github.ref == 'refs/heads/edi-foundation-integration' + runs-on: ubuntu-20.04 + outputs: + versionTag: ${{ steps.setVariables.outputs.versionTag }} + steps: + - uses: actions/checkout@v2 - # - name: Import Secrets - # id: secrets - # uses: hashicorp/vault-action@v2.3.1 - # with: - # url: ${{ secrets.VAULT_HOST }} - # method: approle - # roleId: ${{ secrets.VAULT_ROLE_ID }} - # secretId: ${{ secrets.VAULT_SECRET_ID }} - # exportEnv: true - # secrets: | - # devops/data/docker-repos/hsdp-edi endPoint | HSDP_DOCKER_REGISTRY ; - # devops/data/docker-repos/hsdp-edi user | HSDP_DOCKER_USER ; - # devops/data/docker-repos/hsdp-edi password | HSDP_DOCKER_PASSWORD ; + - name: Import Secrets + id: secrets + uses: hashicorp/vault-action@v2.3.1 + with: + url: ${{ secrets.VAULT_HOST }} + method: approle + roleId: ${{ secrets.VAULT_ROLE_ID }} + secretId: ${{ secrets.VAULT_SECRET_ID }} + exportEnv: true + secrets: | + devops/data/docker-repos/hsdp-edi endPoint | HSDP_DOCKER_REGISTRY ; + devops/data/docker-repos/hsdp-edi user | HSDP_DOCKER_USER ; + devops/data/docker-repos/hsdp-edi password | HSDP_DOCKER_PASSWORD ; - # - name: Set env variables - # id: setVariables - # run: | - # sudo apt update - # sudo apt install bumpversion - # bumpversion patch - # new_version=`cat VERSION` - # echo "New version is: $new_version" - # echo "CI_IMAGE=${{ env.HSDP_DOCKER_REGISTRY }}/edi-foundation-oauth2-proxy:${new_version}-beta" >> "$GITHUB_ENV" - # echo "RC_IMAGE=docker.na1.hsdp.io/edisp-releases/edi-foundation-oauth2-proxy:${new_version}-rc" >> "$GITHUB_ENV" - # echo "versionTag=${new_version}-rc" >> $GITHUB_OUTPUT - # echo "${new_version}-rc" + - name: Set env variables + id: setVariables + run: | + sudo apt update + sudo apt install bumpversion + bumpversion patch + new_version=`cat VERSION` + echo "New version is: $new_version" + echo "CI_IMAGE=${{ env.HSDP_DOCKER_REGISTRY }}/edi-foundation-oauth2-proxy:${new_version}-beta" >> "$GITHUB_ENV" + echo "RC_IMAGE=docker.na1.hsdp.io/edisp-releases/edi-foundation-oauth2-proxy:${new_version}-rc" >> "$GITHUB_ENV" + echo "versionTag=${new_version}-rc" >> $GITHUB_OUTPUT + echo "${new_version}-rc" - # - name: Docker login - # run: | - # docker login --username '${{ secrets.DOCKER_USER }}' --password '${{ secrets.DOCKER_PSWD }}' '${{ secrets.DOCKER_REPO }}' + - name: Docker login + run: | + docker login --username '${{ secrets.DOCKER_USER }}' --password '${{ secrets.DOCKER_PSWD }}' '${{ secrets.DOCKER_REPO }}' - # - name: Docker Push - # run: | - # docker pull ${{ env.CI_IMAGE }} - # docker tag ${{ env.CI_IMAGE }} ${{ env.RC_IMAGE }} - # docker push ${{ env.RC_IMAGE }} + - name: Docker Push + run: | + docker pull ${{ env.CI_IMAGE }} + docker tag ${{ env.CI_IMAGE }} ${{ env.RC_IMAGE }} + docker push ${{ env.RC_IMAGE }} - # Replace_OAuth2_Proxy_Tag_in_Terraform_API_Gateway: - # needs: [Promote_Version] - # if: github.ref == 'refs/heads/edi-foundation-integration' - # uses: ./.github/workflows/update-oauth2-proxy-version-at-api-gw.yaml - # with: - # OAUTH2_PROXY_IMAGE: ${{ needs.Promote_Version.outputs.versionTag }} - # secrets: - # VAULT_HOST: ${{ secrets.VAULT_HOST }} - # VAULT_ROLE_ID: ${{ secrets.VAULT_ROLE_ID }} - # VAULT_SECRET_ID: ${{ secrets.VAULT_SECRET_ID }} + Replace_OAuth2_Proxy_Tag_in_Terraform_API_Gateway: + needs: [Promote_Version] + if: github.ref == 'refs/heads/edi-foundation-integration' + uses: ./.github/workflows/update-oauth2-proxy-version-at-api-gw.yaml + with: + OAUTH2_PROXY_IMAGE: ${{ needs.Promote_Version.outputs.versionTag }} + secrets: + VAULT_HOST: ${{ secrets.VAULT_HOST }} + VAULT_ROLE_ID: ${{ secrets.VAULT_ROLE_ID }} + VAULT_SECRET_ID: ${{ secrets.VAULT_SECRET_ID }} From 5eae8373322ca471bc318fdc5f89706c1155bf84 Mon Sep 17 00:00:00 2001 From: aswin-in-philips Date: Wed, 29 Mar 2023 13:21:37 +0530 Subject: [PATCH 38/44] adding blackduck docker image scan --- .github/workflows/ci.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 69ad3ce4..43ecc9fe 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -3,8 +3,7 @@ name: CI on: push: branches: - - 'blackduck-image' - - $default-branch + - 'edi-foundation-integration' paths-ignore: - 'VERSION' - '.bumpversion.cfg' From 5e63c2a38d8e1c2fd6666d1869def3fef67cab3c Mon Sep 17 00:00:00 2001 From: aswin-in-philips Date: Wed, 29 Mar 2023 13:34:31 +0530 Subject: [PATCH 39/44] docker image scan check --- .github/workflows/ci.yaml | 328 +++++++++++++++++++------------------- 1 file changed, 164 insertions(+), 164 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 43ecc9fe..04a9cb18 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -3,7 +3,7 @@ name: CI on: push: branches: - - 'edi-foundation-integration' + - 'blackduck-image' paths-ignore: - 'VERSION' - '.bumpversion.cfg' @@ -12,115 +12,115 @@ on: workflow_dispatch: jobs: - Wokflow-Queue: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: ahmadnassri/action-workflow-queue@v1 + # Wokflow-Queue: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v2 + # - uses: ahmadnassri/action-workflow-queue@v1 - Init: - needs: [Wokflow-Queue] - runs-on: ubuntu-20.04 - outputs: - Version: ${{ steps.setVariables.outputs.version }} - steps: - - uses: actions/checkout@v2 - with: - token: ${{ secrets.ADMIN_TOKEN }} + # Init: + # needs: [Wokflow-Queue] + # runs-on: ubuntu-20.04 + # outputs: + # Version: ${{ steps.setVariables.outputs.version }} + # steps: + # - uses: actions/checkout@v2 + # with: + # token: ${{ secrets.ADMIN_TOKEN }} - - name: Extract branch name - uses: vazco/github-actions-branch-name@v1 - id: branch + # - name: Extract branch name + # uses: vazco/github-actions-branch-name@v1 + # id: branch - - name: Bump version - if: github.ref == 'refs/heads/edi-foundation-integration' - id: setVariables - run: | - sudo apt update - sudo apt install bumpversion - bumpversion patch - new_version=`cat VERSION` - echo "New version is: $new_version" - echo "version=$new_version" >> $GITHUB_OUTPUT - git config --global user.name "CI Build" - git config --global user.email "ci.build@philips.com" - git commit -am "Bump version $new_version" - git push --force + # - name: Bump version + # if: github.ref == 'refs/heads/edi-foundation-integration' + # id: setVariables + # run: | + # sudo apt update + # sudo apt install bumpversion + # bumpversion patch + # new_version=`cat VERSION` + # echo "New version is: $new_version" + # echo "version=$new_version" >> $GITHUB_OUTPUT + # git config --global user.name "CI Build" + # git config --global user.email "ci.build@philips.com" + # git commit -am "Bump version $new_version" + # git push --force - unit-test: - needs: [Init] - env: - COVER: true - runs-on: ubuntu-20.04 - steps: + # unit-test: + # needs: [Init] + # env: + # COVER: true + # runs-on: ubuntu-20.04 + # steps: - - name: Check out code - uses: actions/checkout@v2 + # - name: Check out code + # uses: actions/checkout@v2 - - name: Set up Go 1.16 - uses: actions/setup-go@v2 - with: - go-version: 1.16.x - id: go + # - name: Set up Go 1.16 + # uses: actions/setup-go@v2 + # with: + # go-version: 1.16.x + # id: go - - name: Get dependencies - run: | - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.36.0 - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter - chmod +x ./cc-test-reporter + # - name: Get dependencies + # run: | + # curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.36.0 + # curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter + # chmod +x ./cc-test-reporter - - name: Verify Code Generation - run: | - make verify-generate + # - name: Verify Code Generation + # run: | + # make verify-generate - - name: Lint - run: | - make lint + # - name: Lint + # run: | + # make lint - - name: Build - run: | - make build + # - name: Build + # run: | + # make build - - name: Test - env: - CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} - run: | - ./.github/workflows/test.sh + # - name: Test + # env: + # CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} + # run: | + # ./.github/workflows/test.sh - Fortify: - needs: [Init] - runs-on: builder_blr_2 - steps: - - name: checkout - uses: actions/checkout@v2 + # Fortify: + # needs: [Init] + # runs-on: builder_blr_2 + # steps: + # - name: checkout + # uses: actions/checkout@v2 - - name: Fortify scan - run: powershell -ExecutionPolicy RemoteSigned -NoExit -File ${{ github.workspace }}\build\ps\Invoke-FortifyScan.ps1 -PublishAuthToken ${{ secrets.FORTIFY_TOKEN }} + # - name: Fortify scan + # run: powershell -ExecutionPolicy RemoteSigned -NoExit -File ${{ github.workspace }}\build\ps\Invoke-FortifyScan.ps1 -PublishAuthToken ${{ secrets.FORTIFY_TOKEN }} - CodeAnalysis: - runs-on: builder_blr - needs: [Init] - steps: - - uses: actions/checkout@v2 + # CodeAnalysis: + # runs-on: builder_blr + # needs: [Init] + # steps: + # - uses: actions/checkout@v2 - - name: Set up Go 1.16 - uses: actions/setup-go@v2 - with: - go-version: 1.16.x - id: go + # - name: Set up Go 1.16 + # uses: actions/setup-go@v2 + # with: + # go-version: 1.16.x + # id: go - - name: coverage - run: | - go test -coverprofile=${{ github.workspace }}\coverage.out + # - name: coverage + # run: | + # go test -coverprofile=${{ github.workspace }}\coverage.out - - name: sonar - run: | - D:\SonarQube\Sonar-Scanner\sonar-scanner-cli-4.4.0.2170-windows\sonar-scanner-4.4.0.2170-windows\bin\sonar-scanner.bat -D"sonar.projectKey=EDI-hds-oauth2-proxy" -D"sonar.sources=." -D"sonar.tests=." -D"sonar.go.coverage.reportPaths=${{ github.workspace }}\coverage.out" -D"sonar.host.url=https://sonarqube.ta.philips.com/" -D"sonar.login=${{ secrets.SONAR_TOKEN }}" + # - name: sonar + # run: | + # D:\SonarQube\Sonar-Scanner\sonar-scanner-cli-4.4.0.2170-windows\sonar-scanner-4.4.0.2170-windows\bin\sonar-scanner.bat -D"sonar.projectKey=EDI-hds-oauth2-proxy" -D"sonar.sources=." -D"sonar.tests=." -D"sonar.go.coverage.reportPaths=${{ github.workspace }}\coverage.out" -D"sonar.host.url=https://sonarqube.ta.philips.com/" -D"sonar.login=${{ secrets.SONAR_TOKEN }}" Build: - needs: [Init] + #needs: [Init] runs-on: ubuntu-20.04 outputs: oauth2proxyPRTag: ${{ steps.setVariables.outputs.prTag }} @@ -174,7 +174,7 @@ jobs: docker tag '${{ secrets.DOCKER_REPO }}'/oauth2-proxy:latest ${{ env.PR_IMAGE }} - name: PR Image Docker Push - if: github.event_name == 'pull_request' + #if: github.event_name == 'pull_request' run: | docker push ${{ env.PR_IMAGE }} @@ -186,7 +186,7 @@ jobs: Blackduck: needs: [Build] - if: github.ref == 'refs/heads/edi-foundation-integration' + #if: github.ref == 'refs/heads/edi-foundation-integration' runs-on: builder_blr steps: - name: checkout @@ -200,87 +200,87 @@ jobs: - name: Pull CI Docker Image run: | docker login docker.na1.hsdp.io --username '${{ secrets.DOCKER_USER }}' --password '${{ secrets.DOCKER_PSWD }}' - docker pull docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:${{ needs.Build.outputs.oauth2proxyCITag }} + docker pull docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:${{ needs.Build.outputs.oauth2proxyPRTag }} - name: CI Blackduck Image Scan run: | - java -jar D:\synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --detect.go.path="C:\Program Files\Go\bin\go.exe" --blackduck.trust.cert=true --blackduck.api.token=${{ secrets.BLACKDUCK_TOKEN }} --blackduck.proxy.host=apac.zscaler.philips.com --blackduck.proxy.port=10015 --blackduck.proxy.ignored.hosts=blackduck.philips.com --detect.tools.excluded=BINARY_SCAN --detect.docker.image=docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:${{ needs.Build.outputs.oauth2proxyCITag }} --detect.blackduck.signature.scanner.local.path="C:\Users\ing07422\blackduck\tools\Black_Duck_Scan_Installation\scan.cli-2022.7.2" + java -jar D:\synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --detect.go.path="C:\Program Files\Go\bin\go.exe" --blackduck.trust.cert=true --blackduck.api.token=${{ secrets.BLACKDUCK_TOKEN }} --blackduck.proxy.host=apac.zscaler.philips.com --blackduck.proxy.port=10015 --blackduck.proxy.ignored.hosts=blackduck.philips.com --detect.tools.excluded=BAZEL,DETECTOR,SIGNATURE_SCAN,BINARY_SCAN,POLARIS --detect.docker.image=docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:${{ needs.Build.outputs.oauth2proxyPRTag }} --detect.blackduck.signature.scanner.local.path="C:\Users\ing07422\blackduck\tools\Black_Duck_Scan_Installation\scan.cli-2022.7.2" - PR_Deploy_Test_HDS_AUTH_GATEWAY: - if: github.event_name == 'pull_request' - needs: [Build, Fortify, unit-test, CodeAnalysis] - uses: ./.github/workflows/deploy-hds-auth-gateway.yaml - with: - OAUTH2_PROXY_IMAGE: ${{ needs.Build.outputs.oauth2proxyPRTag }} - secrets: - VAULT_HOST: ${{ secrets.VAULT_HOST }} - VAULT_ROLE_ID: ${{ secrets.VAULT_ROLE_ID }} - VAULT_SECRET_ID: ${{ secrets.VAULT_SECRET_ID }} + # PR_Deploy_Test_HDS_AUTH_GATEWAY: + # if: github.event_name == 'pull_request' + # needs: [Build, Fortify, unit-test, CodeAnalysis] + # uses: ./.github/workflows/deploy-hds-auth-gateway.yaml + # with: + # OAUTH2_PROXY_IMAGE: ${{ needs.Build.outputs.oauth2proxyPRTag }} + # secrets: + # VAULT_HOST: ${{ secrets.VAULT_HOST }} + # VAULT_ROLE_ID: ${{ secrets.VAULT_ROLE_ID }} + # VAULT_SECRET_ID: ${{ secrets.VAULT_SECRET_ID }} - CI_Deploy_Test_HDS_AUTH_GATEWAY: - if: github.ref == 'refs/heads/edi-foundation-integration' - needs: [Blackduck, Build, Fortify, unit-test, CodeAnalysis] - uses: ./.github/workflows/api-gw-integrated-test.yaml - with: - OAUTH2_PROXY_IMAGE: ${{ needs.Build.outputs.oauth2proxyCITag }} - secrets: - VAULT_HOST: ${{ secrets.VAULT_HOST }} - VAULT_ROLE_ID: ${{ secrets.VAULT_ROLE_ID }} - VAULT_SECRET_ID: ${{ secrets.VAULT_SECRET_ID }} + # CI_Deploy_Test_HDS_AUTH_GATEWAY: + # if: github.ref == 'refs/heads/edi-foundation-integration' + # needs: [Blackduck, Build, Fortify, unit-test, CodeAnalysis] + # uses: ./.github/workflows/api-gw-integrated-test.yaml + # with: + # OAUTH2_PROXY_IMAGE: ${{ needs.Build.outputs.oauth2proxyCITag }} + # secrets: + # VAULT_HOST: ${{ secrets.VAULT_HOST }} + # VAULT_ROLE_ID: ${{ secrets.VAULT_ROLE_ID }} + # VAULT_SECRET_ID: ${{ secrets.VAULT_SECRET_ID }} - Promote_Version: - needs: [CI_Deploy_Test_HDS_AUTH_GATEWAY] - if: github.ref == 'refs/heads/edi-foundation-integration' - runs-on: ubuntu-20.04 - outputs: - versionTag: ${{ steps.setVariables.outputs.versionTag }} - steps: - - uses: actions/checkout@v2 + # Promote_Version: + # needs: [CI_Deploy_Test_HDS_AUTH_GATEWAY] + # if: github.ref == 'refs/heads/edi-foundation-integration' + # runs-on: ubuntu-20.04 + # outputs: + # versionTag: ${{ steps.setVariables.outputs.versionTag }} + # steps: + # - uses: actions/checkout@v2 - - name: Import Secrets - id: secrets - uses: hashicorp/vault-action@v2.3.1 - with: - url: ${{ secrets.VAULT_HOST }} - method: approle - roleId: ${{ secrets.VAULT_ROLE_ID }} - secretId: ${{ secrets.VAULT_SECRET_ID }} - exportEnv: true - secrets: | - devops/data/docker-repos/hsdp-edi endPoint | HSDP_DOCKER_REGISTRY ; - devops/data/docker-repos/hsdp-edi user | HSDP_DOCKER_USER ; - devops/data/docker-repos/hsdp-edi password | HSDP_DOCKER_PASSWORD ; + # - name: Import Secrets + # id: secrets + # uses: hashicorp/vault-action@v2.3.1 + # with: + # url: ${{ secrets.VAULT_HOST }} + # method: approle + # roleId: ${{ secrets.VAULT_ROLE_ID }} + # secretId: ${{ secrets.VAULT_SECRET_ID }} + # exportEnv: true + # secrets: | + # devops/data/docker-repos/hsdp-edi endPoint | HSDP_DOCKER_REGISTRY ; + # devops/data/docker-repos/hsdp-edi user | HSDP_DOCKER_USER ; + # devops/data/docker-repos/hsdp-edi password | HSDP_DOCKER_PASSWORD ; - - name: Set env variables - id: setVariables - run: | - sudo apt update - sudo apt install bumpversion - bumpversion patch - new_version=`cat VERSION` - echo "New version is: $new_version" - echo "CI_IMAGE=${{ env.HSDP_DOCKER_REGISTRY }}/edi-foundation-oauth2-proxy:${new_version}-beta" >> "$GITHUB_ENV" - echo "RC_IMAGE=docker.na1.hsdp.io/edisp-releases/edi-foundation-oauth2-proxy:${new_version}-rc" >> "$GITHUB_ENV" - echo "versionTag=${new_version}-rc" >> $GITHUB_OUTPUT - echo "${new_version}-rc" + # - name: Set env variables + # id: setVariables + # run: | + # sudo apt update + # sudo apt install bumpversion + # bumpversion patch + # new_version=`cat VERSION` + # echo "New version is: $new_version" + # echo "CI_IMAGE=${{ env.HSDP_DOCKER_REGISTRY }}/edi-foundation-oauth2-proxy:${new_version}-beta" >> "$GITHUB_ENV" + # echo "RC_IMAGE=docker.na1.hsdp.io/edisp-releases/edi-foundation-oauth2-proxy:${new_version}-rc" >> "$GITHUB_ENV" + # echo "versionTag=${new_version}-rc" >> $GITHUB_OUTPUT + # echo "${new_version}-rc" - - name: Docker login - run: | - docker login --username '${{ secrets.DOCKER_USER }}' --password '${{ secrets.DOCKER_PSWD }}' '${{ secrets.DOCKER_REPO }}' + # - name: Docker login + # run: | + # docker login --username '${{ secrets.DOCKER_USER }}' --password '${{ secrets.DOCKER_PSWD }}' '${{ secrets.DOCKER_REPO }}' - - name: Docker Push - run: | - docker pull ${{ env.CI_IMAGE }} - docker tag ${{ env.CI_IMAGE }} ${{ env.RC_IMAGE }} - docker push ${{ env.RC_IMAGE }} + # - name: Docker Push + # run: | + # docker pull ${{ env.CI_IMAGE }} + # docker tag ${{ env.CI_IMAGE }} ${{ env.RC_IMAGE }} + # docker push ${{ env.RC_IMAGE }} - Replace_OAuth2_Proxy_Tag_in_Terraform_API_Gateway: - needs: [Promote_Version] - if: github.ref == 'refs/heads/edi-foundation-integration' - uses: ./.github/workflows/update-oauth2-proxy-version-at-api-gw.yaml - with: - OAUTH2_PROXY_IMAGE: ${{ needs.Promote_Version.outputs.versionTag }} - secrets: - VAULT_HOST: ${{ secrets.VAULT_HOST }} - VAULT_ROLE_ID: ${{ secrets.VAULT_ROLE_ID }} - VAULT_SECRET_ID: ${{ secrets.VAULT_SECRET_ID }} + # Replace_OAuth2_Proxy_Tag_in_Terraform_API_Gateway: + # needs: [Promote_Version] + # if: github.ref == 'refs/heads/edi-foundation-integration' + # uses: ./.github/workflows/update-oauth2-proxy-version-at-api-gw.yaml + # with: + # OAUTH2_PROXY_IMAGE: ${{ needs.Promote_Version.outputs.versionTag }} + # secrets: + # VAULT_HOST: ${{ secrets.VAULT_HOST }} + # VAULT_ROLE_ID: ${{ secrets.VAULT_ROLE_ID }} + # VAULT_SECRET_ID: ${{ secrets.VAULT_SECRET_ID }} From b823816c5b31dd737943e8b193fe69bb67e2039c Mon Sep 17 00:00:00 2001 From: aswin-in-philips Date: Wed, 29 Mar 2023 13:40:38 +0530 Subject: [PATCH 40/44] test --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 04a9cb18..ea4dda3d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -204,7 +204,7 @@ jobs: - name: CI Blackduck Image Scan run: | - java -jar D:\synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --detect.go.path="C:\Program Files\Go\bin\go.exe" --blackduck.trust.cert=true --blackduck.api.token=${{ secrets.BLACKDUCK_TOKEN }} --blackduck.proxy.host=apac.zscaler.philips.com --blackduck.proxy.port=10015 --blackduck.proxy.ignored.hosts=blackduck.philips.com --detect.tools.excluded=BAZEL,DETECTOR,SIGNATURE_SCAN,BINARY_SCAN,POLARIS --detect.docker.image=docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:${{ needs.Build.outputs.oauth2proxyPRTag }} --detect.blackduck.signature.scanner.local.path="C:\Users\ing07422\blackduck\tools\Black_Duck_Scan_Installation\scan.cli-2022.7.2" + java -jar D:\synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --detect.go.path="C:\Program Files\Go\bin\go.exe" --blackduck.trust.cert=true --blackduck.api.token=${{ secrets.BLACKDUCK_TOKEN }} --blackduck.proxy.host=apac.zscaler.philips.com --blackduck.proxy.port=10015 --blackduck.proxy.ignored.hosts=blackduck.philips.com --detect.tools.excluded=BAZEL,SIGNATURE_SCAN,BINARY_SCAN,POLARIS --detect.docker.image=docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:${{ needs.Build.outputs.oauth2proxyPRTag }} --detect.blackduck.signature.scanner.local.path="C:\Users\ing07422\blackduck\tools\Black_Duck_Scan_Installation\scan.cli-2022.7.2" # PR_Deploy_Test_HDS_AUTH_GATEWAY: # if: github.event_name == 'pull_request' From 417cbf194b8ff5c93518db5487e198b5551621ff Mon Sep 17 00:00:00 2001 From: aswin-in-philips Date: Wed, 29 Mar 2023 13:45:51 +0530 Subject: [PATCH 41/44] test --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ea4dda3d..a60d6009 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -204,7 +204,7 @@ jobs: - name: CI Blackduck Image Scan run: | - java -jar D:\synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --detect.go.path="C:\Program Files\Go\bin\go.exe" --blackduck.trust.cert=true --blackduck.api.token=${{ secrets.BLACKDUCK_TOKEN }} --blackduck.proxy.host=apac.zscaler.philips.com --blackduck.proxy.port=10015 --blackduck.proxy.ignored.hosts=blackduck.philips.com --detect.tools.excluded=BAZEL,SIGNATURE_SCAN,BINARY_SCAN,POLARIS --detect.docker.image=docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:${{ needs.Build.outputs.oauth2proxyPRTag }} --detect.blackduck.signature.scanner.local.path="C:\Users\ing07422\blackduck\tools\Black_Duck_Scan_Installation\scan.cli-2022.7.2" + java -jar D:\synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --detect.go.path="C:\Program Files\Go\bin\go.exe" --blackduck.trust.cert=true --blackduck.api.token=${{ secrets.BLACKDUCK_TOKEN }} --blackduck.proxy.host=apac.zscaler.philips.com --blackduck.proxy.port=10015 --blackduck.proxy.ignored.hosts=blackduck.philips.com --detect.tools.excluded=BINARY_SCAN --detect.docker.image=docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:${{ needs.Build.outputs.oauth2proxyPRTag }} --detect.blackduck.signature.scanner.local.path="C:\Users\ing07422\blackduck\tools\Black_Duck_Scan_Installation\scan.cli-2022.7.2" # PR_Deploy_Test_HDS_AUTH_GATEWAY: # if: github.event_name == 'pull_request' From 3a7e192c97142e6b96c1d1c355dc7dc7c7c97f04 Mon Sep 17 00:00:00 2001 From: aswin-in-philips Date: Wed, 29 Mar 2023 14:18:49 +0530 Subject: [PATCH 42/44] test --- .github/workflows/ci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a60d6009..c29be42e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -204,6 +204,7 @@ jobs: - name: CI Blackduck Image Scan run: | + cd D:\test-bs java -jar D:\synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --detect.go.path="C:\Program Files\Go\bin\go.exe" --blackduck.trust.cert=true --blackduck.api.token=${{ secrets.BLACKDUCK_TOKEN }} --blackduck.proxy.host=apac.zscaler.philips.com --blackduck.proxy.port=10015 --blackduck.proxy.ignored.hosts=blackduck.philips.com --detect.tools.excluded=BINARY_SCAN --detect.docker.image=docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:${{ needs.Build.outputs.oauth2proxyPRTag }} --detect.blackduck.signature.scanner.local.path="C:\Users\ing07422\blackduck\tools\Black_Duck_Scan_Installation\scan.cli-2022.7.2" # PR_Deploy_Test_HDS_AUTH_GATEWAY: From 14a4721bcac1d4b69553e8ab2a1add3196999821 Mon Sep 17 00:00:00 2001 From: aswin-in-philips Date: Wed, 29 Mar 2023 14:30:55 +0530 Subject: [PATCH 43/44] adding blackduck docker image scan --- .github/workflows/ci.yaml | 326 +++++++++++++++++++------------------- 1 file changed, 163 insertions(+), 163 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c29be42e..9505e417 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -12,115 +12,115 @@ on: workflow_dispatch: jobs: - # Wokflow-Queue: - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v2 - # - uses: ahmadnassri/action-workflow-queue@v1 + Wokflow-Queue: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: ahmadnassri/action-workflow-queue@v1 - # Init: - # needs: [Wokflow-Queue] - # runs-on: ubuntu-20.04 - # outputs: - # Version: ${{ steps.setVariables.outputs.version }} - # steps: - # - uses: actions/checkout@v2 - # with: - # token: ${{ secrets.ADMIN_TOKEN }} + Init: + needs: [Wokflow-Queue] + runs-on: ubuntu-20.04 + outputs: + Version: ${{ steps.setVariables.outputs.version }} + steps: + - uses: actions/checkout@v2 + with: + token: ${{ secrets.ADMIN_TOKEN }} - # - name: Extract branch name - # uses: vazco/github-actions-branch-name@v1 - # id: branch + - name: Extract branch name + uses: vazco/github-actions-branch-name@v1 + id: branch - # - name: Bump version - # if: github.ref == 'refs/heads/edi-foundation-integration' - # id: setVariables - # run: | - # sudo apt update - # sudo apt install bumpversion - # bumpversion patch - # new_version=`cat VERSION` - # echo "New version is: $new_version" - # echo "version=$new_version" >> $GITHUB_OUTPUT - # git config --global user.name "CI Build" - # git config --global user.email "ci.build@philips.com" - # git commit -am "Bump version $new_version" - # git push --force + - name: Bump version + if: github.ref == 'refs/heads/edi-foundation-integration' + id: setVariables + run: | + sudo apt update + sudo apt install bumpversion + bumpversion patch + new_version=`cat VERSION` + echo "New version is: $new_version" + echo "version=$new_version" >> $GITHUB_OUTPUT + git config --global user.name "CI Build" + git config --global user.email "ci.build@philips.com" + git commit -am "Bump version $new_version" + git push --force - # unit-test: - # needs: [Init] - # env: - # COVER: true - # runs-on: ubuntu-20.04 - # steps: + unit-test: + needs: [Init] + env: + COVER: true + runs-on: ubuntu-20.04 + steps: - # - name: Check out code - # uses: actions/checkout@v2 + - name: Check out code + uses: actions/checkout@v2 - # - name: Set up Go 1.16 - # uses: actions/setup-go@v2 - # with: - # go-version: 1.16.x - # id: go + - name: Set up Go 1.16 + uses: actions/setup-go@v2 + with: + go-version: 1.16.x + id: go - # - name: Get dependencies - # run: | - # curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.36.0 - # curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter - # chmod +x ./cc-test-reporter + - name: Get dependencies + run: | + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.36.0 + curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter + chmod +x ./cc-test-reporter - # - name: Verify Code Generation - # run: | - # make verify-generate + - name: Verify Code Generation + run: | + make verify-generate - # - name: Lint - # run: | - # make lint + - name: Lint + run: | + make lint - # - name: Build - # run: | - # make build + - name: Build + run: | + make build - # - name: Test - # env: - # CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} - # run: | - # ./.github/workflows/test.sh + - name: Test + env: + CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} + run: | + ./.github/workflows/test.sh - # Fortify: - # needs: [Init] - # runs-on: builder_blr_2 - # steps: - # - name: checkout - # uses: actions/checkout@v2 + Fortify: + needs: [Init] + runs-on: builder_blr_2 + steps: + - name: checkout + uses: actions/checkout@v2 - # - name: Fortify scan - # run: powershell -ExecutionPolicy RemoteSigned -NoExit -File ${{ github.workspace }}\build\ps\Invoke-FortifyScan.ps1 -PublishAuthToken ${{ secrets.FORTIFY_TOKEN }} + - name: Fortify scan + run: powershell -ExecutionPolicy RemoteSigned -NoExit -File ${{ github.workspace }}\build\ps\Invoke-FortifyScan.ps1 -PublishAuthToken ${{ secrets.FORTIFY_TOKEN }} - # CodeAnalysis: - # runs-on: builder_blr - # needs: [Init] - # steps: - # - uses: actions/checkout@v2 + CodeAnalysis: + runs-on: builder_blr + needs: [Init] + steps: + - uses: actions/checkout@v2 - # - name: Set up Go 1.16 - # uses: actions/setup-go@v2 - # with: - # go-version: 1.16.x - # id: go + - name: Set up Go 1.16 + uses: actions/setup-go@v2 + with: + go-version: 1.16.x + id: go - # - name: coverage - # run: | - # go test -coverprofile=${{ github.workspace }}\coverage.out + - name: coverage + run: | + go test -coverprofile=${{ github.workspace }}\coverage.out - # - name: sonar - # run: | - # D:\SonarQube\Sonar-Scanner\sonar-scanner-cli-4.4.0.2170-windows\sonar-scanner-4.4.0.2170-windows\bin\sonar-scanner.bat -D"sonar.projectKey=EDI-hds-oauth2-proxy" -D"sonar.sources=." -D"sonar.tests=." -D"sonar.go.coverage.reportPaths=${{ github.workspace }}\coverage.out" -D"sonar.host.url=https://sonarqube.ta.philips.com/" -D"sonar.login=${{ secrets.SONAR_TOKEN }}" + - name: sonar + run: | + D:\SonarQube\Sonar-Scanner\sonar-scanner-cli-4.4.0.2170-windows\sonar-scanner-4.4.0.2170-windows\bin\sonar-scanner.bat -D"sonar.projectKey=EDI-hds-oauth2-proxy" -D"sonar.sources=." -D"sonar.tests=." -D"sonar.go.coverage.reportPaths=${{ github.workspace }}\coverage.out" -D"sonar.host.url=https://sonarqube.ta.philips.com/" -D"sonar.login=${{ secrets.SONAR_TOKEN }}" Build: - #needs: [Init] + needs: [Init] runs-on: ubuntu-20.04 outputs: oauth2proxyPRTag: ${{ steps.setVariables.outputs.prTag }} @@ -174,7 +174,7 @@ jobs: docker tag '${{ secrets.DOCKER_REPO }}'/oauth2-proxy:latest ${{ env.PR_IMAGE }} - name: PR Image Docker Push - #if: github.event_name == 'pull_request' + if: github.event_name == 'pull_request' run: | docker push ${{ env.PR_IMAGE }} @@ -186,7 +186,7 @@ jobs: Blackduck: needs: [Build] - #if: github.ref == 'refs/heads/edi-foundation-integration' + if: github.ref == 'refs/heads/edi-foundation-integration' runs-on: builder_blr steps: - name: checkout @@ -200,88 +200,88 @@ jobs: - name: Pull CI Docker Image run: | docker login docker.na1.hsdp.io --username '${{ secrets.DOCKER_USER }}' --password '${{ secrets.DOCKER_PSWD }}' - docker pull docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:${{ needs.Build.outputs.oauth2proxyPRTag }} + docker pull docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:${{ needs.Build.outputs.oauth2proxyCITag }} - name: CI Blackduck Image Scan run: | cd D:\test-bs - java -jar D:\synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --detect.go.path="C:\Program Files\Go\bin\go.exe" --blackduck.trust.cert=true --blackduck.api.token=${{ secrets.BLACKDUCK_TOKEN }} --blackduck.proxy.host=apac.zscaler.philips.com --blackduck.proxy.port=10015 --blackduck.proxy.ignored.hosts=blackduck.philips.com --detect.tools.excluded=BINARY_SCAN --detect.docker.image=docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:${{ needs.Build.outputs.oauth2proxyPRTag }} --detect.blackduck.signature.scanner.local.path="C:\Users\ing07422\blackduck\tools\Black_Duck_Scan_Installation\scan.cli-2022.7.2" + java -jar D:\synopsys-detect-8.3.0.jar --detect.project.name=SA_edifoundation-oauth2proxy --detect.project.version.name=1.0 --blackduck.url=https://blackduck.philips.com/ --detect.go.path="C:\Program Files\Go\bin\go.exe" --blackduck.trust.cert=true --blackduck.api.token=${{ secrets.BLACKDUCK_TOKEN }} --blackduck.proxy.host=apac.zscaler.philips.com --blackduck.proxy.port=10015 --blackduck.proxy.ignored.hosts=blackduck.philips.com --detect.tools.excluded=BINARY_SCAN --detect.docker.image=docker.na1.hsdp.io/edi/edi-foundation-oauth2-proxy:${{ needs.Build.outputs.oauth2proxyCITag }} --detect.blackduck.signature.scanner.local.path="C:\Users\ing07422\blackduck\tools\Black_Duck_Scan_Installation\scan.cli-2022.7.2" - # PR_Deploy_Test_HDS_AUTH_GATEWAY: - # if: github.event_name == 'pull_request' - # needs: [Build, Fortify, unit-test, CodeAnalysis] - # uses: ./.github/workflows/deploy-hds-auth-gateway.yaml - # with: - # OAUTH2_PROXY_IMAGE: ${{ needs.Build.outputs.oauth2proxyPRTag }} - # secrets: - # VAULT_HOST: ${{ secrets.VAULT_HOST }} - # VAULT_ROLE_ID: ${{ secrets.VAULT_ROLE_ID }} - # VAULT_SECRET_ID: ${{ secrets.VAULT_SECRET_ID }} + PR_Deploy_Test_HDS_AUTH_GATEWAY: + if: github.event_name == 'pull_request' + needs: [Build, Fortify, unit-test, CodeAnalysis] + uses: ./.github/workflows/deploy-hds-auth-gateway.yaml + with: + OAUTH2_PROXY_IMAGE: ${{ needs.Build.outputs.oauth2proxyPRTag }} + secrets: + VAULT_HOST: ${{ secrets.VAULT_HOST }} + VAULT_ROLE_ID: ${{ secrets.VAULT_ROLE_ID }} + VAULT_SECRET_ID: ${{ secrets.VAULT_SECRET_ID }} - # CI_Deploy_Test_HDS_AUTH_GATEWAY: - # if: github.ref == 'refs/heads/edi-foundation-integration' - # needs: [Blackduck, Build, Fortify, unit-test, CodeAnalysis] - # uses: ./.github/workflows/api-gw-integrated-test.yaml - # with: - # OAUTH2_PROXY_IMAGE: ${{ needs.Build.outputs.oauth2proxyCITag }} - # secrets: - # VAULT_HOST: ${{ secrets.VAULT_HOST }} - # VAULT_ROLE_ID: ${{ secrets.VAULT_ROLE_ID }} - # VAULT_SECRET_ID: ${{ secrets.VAULT_SECRET_ID }} + CI_Deploy_Test_HDS_AUTH_GATEWAY: + if: github.ref == 'refs/heads/edi-foundation-integration' + needs: [Blackduck, Build, Fortify, unit-test, CodeAnalysis] + uses: ./.github/workflows/api-gw-integrated-test.yaml + with: + OAUTH2_PROXY_IMAGE: ${{ needs.Build.outputs.oauth2proxyCITag }} + secrets: + VAULT_HOST: ${{ secrets.VAULT_HOST }} + VAULT_ROLE_ID: ${{ secrets.VAULT_ROLE_ID }} + VAULT_SECRET_ID: ${{ secrets.VAULT_SECRET_ID }} - # Promote_Version: - # needs: [CI_Deploy_Test_HDS_AUTH_GATEWAY] - # if: github.ref == 'refs/heads/edi-foundation-integration' - # runs-on: ubuntu-20.04 - # outputs: - # versionTag: ${{ steps.setVariables.outputs.versionTag }} - # steps: - # - uses: actions/checkout@v2 + Promote_Version: + needs: [CI_Deploy_Test_HDS_AUTH_GATEWAY] + if: github.ref == 'refs/heads/edi-foundation-integration' + runs-on: ubuntu-20.04 + outputs: + versionTag: ${{ steps.setVariables.outputs.versionTag }} + steps: + - uses: actions/checkout@v2 - # - name: Import Secrets - # id: secrets - # uses: hashicorp/vault-action@v2.3.1 - # with: - # url: ${{ secrets.VAULT_HOST }} - # method: approle - # roleId: ${{ secrets.VAULT_ROLE_ID }} - # secretId: ${{ secrets.VAULT_SECRET_ID }} - # exportEnv: true - # secrets: | - # devops/data/docker-repos/hsdp-edi endPoint | HSDP_DOCKER_REGISTRY ; - # devops/data/docker-repos/hsdp-edi user | HSDP_DOCKER_USER ; - # devops/data/docker-repos/hsdp-edi password | HSDP_DOCKER_PASSWORD ; + - name: Import Secrets + id: secrets + uses: hashicorp/vault-action@v2.3.1 + with: + url: ${{ secrets.VAULT_HOST }} + method: approle + roleId: ${{ secrets.VAULT_ROLE_ID }} + secretId: ${{ secrets.VAULT_SECRET_ID }} + exportEnv: true + secrets: | + devops/data/docker-repos/hsdp-edi endPoint | HSDP_DOCKER_REGISTRY ; + devops/data/docker-repos/hsdp-edi user | HSDP_DOCKER_USER ; + devops/data/docker-repos/hsdp-edi password | HSDP_DOCKER_PASSWORD ; - # - name: Set env variables - # id: setVariables - # run: | - # sudo apt update - # sudo apt install bumpversion - # bumpversion patch - # new_version=`cat VERSION` - # echo "New version is: $new_version" - # echo "CI_IMAGE=${{ env.HSDP_DOCKER_REGISTRY }}/edi-foundation-oauth2-proxy:${new_version}-beta" >> "$GITHUB_ENV" - # echo "RC_IMAGE=docker.na1.hsdp.io/edisp-releases/edi-foundation-oauth2-proxy:${new_version}-rc" >> "$GITHUB_ENV" - # echo "versionTag=${new_version}-rc" >> $GITHUB_OUTPUT - # echo "${new_version}-rc" + - name: Set env variables + id: setVariables + run: | + sudo apt update + sudo apt install bumpversion + bumpversion patch + new_version=`cat VERSION` + echo "New version is: $new_version" + echo "CI_IMAGE=${{ env.HSDP_DOCKER_REGISTRY }}/edi-foundation-oauth2-proxy:${new_version}-beta" >> "$GITHUB_ENV" + echo "RC_IMAGE=docker.na1.hsdp.io/edisp-releases/edi-foundation-oauth2-proxy:${new_version}-rc" >> "$GITHUB_ENV" + echo "versionTag=${new_version}-rc" >> $GITHUB_OUTPUT + echo "${new_version}-rc" - # - name: Docker login - # run: | - # docker login --username '${{ secrets.DOCKER_USER }}' --password '${{ secrets.DOCKER_PSWD }}' '${{ secrets.DOCKER_REPO }}' + - name: Docker login + run: | + docker login --username '${{ secrets.DOCKER_USER }}' --password '${{ secrets.DOCKER_PSWD }}' '${{ secrets.DOCKER_REPO }}' - # - name: Docker Push - # run: | - # docker pull ${{ env.CI_IMAGE }} - # docker tag ${{ env.CI_IMAGE }} ${{ env.RC_IMAGE }} - # docker push ${{ env.RC_IMAGE }} + - name: Docker Push + run: | + docker pull ${{ env.CI_IMAGE }} + docker tag ${{ env.CI_IMAGE }} ${{ env.RC_IMAGE }} + docker push ${{ env.RC_IMAGE }} - # Replace_OAuth2_Proxy_Tag_in_Terraform_API_Gateway: - # needs: [Promote_Version] - # if: github.ref == 'refs/heads/edi-foundation-integration' - # uses: ./.github/workflows/update-oauth2-proxy-version-at-api-gw.yaml - # with: - # OAUTH2_PROXY_IMAGE: ${{ needs.Promote_Version.outputs.versionTag }} - # secrets: - # VAULT_HOST: ${{ secrets.VAULT_HOST }} - # VAULT_ROLE_ID: ${{ secrets.VAULT_ROLE_ID }} - # VAULT_SECRET_ID: ${{ secrets.VAULT_SECRET_ID }} + Replace_OAuth2_Proxy_Tag_in_Terraform_API_Gateway: + needs: [Promote_Version] + if: github.ref == 'refs/heads/edi-foundation-integration' + uses: ./.github/workflows/update-oauth2-proxy-version-at-api-gw.yaml + with: + OAUTH2_PROXY_IMAGE: ${{ needs.Promote_Version.outputs.versionTag }} + secrets: + VAULT_HOST: ${{ secrets.VAULT_HOST }} + VAULT_ROLE_ID: ${{ secrets.VAULT_ROLE_ID }} + VAULT_SECRET_ID: ${{ secrets.VAULT_SECRET_ID }} From 42a9a99f265649664596d2f30d747d9d22c16e44 Mon Sep 17 00:00:00 2001 From: aswin-in-philips Date: Wed, 29 Mar 2023 14:33:44 +0530 Subject: [PATCH 44/44] adding blackduck docker image scan --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9505e417..cbd91350 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -3,7 +3,7 @@ name: CI on: push: branches: - - 'blackduck-image' + - 'edi-foundation-integration' paths-ignore: - 'VERSION' - '.bumpversion.cfg'