From 8a23bab5ab4fd3ceab81325cb214f3f6cedac0ee Mon Sep 17 00:00:00 2001 From: Step Security Bot Date: Mon, 10 Oct 2022 18:54:59 -0700 Subject: [PATCH] [StepSecurity] ci: Harden GitHub Actions (#3134) Signed-off-by: StepSecurity Bot --- .github/workflows/codeql-analysis.yml | 7 +++++++ .github/workflows/fossa.yml | 3 +++ .github/workflows/labeler.yml | 3 +++ .github/workflows/stale.yml | 6 ++++++ 4 files changed, 19 insertions(+) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 5933b75447..ebc5924c66 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -13,8 +13,15 @@ concurrency: group: ${{ github.ref_name }}-codeql cancel-in-progress: true +permissions: # added using https://github.com/step-security/secure-workflows + contents: read + jobs: analyze: + permissions: + actions: read # for github/codeql-action/init to get workflow details + contents: read # for actions/checkout to fetch code + security-events: write # for github/codeql-action/autobuild to send a status report name: Analyze runs-on: ubuntu-latest diff --git a/.github/workflows/fossa.yml b/.github/workflows/fossa.yml index f9b20e9042..8e2bd2b0a7 100644 --- a/.github/workflows/fossa.yml +++ b/.github/workflows/fossa.yml @@ -13,6 +13,9 @@ concurrency: group: ${{ github.ref_name }}-fossa cancel-in-progress: true +permissions: # added using https://github.com/step-security/secure-workflows + contents: read + jobs: scan: diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 053fddb01f..4413605165 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -2,6 +2,9 @@ name: "Pull Request Labeler" on: - pull_request_target +permissions: # added using https://github.com/step-security/secure-workflows + contents: read + jobs: triage: permissions: diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index fdfeb9b095..5ca0e00269 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -3,8 +3,14 @@ on: schedule: - cron: '30 1 * * *' +permissions: # added using https://github.com/step-security/secure-workflows + contents: read + jobs: stale: + permissions: + issues: write # for actions/stale to close stale issues + pull-requests: write # for actions/stale to close stale PRs runs-on: ubuntu-20.04 steps: - uses: actions/stale@v6