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-$