Skip to content

Commit

Permalink
Remove all possible GitHub Action permissions
Browse files Browse the repository at this point in the history
Set the GitHub Actions token permission to null in all workflows.

This results in:

GITHUB_TOKEN Permissions
  Metadata: read

The default permissions, used without the null override, are:

GITHUB_TOKEN Permissions
  Actions: read
  Checks: read
  Contents: read
  Deployments: read
  Discussions: read
  Issues: read
  Metadata: read
  Packages: read
  Pages: read
  PullRequests: read
  RepositoryProjects: read
  SecurityEvents: read
  Statuses: read

I suspect the dependent issues job may need

  PullRequests: read
  Issues: read

but it would be nice to verify it does fail without them. That's not
possible to test from a PR because the job triggers from merged config.

Relates-to: submariner-io/submariner#1740
Signed-off-by: Daniel Farrell <[email protected]>
  • Loading branch information
dfarrell07 authored and tpantelis committed Aug 22, 2022
1 parent dcc3359 commit 8df79e6
Show file tree
Hide file tree
Showing 13 changed files with 26 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ name: Branch Checks
on:
pull_request:

permissions: {}

jobs:
target_branch:
name: PR targets branch
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/codeowners.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
- 'CODEOWNERS'
- 'CODEOWNERS.in'

permissions: {}

jobs:
updated:
name: Up-to-date
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/dependent-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ on:
schedule:
- cron: '0 0/6 * * *' # every 6 hours

permissions: {}

jobs:
check:
name: Check Dependencies
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/e2e-full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
pull_request:
types: [labeled, opened, synchronize, reopened]

permissions: {}

jobs:
e2e:
name: E2E
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ name: End to End Default
on:
pull_request:

permissions: {}

jobs:
e2e:
name: E2E
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/flake_finder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
schedule:
- cron: "0 0,1 * * *"

permissions: {}

jobs:
e2e:
name: E2E
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ name: Linting
on:
pull_request:

permissions: {}

jobs:
apply-suggestions-commits:
name: 'No "Apply suggestions from code review" Commits'
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/multiarch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ name: Multi-arch Builds
on:
pull_request:

permissions: {}

jobs:
check-multiarch:
name: Check the multi-arch builds
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/periodic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
schedule:
- cron: "0 0 * * 0"

permissions: {}

jobs:
markdown-link-check-periodic:
name: Markdown Links (all files)
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
- devel
- release-*

permissions: {}

jobs:
release:
name: Release Images
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
- devel
- release-*

permissions: {}

jobs:
unit-coverage:
name: Go Unit Test Coverage
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ name: Unit Tests
on:
pull_request:

permissions: {}

jobs:
unit-testing:
name: Go Unit Tests
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/upgrade-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
pull_request:
branches: [devel]

permissions: {}

jobs:
upgrade-e2e:
name: Latest Release to Latest Version
Expand Down

0 comments on commit 8df79e6

Please sign in to comment.