Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

chore(ci): GitHub Workflows security hardening #8030

Merged
merged 1 commit into from
Aug 31, 2022

Conversation

sashashura
Copy link
Contributor

Signed-off-by: sashashura 93376818+sashashura@users.noreply.github.com

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • If this is a code change: I have written unit tests and/or added dogfooding pages to fully verify the new behavior.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Motivation

This PR adds explicit permissions section to workflows. This is a security best practice because by default workflows run with extended set of permissions (except from on: pull_request from external forks). 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 or compromised third party tool or action) is restricted.
It is recommended to have most strict permissions on the top level and grant write permissions on job level case by case.

Test Plan

Test links

Deploy preview: https://deploy-preview-_____--docusaurus-2.netlify.app/

Related issues/PRs

Signed-off-by: sashashura <93376818+sashashura@users.noreply.github.com>
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Aug 31, 2022
@netlify
Copy link

netlify bot commented Aug 31, 2022

[V2]

Built without sensitive environment variables

Name Link
🔨 Latest commit c28c405
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/630f3a9c51972900091b05a4
😎 Deploy Preview https://deploy-preview-8030--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions
Copy link

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO PWA Report
/ 🟠 80 🟢 98 🟢 100 🟢 100 🟠 80 Report
/docs/installation 🟠 81 🟢 100 🟢 100 🟢 100 🟢 90 Report

@slorber slorber changed the title GitHub Workflows security hardening chore(ci): GitHub Workflows security hardening Aug 31, 2022
@slorber slorber added the pr: internal This PR does not touch production code, or is not meaningful enough to be in the changelog. label Aug 31, 2022
Copy link
Collaborator

@slorber slorber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks 👍

@slorber slorber merged commit 830153d into facebook:main Aug 31, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
CLA Signed Signed Facebook CLA pr: internal This PR does not touch production code, or is not meaningful enough to be in the changelog.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants