Skip to content

Commit d65ee13

Browse files
tautschniggithub-advanced-security[bot]feliperodri
authored
Contain CI permissions to avoid global read-write (#4348)
Addresses code scanning alert. Fix generated by Copilot Autofix. --------- Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Co-authored-by: Felipe R. Monteiro <[email protected]>
1 parent b064bb6 commit d65ee13

File tree

8 files changed

+21
-4
lines changed

8 files changed

+21
-4
lines changed

.github/workflows/bench-compiler.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
#
44
# Run performance benchmarks comparing the compiler performance of two different Kani versions.
55
name: Kani Compiler Performance Benchmarks
6+
permissions:
7+
contents: read
68
on:
79
push:
810
branches:
@@ -161,4 +163,4 @@ jobs:
161163
export PATH="${{ github.workspace }}/new/scripts:$PATH"
162164
cd new/tests/perf/s2n-quic && ../../../target/release/compile-timer --out-path compile-times-new.json --also-visit quic/s2n-quic-core --also-visit quic/s2n-quic-platform --also-visit common/s2n-codec --skip-current
163165
- name: Run analysis between the two
164-
run: ./new/target/release/compile-analyzer --path-pre old/tests/perf/s2n-quic/compile-times-old.json --path-post new/tests/perf/s2n-quic/compile-times-new.json --only-markdown --suite-name long >> "$GITHUB_STEP_SUMMARY"
166+
run: ./new/target/release/compile-analyzer --path-pre old/tests/perf/s2n-quic/compile-times-old.json --path-post new/tests/perf/s2n-quic/compile-times-new.json --only-markdown --suite-name long >> "$GITHUB_STEP_SUMMARY"

.github/workflows/bench-e2e.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
# - Changes are pushed to 'main'.
88
# - Triggered by another workflow
99
name: Kani End-To-End Performance Benchmarks
10+
permissions:
11+
contents: read
1012
on:
1113
push:
1214
branches:

.github/workflows/cbmc-latest.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
name: >-
66
Nightly: CBMC Latest
77
8+
permissions:
9+
contents: read
10+
811
on:
912
schedule:
1013
- cron: "0 9 * * *" # Run this every day at 9 AM UTC (4 AM ET/1 AM PT)

.github/workflows/extra_jobs.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
# See https://github.com/actions/labeler?tab=readme-ov-file#recommended-permissions for more details.
1919

2020
name: Kani Extra
21+
permissions:
22+
contents: read
2123
on:
2224
pull_request_target:
2325
merge_group:
@@ -27,7 +29,6 @@ jobs:
2729
auto-label:
2830
name: Auto Label
2931
permissions:
30-
contents: read
3132
pull-requests: write
3233
outputs:
3334
all-labels: ${{ steps.labeler.outputs.all-labels }}
@@ -46,13 +47,11 @@ jobs:
4647
end-to-end-bench:
4748
name: End-to-End Benchmarks
4849
needs: auto-label
49-
permissions: {}
5050
if: ${{ contains(needs.auto-label.outputs.all-labels, 'Z-EndToEndBenchCI') && github.event_name != 'merge_group' }}
5151
uses: ./.github/workflows/bench-e2e.yml
5252

5353
compiler-bench:
5454
name: Compiler Benchmarks
5555
needs: auto-label
56-
permissions: {}
5756
if: ${{ contains(needs.auto-label.outputs.all-labels, 'Z-CompilerBenchCI') && github.event_name != 'merge_group' }}
5857
uses: ./.github/workflows/bench-compiler.yml

.github/workflows/format-check.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Copyright Kani Contributors
22
# SPDX-License-Identifier: Apache-2.0 OR MIT
33
name: Kani Format Check
4+
permissions:
5+
contents: read
46
on:
57
pull_request:
68
merge_group:

.github/workflows/release.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
# The release will create a draft release and upload the bundles to it, and it will only run when we push a new
77
# release tag (i.e.: tag named `kani-*`).
88
name: Release Bundle
9+
permissions:
10+
contents: read
911
on:
1012
pull_request:
1113
merge_group:
@@ -272,6 +274,8 @@ jobs:
272274
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/kani-') }}
273275
name: Release
274276
runs-on: ubuntu-24.04
277+
permissions:
278+
contents: write
275279
needs: [build_bundle_macos_x86_64, build_bundle_macos_aarch64, build_bundle_linux_x86_64, build_bundle_linux_aarch64, test_bundle]
276280
outputs:
277281
version: ${{ steps.versioning.outputs.version }}

.github/workflows/slow-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
name: >-
66
Nightly: Slow tests
77
8+
permissions:
9+
contents: read
10+
811
on:
912
schedule:
1013
- cron: "30 5 * * *" # Run this every day at 05:30 UTC

.github/workflows/verify-std-check.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
# Changes unrelated to the toolchain should match the current status of main.
1414

1515
name: Check Std Verification
16+
permissions:
17+
contents: read
1618
on:
1719
pull_request:
1820
workflow_call:

0 commit comments

Comments
 (0)