From 9f8a977be7ec6853cc35bc669c16425b54ccb7d2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 16 Nov 2024 23:11:37 +0000 Subject: [PATCH] chore: sync files with stordco/common-config-elixir --- .github/workflows/ci.yaml | 2 ++ .github/workflows/trivy.yaml | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 .github/workflows/trivy.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a131de5..f5a8d7e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -246,4 +246,6 @@ jobs: github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} scan-type: fs slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }} + slack-channel-id: ${{ secrets.SLACK_SECURITY_ALERTS }} + update-db: false diff --git a/.github/workflows/trivy.yaml b/.github/workflows/trivy.yaml new file mode 100644 index 0000000..4ef2471 --- /dev/null +++ b/.github/workflows/trivy.yaml @@ -0,0 +1,32 @@ +# This file is synced with stordco/common-config-elixir. Any changes will be overwritten. + +name: Update Trivy Cache + +on: + schedule: + - cron: "0 0 * * *" # Run daily at midnight UTC + workflow_dispatch: # Allow manual triggering + +jobs: + update-trivy-db: + runs-on: ubuntu-latest + steps: + - name: Setup oras + uses: oras-project/setup-oras@v1 + + - name: Get current date + id: date + run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT + + - name: Download and extract the vulnerability DB + run: | + mkdir -p $GITHUB_WORKSPACE/.cache/trivy/db + oras pull ghcr.io/aquasecurity/trivy-db:2 + tar -xzf db.tar.gz -C $GITHUB_WORKSPACE/.cache/trivy/db + rm db.tar.gz + + - name: Cache DBs + uses: actions/cache/save@v4 + with: + path: $/.cache/trivy + key: cache-trivy-$