Skip to content

Commit 8eb8e1d

Browse files
Merge pull request #10206 from kikofernandez/kiko/fix-scanner-issue-creation/OTP-19775
Fixes to the vendor vulnerability scanner OTP-19775
2 parents d1bf4e9 + e5e8747 commit 8eb8e1d

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

.github/workflows/main.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -475,15 +475,14 @@ jobs:
475475
# this is a call to a workflow_call
476476
pr-vendor-vulnerability-analysis:
477477
needs: modified-vendor-files
478-
if: ${{ needs.modified-vendor-files.outputs.vendor-files == 'true' && github.event_name == 'pull_request'}}
478+
if: ${{ needs.modified-vendor-files.outputs.vendor-files == 'true' && github.event_name == 'pull_request' && github.repository == 'erlang/otp'}}
479479
permissions:
480-
security-events: read
481-
issues: write
480+
actions: read
482481
name: Vendor Vulnerability Scanning
483482
uses: ./.github/workflows/reusable-vendor-vulnerability-scanner.yml
484483
with:
485-
fail_if_cve: false
486-
checkout: false
484+
fail_if_cve: true
485+
checkout: true
487486
version: ${{ github.event_name == 'pull_request' && github.base_ref || github.ref_name }}
488487
# equivalent of ${{ env.BASE_BRANCH }} but reusable-workflows do not allow to pass env.
489488
secrets: inherit

.github/workflows/osv-scanner-scheduled.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,7 @@ jobs:
5757
type: ${{ fromJson(needs.schedule-scan.outputs.versions) }}
5858
fail-fast: false
5959
permissions:
60-
security-events: read
61-
issues: write
62-
actions: write
63-
contents: write
64-
pull-requests: write
60+
actions: read
6561
steps:
6662
# this call to a workflow_dispatch ref=master is important because
6763
# using ref={{matrix.type}} would trigger the workflow

.github/workflows/reusable-vendor-vulnerability-scanner.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ on:
5151
default: 'master'
5252
type: 'string'
5353
fail_if_cve:
54-
description: 'Fail if CVE is found'
54+
description: 'Fail if CVE is found and create issue'
5555
required: true
5656
default: false
5757
type: boolean
@@ -72,7 +72,7 @@ on:
7272
default: 'master'
7373
type: 'string'
7474
fail_if_cve:
75-
description: 'Fail if CVE is found'
75+
description: 'Fail if CVE is found and create issue'
7676
required: true
7777
default: false
7878
type: boolean
@@ -92,8 +92,7 @@ jobs:
9292
env:
9393
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9494
permissions:
95-
security-events: read
96-
issues: write
95+
actions: read
9796
steps:
9897
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/[email protected]
9998
with:
@@ -103,8 +102,14 @@ jobs:
103102
with:
104103
otp-version: '28'
105104

105+
- uses: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 # ratchet:actions/[email protected]
106+
id: app-token
107+
with:
108+
# required
109+
app-id: ${{ vars.ERLANG_VENDOR_SCANNER_APP_ID }}
110+
private-key: ${{ secrets.ERLANG_VENDOR_SCANNER_BOT_PRIVATE_KEY }}
111+
106112
- name: 'Analysis of dependencies from OpenVEX in ${{ inputs.version }}'
107-
id: analysis
108113
run: |
109114
curl -L \
110115
-H "Accept: application/vnd.github+json" \
@@ -115,6 +120,6 @@ jobs:
115120
chmod +x otp-compliance.es
116121
cp otp-compliance.es /home/runner/work/otp/otp/.github/scripts/otp-compliance.es
117122
cd /home/runner/work/otp/otp && \
118-
.github/scripts/otp-compliance.es sbom osv-scan \
123+
GH_TOKEN="${{ steps.app-token.outputs.token }}" .github/scripts/otp-compliance.es sbom osv-scan \
119124
--version ${{ inputs.version }} \
120125
--fail_if_cve ${{ inputs.fail_if_cve }}

0 commit comments

Comments
 (0)