-
Notifications
You must be signed in to change notification settings - Fork 796
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2163 from consideRatio/pr/vuln-scan-permissions
ci: precautions for security, update github_token permissions, pin actions
- Loading branch information
Showing
3 changed files
with
33 additions
and
26 deletions.
There are no files selected for viewing
This file contains 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 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 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 |
---|---|---|
|
@@ -18,6 +18,8 @@ jobs: | |
trivy_image_scan: | ||
if: github.repository == 'jupyterhub/zero-to-jupyterhub-k8s' | ||
runs-on: ubuntu-20.04 | ||
permissions: | ||
contents: write | ||
|
||
strategy: | ||
fail-fast: false | ||
|
@@ -68,7 +70,7 @@ jobs: | |
# Action reference: https:/aquasecurity/trivy-action | ||
- name: Scan latest published image | ||
id: scan_1 | ||
uses: aquasecurity/trivy-action@master | ||
uses: aquasecurity/trivy-action@b38389f8efef9798810fe0c5b5096ac198cffd54 # associated tag: 0.0.14 | ||
with: | ||
image-ref: ${{ steps.image.outputs.spec }} | ||
format: json # ref: https:/aquasecurity/trivy#save-the-results-as-json | ||
|
@@ -91,7 +93,7 @@ jobs: | |
- name: Scan rebuilt image | ||
id: scan_2 | ||
if: steps.rebuild.outcome == 'success' | ||
uses: aquasecurity/trivy-action@master | ||
uses: aquasecurity/trivy-action@b38389f8efef9798810fe0c5b5096ac198cffd54 # associated tag: 0.0.14 | ||
with: | ||
image-ref: rebuilt-image | ||
format: json # ref: https:/aquasecurity/trivy#save-the-results-as-json | ||
|
@@ -150,7 +152,7 @@ jobs: | |
- name: Describe vulnerabilities | ||
if: steps.rebuild.outcome == 'success' | ||
uses: aquasecurity/trivy-action@master | ||
uses: aquasecurity/trivy-action@b38389f8efef9798810fe0c5b5096ac198cffd54 # associated tag: 0.0.14 | ||
with: | ||
image-ref: rebuilt-image | ||
format: table | ||
|
@@ -169,7 +171,7 @@ jobs: | |
# ref: https:/jacobtomlinson/gha-find-replace | ||
- name: Update VULN_SCAN_TIME in Dockerfile | ||
if: steps.analyze.outputs.proceed == 'yes' | ||
uses: jacobtomlinson/[email protected] | ||
uses: jacobtomlinson/gha-find-replace@f9e200cf233bcde71011fa5e4178037881764379 # associated tag: 0.1.3 | ||
with: | ||
include: "images/${{ matrix.image_ref }}/Dockerfile" | ||
find: "#.*VULN_SCAN_TIME=.*" | ||
|
@@ -182,7 +184,7 @@ jobs: | |
# ref: https:/peter-evans/create-pull-request | ||
- name: Create or update a PR | ||
if: steps.analyze.outputs.proceed == 'yes' | ||
uses: peter-evans/create-pull-request@052fc72b4198ba9fbc81b818c6e1859f747d49a8 | ||
uses: peter-evans/create-pull-request@052fc72b4198ba9fbc81b818c6e1859f747d49a8 # associated tag: v3.8.2 | ||
with: | ||
token: "${{ secrets.GITHUB_TOKEN }}" | ||
author: jupyterhub vuln-scan bot <[email protected]> | ||
|