Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c07df6fec6 | |||
| df678dbccf | |||
| cf5c088a69 | |||
| 476e4fdcdc | |||
| 52d14fa83d | |||
| e671314e1a | |||
| bfa4b33a02 | |||
| 68b488a75b | |||
| 314ff8b431 |
@@ -10,13 +10,13 @@ on:
|
||||
|
||||
run-name: Bump trivy to v${{ inputs.trivy_version }}
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
bump:
|
||||
runs-on: ubuntu-2404-2core
|
||||
permissions:
|
||||
contents: read # for actions/checkout
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
@@ -42,9 +42,21 @@ jobs:
|
||||
BATS_LIB_PATH: ${{ steps.setup-bats.outputs.lib-path }}
|
||||
run: make test
|
||||
|
||||
# Use a GitHub App token because GITHUB_TOKEN does not trigger CI on PRs created by workflows
|
||||
- name: Generate token
|
||||
id: app-token
|
||||
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
|
||||
with:
|
||||
client-id: ${{ secrets.REPO_TRIVY_ACTION_WRITE_GH_APP_CLIENT_ID }}
|
||||
private-key: ${{ secrets.REPO_TRIVY_ACTION_WRITE_GH_APP_PRIVATE_KEY }}
|
||||
owner: ${{ github.repository_owner }}
|
||||
repositories: ${{ github.event.repository.name }}
|
||||
permission-contents: write
|
||||
permission-pull-requests: write
|
||||
|
||||
- name: Create PR
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.TRIVY_ACTION_DEPLOY_TOKEN }}
|
||||
GH_TOKEN: ${{ steps.app-token.outputs.token }}
|
||||
TRIVY_VERSION: ${{ inputs.trivy_version }}
|
||||
REPO: ${{ github.repository }}
|
||||
BASE_BRANCH: ${{ github.event.repository.default_branch }}
|
||||
|
||||
@@ -14,12 +14,12 @@ jobs:
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Run zizmor
|
||||
uses: zizmorcore/zizmor-action@b1d7e1fb5de872772f31590499237e7cce841e8e # v0.5.3
|
||||
uses: zizmorcore/zizmor-action@192e21d79ab29983730a13d1382995c2307fbcaa # v0.5.7
|
||||
with:
|
||||
advanced-security: false
|
||||
|
||||
@@ -28,7 +28,7 @@ jobs:
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
|
||||
@@ -215,10 +215,10 @@ jobs:
|
||||
uses: aquasecurity/setup-trivy@v0.2.0
|
||||
with:
|
||||
cache: true
|
||||
version: v0.70.0
|
||||
version: v0.72.0
|
||||
|
||||
- name: Run Trivy vulnerability scanner in repo mode
|
||||
uses: aquasecurity/trivy-action@master
|
||||
uses: aquasecurity/trivy-action@v0.36.0
|
||||
with:
|
||||
scan-type: 'fs'
|
||||
ignore-unfixed: true
|
||||
@@ -252,7 +252,7 @@ jobs:
|
||||
|
||||
# The first call to the action will invoke setup-trivy and install trivy
|
||||
- name: Generate Trivy Vulnerability Report
|
||||
uses: aquasecurity/trivy-action@master
|
||||
uses: aquasecurity/trivy-action@v0.36.0
|
||||
with:
|
||||
scan-type: "fs"
|
||||
output: trivy-report.json
|
||||
@@ -268,7 +268,7 @@ jobs:
|
||||
retention-days: 30
|
||||
|
||||
- name: Fail build on High/Criticial Vulnerabilities
|
||||
uses: aquasecurity/trivy-action@master
|
||||
uses: aquasecurity/trivy-action@v0.36.0
|
||||
with:
|
||||
scan-type: "fs"
|
||||
format: table
|
||||
@@ -891,7 +891,7 @@ Following inputs can be used as `step.with` keys:
|
||||
| `github-pat` | String | | Authentication token to enable sending SBOM scan results to GitHub Dependency Graph. Can be either a GitHub Personal Access Token (PAT) or GITHUB_TOKEN |
|
||||
| `limit-severities-for-sarif` | Boolean | false | By default *SARIF* format enforces output of all vulnerabilities regardless of configured severities. To override this behavior set this parameter to **true** |
|
||||
| `docker-host` | String | | By default it is set to `unix://var/run/docker.sock`, but can be updated to help with containerized infrastructure values (`unix:/` or other prefix is required) |
|
||||
| `version` | String | `v0.70.0` | Trivy version to use, e.g. `latest` or `v0.70.0` |
|
||||
| `version` | String | `v0.72.0` | Trivy version to use, e.g. `latest` or `v0.72.0` |
|
||||
| `skip-setup-trivy` | Boolean | false | Skip calling the `setup-trivy` action to install `trivy` |
|
||||
| `token-setup-trivy` | Boolean | | Overwrite `github.token` used by `setup-trivy` to checkout the `trivy` repository |
|
||||
|
||||
|
||||
+5
-4
@@ -98,7 +98,7 @@ inputs:
|
||||
version:
|
||||
description: 'Trivy version to use'
|
||||
required: false
|
||||
default: 'v0.70.0'
|
||||
default: 'v0.72.0'
|
||||
cache:
|
||||
description: 'Used to specify whether caching is needed. Set to false, if you would like to disable caching.'
|
||||
required: false
|
||||
@@ -126,9 +126,10 @@ runs:
|
||||
# "allowing select actions" feature can be used to whitelist the dependent action by a hash.
|
||||
# This is needed since some organizations have a policy to only allow pinned 3rd party actions to
|
||||
# be used.
|
||||
uses: aquasecurity/setup-trivy@3fb12ec12f41e471780db15c232d5dd185dcb514 # v0.2.6
|
||||
uses: aquasecurity/setup-trivy@81e514348e19b6112ce2a7e3ecbafe19c1e1f567 # v0.3.1
|
||||
with:
|
||||
version: ${{ inputs.version }}
|
||||
# version is pinned by default; using a floating tag like `latest` is the caller's responsibility
|
||||
version: ${{ inputs.version }} # zizmor: ignore[unpinned-tools]
|
||||
cache: ${{ inputs.cache }}
|
||||
token: ${{ inputs.token-setup-trivy }}
|
||||
|
||||
@@ -139,7 +140,7 @@ runs:
|
||||
|
||||
- name: Restore DB from cache
|
||||
if: ${{ inputs.cache == 'true' }}
|
||||
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
|
||||
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
||||
with:
|
||||
path: ${{ inputs.cache-dir }}
|
||||
key: cache-trivy-${{ steps.date.outputs.date }}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"SchemaVersion": 2,
|
||||
"Trivy": {
|
||||
"Version": "0.70.0"
|
||||
"Version": "0.72.0"
|
||||
},
|
||||
"ArtifactName": "test/data/config-scan",
|
||||
"ArtifactType": "filesystem",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"SchemaVersion": 2,
|
||||
"Trivy": {
|
||||
"Version": "0.70.0"
|
||||
"Version": "0.72.0"
|
||||
},
|
||||
"ArtifactID": "sha256:79ce4c2f8371bef1ce2a321518d3136bc1bd8f3c307ed679944a38e7cbd76c14",
|
||||
"ArtifactName": "https://github.com/krol3/demo-trivy/",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"SchemaVersion": 2,
|
||||
"Trivy": {
|
||||
"Version": "0.70.0"
|
||||
"Version": "0.72.0"
|
||||
},
|
||||
"ArtifactName": "test/data/with-tf-vars/main.tf",
|
||||
"ArtifactType": "filesystem",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"SchemaVersion": 2,
|
||||
"Trivy": {
|
||||
"Version": "0.70.0"
|
||||
"Version": "0.72.0"
|
||||
},
|
||||
"ArtifactID": "sha256:aab05ff324c90bb728aa5177b75d7e39d363be13323873de70959d2251edcebc",
|
||||
"ArtifactName": "alpine:3.10",
|
||||
|
||||
Reference in New Issue
Block a user