A framework for building native applications using React
GitHub Workflows security hardening (#34541)
Summary: Signed-off-by: sashashura <[email protected]> This PR adds explicit [permissions section](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions) to workflows. This is a security best practice because by default workflows run with [extended set of permissions](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token) (except from `on: pull_request` [from external forks](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/)). By specifying any permission explicitly all others are set to none. By using the principle of least privilege the damage a compromised workflow can do (because of an [injection](https://securitylab.github.com/research/github-actions-untrusted-input/) or compromised third party tool or action) is restricted. It is recommended to have [most strict permissions on the top level](https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions) and grant write permissions on [job level](https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs) case by case. ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://reactnative.dev/contributing/changelogs-in-pull-requests --> [Internal] [Added] - Explicit security permission definitions in autorebase workflow Pull Request resolved: https://github.com/facebook/react-native/pull/34541 Reviewed By: cipolleschi Differential Revision: D39544656 Pulled By: cortinico fbshipit-source-id: 4918ee83fab7172a1d98689f10102fe2db2b17b7
A
Alex committed
a5cf3a46abd6566a29a59c175e607a1c9fab4882
Parent: ff20062
Committed by Facebook GitHub Bot <[email protected]>
on 9/15/2022, 4:31:41 PM