Skip to content

Commit

Permalink
security workflow does not repeat nightly scans (#481)
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulreddy15 authored Jan 10, 2025
1 parent 3fb0b16 commit c180f8b
Showing 1 changed file with 1 addition and 37 deletions.
38 changes: 1 addition & 37 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ on:
branches:
- renovate/**
pull_request:
schedule:
- cron: "14 3 * * *" # Daily at 3:14 AM

jobs:
build:
Expand Down Expand Up @@ -42,38 +40,4 @@ jobs:
severity: "CRITICAL,HIGH"
env:
TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db
TRIVY_JAVA_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-java-db

- name: Run Trivy in report mode
# Only generate sarif when running nightly on the main branch.
if: ${{ github.event_name == 'schedule' }}
uses: aquasecurity/[email protected]
with:
image-ref: ${{ env.DOCKER_IMAGE }}:${{ env.DOCKER_IMAGE_TAG }}
format: "template"
template: "@/contrib/sarif.tpl"
output: "trivy-results.sarif"
ignore-unfixed: false # Get full report when running nightly.
severity: "CRITICAL,HIGH"
env:
TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db
TRIVY_JAVA_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-java-db

- name: Upload Trivy scan results to GitHub Security tab
# Only upload sarif when running nightly on the main branch.
if: ${{ github.event_name == 'schedule' }}
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: "trivy-results.sarif"

notify-failure:
if: ${{ github.event_name == 'schedule' && failure() }}
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Notify failure via Slack
uses: archive/github-actions-slack@master
with:
slack-bot-user-oauth-access-token: ${{ secrets.COREINT_SLACK_TOKEN }}
slack-channel: ${{ secrets.CAOS_COREINT_SLACK_CHANNEL }}
slack-text: "❌ `'newrelic/infrastructure-bundle'`: [security pipeline failed](${{ github.server_url }}/newrelic/infrastructure-bundle/actions/runs/${{ github.run_id }})."
TRIVY_JAVA_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-java-db

0 comments on commit c180f8b

Please sign in to comment.