Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] chore: Set permissions for GitHub actions
@ 2022-06-19  1:58 neilnaveen
  2022-06-19  2:16 ` [PR REVIEW] " classabbyamp
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: neilnaveen @ 2022-06-19  1:58 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1057 bytes --]

There is a new pull request by neilnaveen against master on the void-packages repository

https://github.com/turrisxyz/void-packages Pinned-Dependencies-GitHub
https://github.com/void-linux/void-packages/pull/37612

chore: Set permissions for GitHub actions
 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.

- 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/)

Signed-off-by: neilnaveen <42328488+neilnaveen@users.noreply.github.com>


A patch file from https://github.com/void-linux/void-packages/pull/37612.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-Pinned-Dependencies-GitHub-37612.patch --]
[-- Type: text/x-diff, Size: 2037 bytes --]

From 820caf32c6ba775d62912780073c88ab6cbc8963 Mon Sep 17 00:00:00 2001
From: neilnaveen <42328488+neilnaveen@users.noreply.github.com>
Date: Sun, 19 Jun 2022 01:58:29 +0000
Subject: [PATCH] chore: Set permissions for GitHub actions
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

 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.

- 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/)

Signed-off-by: neilnaveen <42328488+neilnaveen@users.noreply.github.com>
---
 .github/workflows/build.yaml | 3 +++
 .github/workflows/stale.yml  | 6 ++++++
 2 files changed, 9 insertions(+)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index bb05364b5e74..df60eb0a5775 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -14,6 +14,9 @@ concurrency:
   group: ${{ github.workflow }}-${{ github.ref }}
   cancel-in-progress: true
 
+permissions:
+  contents: read
+
 jobs:
   # Lint changed templates.
   xlint:
diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml
index 160897fedef1..5597cf00eaf9 100644
--- a/.github/workflows/stale.yml
+++ b/.github/workflows/stale.yml
@@ -6,8 +6,14 @@ on:
   schedule:
     - cron: '30 1 * * *'
 
+permissions:
+  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-latest
     steps:
       - uses: actions/stale@v4

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PR REVIEW] chore: Set permissions for GitHub actions
  2022-06-19  1:58 [PR PATCH] chore: Set permissions for GitHub actions neilnaveen
@ 2022-06-19  2:16 ` classabbyamp
  2022-06-19  2:24 ` classabbyamp
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: classabbyamp @ 2022-06-19  2:16 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 436 bytes --]

New review comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/37612#discussion_r901036840

Comment:
> Due to the dangers inherent to automatic processing of PRs, GitHub’s standard pull_request workflow trigger by default prevents write permissions and secrets access to the target repository.

This is not overridden anywhere in this workflow, so I don't see why it's needed here.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PR REVIEW] chore: Set permissions for GitHub actions
  2022-06-19  1:58 [PR PATCH] chore: Set permissions for GitHub actions neilnaveen
  2022-06-19  2:16 ` [PR REVIEW] " classabbyamp
@ 2022-06-19  2:24 ` classabbyamp
  2022-06-19  2:31 ` classabbyamp
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: classabbyamp @ 2022-06-19  2:24 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 436 bytes --]

New review comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/37612#discussion_r901036840

Comment:
> Due to the dangers inherent to automatic processing of PRs, GitHub’s standard pull_request workflow trigger by default prevents write permissions and secrets access to the target repository.

This is not overridden anywhere in this workflow, so I don't see why it's needed here.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: chore: Set permissions for GitHub actions
  2022-06-19  1:58 [PR PATCH] chore: Set permissions for GitHub actions neilnaveen
  2022-06-19  2:16 ` [PR REVIEW] " classabbyamp
  2022-06-19  2:24 ` classabbyamp
@ 2022-06-19  2:31 ` classabbyamp
  2022-06-25 22:25 ` skovati
  2022-07-03  0:46 ` [PR PATCH] [Closed]: " the-maldridge
  4 siblings, 0 replies; 6+ messages in thread
From: classabbyamp @ 2022-06-19  2:31 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 376 bytes --]

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/37612#issuecomment-1159603394

Comment:
what about [cycles.yml](https://github.com/void-linux/void-packages/blob/master/.github/workflows/cycles.yml)?

can you match the commit message style for the repo? (e.g. ".github/workflows: set permissions for github actions")

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: chore: Set permissions for GitHub actions
  2022-06-19  1:58 [PR PATCH] chore: Set permissions for GitHub actions neilnaveen
                   ` (2 preceding siblings ...)
  2022-06-19  2:31 ` classabbyamp
@ 2022-06-25 22:25 ` skovati
  2022-07-03  0:46 ` [PR PATCH] [Closed]: " the-maldridge
  4 siblings, 0 replies; 6+ messages in thread
From: skovati @ 2022-06-25 22:25 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 224 bytes --]

New comment by skovati on void-packages repository

https://github.com/void-linux/void-packages/pull/37612#issuecomment-1166371444

Comment:
Love this hardening, but agree it could be applied to the cycles workflow as well.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PR PATCH] [Closed]: chore: Set permissions for GitHub actions
  2022-06-19  1:58 [PR PATCH] chore: Set permissions for GitHub actions neilnaveen
                   ` (3 preceding siblings ...)
  2022-06-25 22:25 ` skovati
@ 2022-07-03  0:46 ` the-maldridge
  4 siblings, 0 replies; 6+ messages in thread
From: the-maldridge @ 2022-07-03  0:46 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 882 bytes --]

There's a closed pull request on the void-packages repository

chore: Set permissions for GitHub actions
https://github.com/void-linux/void-packages/pull/37612

Description:
 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.

- 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/)

Signed-off-by: neilnaveen <42328488+neilnaveen@users.noreply.github.com>


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-07-03  0:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-19  1:58 [PR PATCH] chore: Set permissions for GitHub actions neilnaveen
2022-06-19  2:16 ` [PR REVIEW] " classabbyamp
2022-06-19  2:24 ` classabbyamp
2022-06-19  2:31 ` classabbyamp
2022-06-25 22:25 ` skovati
2022-07-03  0:46 ` [PR PATCH] [Closed]: " the-maldridge

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).