-
Notifications
You must be signed in to change notification settings - Fork 115
Fix vulnerabilities #583
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Fix vulnerabilities #583
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
34fa28f
test
vishiy 12e17ec
test1
vishiy a6fe6f4
test-2
vishiy 7160d54
test-3
vishiy f40ba42
3
vishiy 76d34ce
4
vishiy 9ae9a25
test
vishiy cfa43e7
2
vishiy e5a3c34
3
vishiy 08ef371
4
vishiy cc16e44
5
vishiy 004bcbb
6
vishiy 2478fa4
rename gem for windows
vishiy 9250e1d
fix
vishiy 032991c
fix
vishiy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| name: pullrequest-build-and-scan | ||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize, reopened] | ||
| branches: | ||
| - ci_dev | ||
| - ci_prod | ||
| paths-ignore: | ||
| - '**.md' | ||
| jobs: | ||
| LINUX-build-and-scan: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Set-workflow-initiator | ||
| run: echo "Initiated by - ${GITHUB_ACTOR}" | ||
| - name: Set-branch-name-for-pr | ||
| if: ${{ github.event_name == 'pull_request' }} | ||
| run: echo "BRANCH_NAME=$(echo ${GITHUB_HEAD_REF} | tr / _)" >> $GITHUB_ENV | ||
| - name: Set-Env | ||
| run: echo "ENV=dev" >> $GITHUB_ENV | ||
| - name: Set-ACR-Registry | ||
| run: echo "ACR_REGISTRY=containerinsightsprod.azurecr.io" >> $GITHUB_ENV | ||
| - name: Set-ACR-Repository | ||
| run: echo "ACR_REPOSITORY=/public/azuremonitor/containerinsights/cidev" >> $GITHUB_ENV | ||
| - name: Set-image-tag-name | ||
| run: echo "IMAGE_TAG_NAME=cidev" >> $GITHUB_ENV | ||
| - name: Set-image-tag-suffix | ||
| run: echo "IMAGE_TAG_DATE=$(date +%m-%d-%Y)" >> $GITHUB_ENV | ||
| - name: Set-commit-sha | ||
| run: echo "COMMIT_SHA=${GITHUB_SHA::8}" >> $GITHUB_ENV | ||
| - name: Set-image-tag | ||
| run: echo "IMAGETAG=${ACR_REGISTRY}${ACR_REPOSITORY}:${IMAGE_TAG_NAME}-${BRANCH_NAME}-${IMAGE_TAG_DATE}-${COMMIT_SHA}" >> $GITHUB_ENV | ||
| - name: Set-image-telemetry-tag | ||
| run: echo "IMAGETAG_TELEMETRY=${IMAGE_TAG_NAME}-${BRANCH_NAME}-${IMAGE_TAG_DATE}-${COMMIT_SHA}" >> $GITHUB_ENV | ||
| - name: Set-Helm-OCI-Experimental-feature | ||
| run: echo "HELM_EXPERIMENTAL_OCI=1" >> $GITHUB_ENV | ||
| - name: Set-Helm-chart-version | ||
| run: echo "HELM_CHART_VERSION=0.0.1" >> $GITHUB_ENV | ||
| - name: Set-Helm-tag | ||
| run: echo "HELMTAG=${ACR_REGISTRY}${ACR_REPOSITORY}:${IMAGE_TAG_NAME}-chart-${BRANCH_NAME}-${HELM_CHART_VERSION}-${IMAGE_TAG_DATE}-${COMMIT_SHA}" >> $GITHUB_ENV | ||
| - name: Checkout-code | ||
| uses: actions/checkout@v2 | ||
| - name: Show-versions-On-build-machine | ||
| run: lsb_release -a && go version && helm version && docker version | ||
| - name: Install-build-dependencies | ||
| run: sudo apt-get install build-essential -y | ||
| - name: Build-source-code | ||
| run: cd ./build/linux/ && make | ||
| - name: Create-docker-image | ||
| run: | | ||
| cd ./kubernetes/linux/ && docker build . --file Dockerfile -t $IMAGETAG --build-arg IMAGE_TAG=$IMAGETAG_TELEMETRY | ||
| - name: List-docker-images | ||
| run: docker images --digests --all | ||
| - name: Run-trivy-scanner-on-docker-image | ||
| uses: aquasecurity/trivy-action@master | ||
| with: | ||
| image-ref: "${{ env.IMAGETAG }}" | ||
| format: 'table' | ||
| severity: 'CRITICAL,HIGH' | ||
| vuln-type: 'os,library' | ||
| skip-dirs: 'opt/telegraf' | ||
| exit-code: '1' | ||
| timeout: '5m0s' | ||
| WINDOWS-build: | ||
| runs-on: windows-latest | ||
| steps: | ||
| - name: Set-workflow-initiator | ||
| run: echo ("Initiated by -" + $env:GITHUB_ACTOR) | ||
| - name: Set-branch-name-for-pr | ||
| if: ${{ github.event_name == 'pull_request' }} | ||
| run: echo ("BRANCH_NAME=" + $env:GITHUB_HEAD_REF.replace('/','_')) >> $env:GITHUB_ENV | ||
| - name: Set-Env | ||
| run: echo ("ENV=dev") >> $env:GITHUB_ENV | ||
| - name: Set-ACR-Registry | ||
| run: echo ("ACR_REGISTRY=containerinsightsprod.azurecr.io") >> $env:GITHUB_ENV | ||
| - name: Set-ACR-Repository | ||
| run: echo ("ACR_REPOSITORY=/public/azuremonitor/containerinsights/cidev") >> $env:GITHUB_ENV | ||
| - name: Set-image-tag-name | ||
| run: echo ("IMAGE_TAG_NAME=cidev-win") >> $env:GITHUB_ENV | ||
| - name: Set-image-tag-suffix | ||
| run: echo ("IMAGE_TAG_DATE="+ (Get-Date -Format "MM-dd-yyyy")) >> $env:GITHUB_ENV | ||
| - name: Set-commit-sha | ||
| run: echo ("COMMIT_SHA=" + $env:GITHUB_SHA.SubString(0,8)) >> $env:GITHUB_ENV | ||
| - name: Set-image-tag | ||
| run: echo ("IMAGETAG=" + $env:ACR_REGISTRY + $env:ACR_REPOSITORY + ":" + $env:IMAGE_TAG_NAME + "-" + $env:BRANCH_NAME + "-" + $env:IMAGE_TAG_DATE + "-" + $env:COMMIT_SHA) >> $env:GITHUB_ENV | ||
| - name: Set-image-telemetry-tag | ||
| run: echo ("IMAGETAG_TELEMETRY=" + $env:IMAGE_TAG_NAME + "-" + $env:BRANCH_NAME + "-" + $env:IMAGE_TAG_DATE + "-" + $env:COMMIT_SHA) >> $env:GITHUB_ENV | ||
| - name: Checkout-code | ||
| uses: actions/checkout@v2 | ||
| - name: Show-versions-On-build-machine | ||
| run: systeminfo && go version && docker version | ||
| - name: Build-source-code | ||
| run: cd ./build/windows/ && & .\Makefile.ps1 | ||
| - name: Create-docker-image | ||
| run: | | ||
| cd ./kubernetes/windows/ && docker build . --file Dockerfile -t $env:IMAGETAG --build-arg IMAGE_TAG=$env:IMAGETAG_TELEMETRY | ||
| - name: List-docker-images | ||
| run: docker images --digests --all | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.