Skip to content

Commit d013208

Browse files
committed
Scorecard uptake
1 parent 32f2e40 commit d013208

6 files changed

+47
-6
lines changed

.github/workflows/CreateBuildTag.yaml

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@ on:
88

99
run-name: "[${{ github.ref_name }}] Create build tag"
1010

11-
permissions:
12-
contents: write
11+
permissions: read-all
1312

1413
jobs:
1514
CreateTag:
1615
if: github.event.workflow_run.conclusion == 'success'
1716
runs-on: windows-latest
17+
permissions:
18+
contents: write
1819
steps:
1920
- name: Checkout
2021
uses: actions/checkout@v4

.github/workflows/MSDO.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@ on:
66
pull_request:
77
branches: [ "main", "releases/*" ]
88

9-
permissions:
10-
id-token: write # This is required for federation to Defender for DevOps
11-
security-events: write # This is required to upload SARIF files
9+
permissions: read-all
1210

1311
jobs:
1412
MSDO:
1513
name: Run Microsoft Security DevOps Analysis
1614
runs-on: ubuntu-latest
15+
permissions:
16+
id-token: write # This is required for federation to Defender for DevOps
17+
security-events: write # This is required to upload SARIF files
1718
steps:
1819
- name: Checkout repository
1920
uses: actions/checkout@v4

.github/workflows/UpdateBCArtifactVersion.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ defaults:
99
run:
1010
shell: powershell
1111

12+
permissions: read-all
13+
1214
jobs:
1315
GetBranches:
1416
name: Get Branches
@@ -28,6 +30,7 @@ jobs:
2830
$branchMatrix = "[$($branches -join ',')]"
2931
Write-Host "Updating branches: $branchMatrix"
3032
Add-Content -Path $env:GITHUB_OUTPUT -Value "UpdateBranches=$branchMatrix"
33+
3134
UpdateBCArtifactVersion:
3235
name: "[${{ matrix.branch }}] Update BC Artifact Version"
3336
permissions:

.github/workflows/UpdatePackageVersions.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ defaults:
99
run:
1010
shell: powershell
1111

12+
permissions: read-all
13+
1214
jobs:
1315
GetBranches:
1416
name: Get Branches

.github/workflows/powershell.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@ on:
1212

1313
permissions:
1414
contents: read
15-
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
1615

1716
jobs:
1817
build:
1918
name: PSScriptAnalyzer
2019
runs-on: ubuntu-latest
20+
permissions:
21+
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
2122
steps:
2223
- uses: actions/checkout@v4
2324

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Scorecard analysis
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
# Weekly on Monday at 08:00 UTC
6+
- cron: "0 8 * * 1"
7+
8+
permissions: read-all
9+
10+
jobs:
11+
analysis:
12+
name: Scorecard analysis
13+
runs-on: ubuntu-latest
14+
permissions:
15+
security-events: write # Needed for Code scanning upload
16+
id-token: write # Needed for GitHub OIDC token if publish_results is true
17+
18+
steps:
19+
- name: "Checkout code"
20+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
21+
with:
22+
persist-credentials: false
23+
24+
- name: "Run analysis"
25+
uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1
26+
with:
27+
results_file: results.sarif
28+
results_format: sarif
29+
30+
- name: "Upload to code-scanning"
31+
uses: github/codeql-action/upload-sarif@83a02f7883b12e0e4e1a146174f5e2292a01e601 # v2.16.4
32+
with:
33+
sarif_file: results.sarif

0 commit comments

Comments
 (0)