Skip to content

Commit 47d88c8

Browse files
authored
[chore] add OSSF Scorecard workflow (#38679)
This follows open-telemetry/opentelemetry-collector#9317 --------- Signed-off-by: Alex Boten <[email protected]>
1 parent 7c1b216 commit 47d88c8

File tree

6 files changed

+76
-7
lines changed

6 files changed

+76
-7
lines changed

.github/workflows/scorecard.yml

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Scorecard supply-chain security
2+
3+
on:
4+
# For Branch-Protection check. Only the default branch is supported. See
5+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
6+
branch_protection_rule:
7+
# To guarantee Maintained check is occasionally updated. See
8+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
9+
schedule:
10+
- cron: '39 1 * * 3'
11+
push:
12+
branches: [ "main" ]
13+
14+
# Declare default permissions as read only.
15+
permissions: read-all
16+
17+
jobs:
18+
analysis:
19+
name: Scorecard analysis
20+
runs-on: ubuntu-latest
21+
permissions:
22+
# Needed to upload the results to code-scanning dashboard.
23+
security-events: write
24+
# Needed to publish results and get a badge (see publish_results below).
25+
id-token: write
26+
# Uncomment the permissions below if installing in a private repository.
27+
# contents: read
28+
# actions: read
29+
30+
steps:
31+
- name: "Checkout code"
32+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
33+
with:
34+
persist-credentials: false
35+
36+
- name: "Run analysis"
37+
uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
38+
with:
39+
results_file: results.sarif
40+
results_format: sarif
41+
# (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
42+
# - you want to enable the Branch-Protection check on a *public* repository, or
43+
# - you are installing Scorecard on a *private* repository
44+
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-pat.
45+
# repo_token: ${{ secrets.SCORECARD_TOKEN }}
46+
47+
# Public repositories:
48+
# - Publish results to OpenSSF REST API for easy access by consumers
49+
# - Allows the repository to include the Scorecard badge.
50+
# - See https://github.com/ossf/scorecard-action#publishing-results.
51+
# For private repositories:
52+
# - `publish_results` will always be set to `false`, regardless
53+
# of the value entered here.
54+
publish_results: true
55+
56+
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
57+
# format to the repository Actions tab.
58+
- name: "Upload artifact"
59+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
60+
with:
61+
name: SARIF file
62+
path: results.sarif
63+
retention-days: 5
64+
65+
# Upload the results to GitHub's code scanning dashboard.
66+
- name: "Upload to code-scanning"
67+
uses: github/codeql-action/upload-sarif@6bb031afdd8eb862ea3fc1848194185e076637e5 # v3.28.11
68+
with:
69+
sarif_file: results.sarif

cmd/otelcontribcol/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM alpine:latest AS prep
1+
FROM alpine:latest@sha256:a8560b36e8b8210634f77d9f7f9efd7ffa463e380b75e2e74aff4511df3ef88c AS prep
22
RUN apk --update add ca-certificates
33

44
FROM scratch

cmd/telemetrygen/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM alpine:latest AS certs
1+
FROM alpine:latest@sha256:a8560b36e8b8210634f77d9f7f9efd7ffa463e380b75e2e74aff4511df3ef88c AS certs
22
RUN apk --update add ca-certificates
33

44
FROM scratch

exporter/clickhouseexporter/example/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
FROM alpine:latest AS certs
1+
FROM alpine:latest@sha256:a8560b36e8b8210634f77d9f7f9efd7ffa463e380b75e2e74aff4511df3ef88c AS certs
22
RUN apk --update add ca-certificates
33

4-
FROM golang:latest
4+
FROM golang:latest@sha256:fa145a3c13f145356057e00ed6f66fbd9bf017798c9d7b2b8e956651fe4f52da
55

66
ARG USER_UID=10001
77
USER ${USER_UID}

exporter/loadbalancingexporter/example/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
FROM golang:1.24 AS build
1+
FROM golang:1.24@sha256:fa145a3c13f145356057e00ed6f66fbd9bf017798c9d7b2b8e956651fe4f52da AS build
22

33
WORKDIR /src
44
ADD . /src
55

66
RUN make otelcontribcol
77

8-
FROM alpine:latest AS certs
8+
FROM alpine:latest@sha256:a8560b36e8b8210634f77d9f7f9efd7ffa463e380b75e2e74aff4511df3ef88c AS certs
99
RUN apk --update add ca-certificates
1010

1111
FROM scratch

receiver/sqlqueryreceiver/testdata/integration/sqlserver/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM mcr.microsoft.com/mssql/server:2022-latest
1+
FROM mcr.microsoft.com/mssql/server:2022-latest@sha256:ea73825f3d88a23c355ac2f9fdc6bd960fec90171c12c572109b36a558f77bb8
22

33
ENV ACCEPT_EULA=Y
44
ENV SA_PASSWORD=YourStrong!Passw0rd

0 commit comments

Comments
 (0)