mirror of
https://github.com/super-linter/super-linter.git
synced 2024-12-01 13:10:57 -05:00
Set permissions for GitHub actions (#2752)
- Included permissions for the action. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs [Keeping your GitHub Actions and workflows secure Part 1: Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/) Restrict the GitHub token permissions only to the required ones; this way, even if the attackers will succeed in compromising your workflow, they won’t be able to do much. Signed-off-by: nathannaveen <42319948+nathannaveen@users.noreply.github.com>
This commit is contained in:
parent
04bd969a8b
commit
4471e9f322
5 changed files with 23 additions and 0 deletions
6
.github/workflows/draft-release.yml
vendored
6
.github/workflows/draft-release.yml
vendored
|
@ -18,8 +18,14 @@ on:
|
||||||
#################
|
#################
|
||||||
# Start the job #
|
# Start the job #
|
||||||
#################
|
#################
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
update_release_draft:
|
update_release_draft:
|
||||||
|
permissions:
|
||||||
|
contents: write # for release-drafter/release-drafter to create a github release
|
||||||
|
pull-requests: write # for release-drafter/release-drafter to add label to PR
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 60
|
timeout-minutes: 60
|
||||||
steps:
|
steps:
|
||||||
|
|
3
.github/workflows/repo-visualization.yml
vendored
3
.github/workflows/repo-visualization.yml
vendored
|
@ -22,6 +22,9 @@ on:
|
||||||
###############
|
###############
|
||||||
# Set the Job #
|
# Set the Job #
|
||||||
###############
|
###############
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
# Name the Job
|
# Name the Job
|
||||||
|
|
3
.github/workflows/stale.yml
vendored
3
.github/workflows/stale.yml
vendored
|
@ -24,6 +24,9 @@ jobs:
|
||||||
# Mark an Issue Stale #
|
# Mark an Issue Stale #
|
||||||
#######################
|
#######################
|
||||||
markstale:
|
markstale:
|
||||||
|
permissions:
|
||||||
|
issues: write # for actions/stale to close stale issues
|
||||||
|
pull-requests: write # for actions/stale to close stale PRs
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
# only run on schedule
|
# only run on schedule
|
||||||
if: ${{ github.event_name == 'schedule' }}
|
if: ${{ github.event_name == 'schedule' }}
|
||||||
|
|
6
.github/workflows/trivy.yml
vendored
6
.github/workflows/trivy.yml
vendored
|
@ -6,8 +6,14 @@ on:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
pull_request:
|
pull_request:
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
scan-container:
|
scan-container:
|
||||||
|
permissions:
|
||||||
|
contents: read # for actions/checkout to fetch code
|
||||||
|
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
|
||||||
name: Build
|
name: Build
|
||||||
runs-on: ubuntu-18.04
|
runs-on: ubuntu-18.04
|
||||||
timeout-minutes: 60
|
timeout-minutes: 60
|
||||||
|
|
5
.github/workflows/versioning.yml
vendored
5
.github/workflows/versioning.yml
vendored
|
@ -25,8 +25,13 @@ on:
|
||||||
#################
|
#################
|
||||||
# Start the job #
|
# Start the job #
|
||||||
#################
|
#################
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
actions-tagger:
|
actions-tagger:
|
||||||
|
permissions:
|
||||||
|
contents: write # for Actions-R-Us/actions-tagger to create a release and add latest tag
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
timeout-minutes: 60
|
timeout-minutes: 60
|
||||||
steps:
|
steps:
|
||||||
|
|
Loading…
Reference in a new issue