Skip to content

Commit 1f52a93

Browse files
ZePan110alexsin368
authored andcommitted
Fix security issues in workflows (opea-project#1977)
Signed-off-by: ZePan110 <[email protected]> Signed-off-by: alexsin368 <[email protected]>
1 parent de14ed3 commit 1f52a93

24 files changed

+205
-14
lines changed

.github/workflows/_build_comps_base_image.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
name: Build Comps Base Image
5-
permissions: read-all
5+
6+
permissions:
7+
attestations: read
8+
models: read
9+
security-events: read
10+
611
on:
712
workflow_call:
813
inputs:

.github/workflows/_build_image.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,22 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
name: Build Images
5-
permissions: read-all
5+
permissions:
6+
actions: read
7+
contents: read
8+
checks: read
9+
deployments: read
10+
discussions: read
11+
issues: read
12+
packages: read
13+
pages: read
14+
pull-requests: read
15+
repository-projects: read
16+
statuses: read
17+
security-events: read
18+
id-token: write
19+
attestations: read
20+
models: read
621
on:
722
workflow_call:
823
inputs:

.github/workflows/_example-workflow.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,22 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
name: Example jobs
5-
permissions: read-all
5+
permissions:
6+
actions: read
7+
contents: read
8+
checks: read
9+
deployments: read
10+
discussions: read
11+
issues: read
12+
packages: read
13+
pages: read
14+
pull-requests: read
15+
repository-projects: read
16+
statuses: read
17+
security-events: read
18+
id-token: write
19+
attestations: read
20+
models: read
621
on:
722
workflow_call:
823
inputs:

.github/workflows/_get-image-list.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
name: Get Image List
5-
permissions: read-all
5+
permissions:
6+
contents: read
67
on:
78
workflow_call:
89
inputs:

.github/workflows/_gmc-e2e.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33

44
# This workflow will only test GMC pipeline and will not install GMC any more
55
name: Single GMC E2e Test For CD Workflow Call
6-
6+
permissions:
7+
contents: read
78
on:
89
workflow_call:
910
inputs:

.github/workflows/_gmc-workflow.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
name: Build and deploy GMC system on call and manual
5-
5+
permissions:
6+
contents: read
67
on:
78
workflow_dispatch:
89
inputs:

.github/workflows/dockerhub-description.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
name: Update Docker Hub Description
5+
permissions:
6+
contents: read
57
on:
68
schedule:
79
- cron: "0 0 * * 0"

.github/workflows/manual-docker-clean.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
name: Clean up container on manual event
5+
permissions:
6+
contents: read
57
on:
68
workflow_dispatch:
79
inputs:

.github/workflows/manual-example-workflow.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,24 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
name: Examples CD workflow on manual event
5+
6+
permissions:
7+
actions: read
8+
contents: read
9+
checks: read
10+
deployments: read
11+
discussions: read
12+
issues: read
13+
packages: read
14+
pages: read
15+
pull-requests: read
16+
repository-projects: read
17+
statuses: read
18+
security-events: read
19+
id-token: write
20+
attestations: read
21+
models: read
22+
523
on:
624
workflow_dispatch:
725
inputs:
@@ -51,7 +69,6 @@ on:
5169
required: false
5270
type: boolean
5371

54-
permissions: read-all
5572
jobs:
5673
get-test-matrix:
5774
runs-on: ubuntu-latest

.github/workflows/manual-freeze-tag.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
name: Freeze OPEA images release tag
5-
5+
permissions:
6+
contents: read
67
on:
78
workflow_dispatch:
89
inputs:

0 commit comments

Comments
 (0)