Skip to content

Commit ab4ca9b

Browse files
committed
workflows updates - scorecard, codeql, token changes
Also add scorecard badge and fix CI/Devel badge Signed-off-by: Tuomas Katila <[email protected]>
1 parent f9bc72f commit ab4ca9b

File tree

9 files changed

+109
-3
lines changed

9 files changed

+109
-3
lines changed

.github/workflows/ci.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,17 @@ on:
77
branches:
88
- main
99
- 'release-*'
10+
1011
permissions:
1112
contents: read
1213
pull-requests: read
1314

1415
jobs:
1516
trivy:
17+
permissions:
18+
actions: read
19+
contents: read
20+
security-events: write
1621
uses: "./.github/workflows/lib-trivy.yaml"
1722

1823
validate:

.github/workflows/devel.yaml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,38 @@ on:
33
push:
44
branches:
55
- main
6+
67
permissions:
78
contents: read
89
pull-requests: read
9-
security-events: write
1010

1111
jobs:
1212
trivy:
13+
permissions:
14+
actions: read
15+
contents: read
16+
security-events: write
1317
uses: "./.github/workflows/lib-trivy.yaml"
1418
with:
1519
upload-to-github-security-tab: true
1620

1721
validate:
1822
uses: "./.github/workflows/lib-validate.yaml"
1923

24+
codeql:
25+
permissions:
26+
actions: read
27+
contents: read
28+
security-events: write
29+
uses: "./.github/workflows/lib-codeql.yaml"
30+
31+
scorecard:
32+
permissions:
33+
contents: read
34+
id-token: write
35+
security-events: write
36+
uses: "./.github/workflows/lib-scorecard.yaml"
37+
2038
build:
2139
needs:
2240
- validate

.github/workflows/lib-build.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
name: build
2+
23
on:
34
workflow_call:
5+
6+
permissions:
7+
contents: read
8+
49
jobs:
510
image:
611
name: Build image

.github/workflows/lib-codeql.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: "CodeQL"
2+
3+
on:
4+
workflow_call:
5+
6+
permissions:
7+
actions: read
8+
contents: read
9+
10+
jobs:
11+
analyze:
12+
name: Analysis
13+
runs-on: 'ubuntu-latest'
14+
timeout-minutes: 360
15+
16+
permissions:
17+
security-events: write
18+
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v3
22+
23+
- name: Initialize CodeQL
24+
uses: github/codeql-action/init@v2
25+
with:
26+
languages: 'go'
27+
28+
- uses: actions/setup-go@v4
29+
- name: Perform CodeQL Analysis
30+
uses: github/codeql-action/analyze@v2
31+
with:
32+
category: "/language:go"

.github/workflows/lib-publish.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
env:
1010
no_base_check: "['intel-qat-plugin-kerneldrv', 'intel-idxd-config-initcontainer', 'crypto-perf', 'opae-nlb-demo']"
1111

12+
permissions:
13+
contents: read
14+
1215
jobs:
1316
image:
1417
name: Build image

.github/workflows/lib-scorecard.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: "OSSF"
2+
3+
on:
4+
workflow_call:
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
analysis:
11+
name: Analysis
12+
runs-on: ubuntu-latest
13+
14+
permissions:
15+
security-events: write
16+
id-token: write
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
persist-credentials: false
22+
23+
- name: "Analyze project"
24+
uses: ossf/[email protected]
25+
with:
26+
results_file: results.sarif
27+
results_format: sarif
28+
publish_results: true
29+
30+
- name: "Upload results to security"
31+
uses: github/codeql-action/upload-sarif@v2
32+
with:
33+
sarif_file: results.sarif

.github/workflows/lib-trivy.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ on:
1919
required: false
2020
type: boolean
2121

22+
permissions:
23+
actions: read
24+
contents: read
25+
2226
jobs:
2327
trivy-scan-deployments:
2428
name: Scan deployments
@@ -69,6 +73,9 @@ jobs:
6973
severity: "UNKNOWN,MEDIUM,HIGH,CRITICAL"
7074

7175
trivy-scan-vulns:
76+
permissions:
77+
security-events: write
78+
7279
runs-on: ubuntu-22.04
7380
name: Scan vulnerabilities
7481
steps:

.github/workflows/lib-validate.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: validate
22
on:
33
workflow_call:
44

5+
permissions:
6+
contents: read
7+
58
jobs:
69
docs:
710
name: Check docs are buildable
@@ -28,7 +31,6 @@ jobs:
2831
2932
golangci:
3033
permissions:
31-
contents: read # for actions/checkout to fetch code
3234
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
3335
name: lint
3436
runs-on: ubuntu-22.04

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Overview
2-
[![Build Status](https://github.com/intel/intel-device-plugins-for-kubernetes/workflows/CI/badge.svg?branch=main)](https://github.com/intel/intel-device-plugins-for-kubernetes/actions?query=workflow%3ACI)
2+
[![Build Status](https://github.com/intel/intel-device-plugins-for-kubernetes/actions/workflows/devel.yaml/badge.svg)](https://github.com/intel/intel-device-plugins-for-kubernetes/actions?query=workflow%3ADevel)
33
[![Go Report Card](https://goreportcard.com/badge/github.com/intel/intel-device-plugins-for-kubernetes)](https://goreportcard.com/report/github.com/intel/intel-device-plugins-for-kubernetes)
44
[![GoDoc](https://godoc.org/github.com/intel/intel-device-plugins-for-kubernetes/pkg/deviceplugin?status.svg)](https://godoc.org/github.com/intel/intel-device-plugins-for-kubernetes/pkg/deviceplugin)
5+
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/intel/intel-device-plugins-for-kubernetes/badge)](https://api.securityscorecards.dev/projects/intel/intel-device-plugins-for-kubernetes)
56

67
This repository contains a framework for developing plugins for the Kubernetes
78
[device plugins framework](https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins/),

0 commit comments

Comments
 (0)