Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

ci(NODE-4872): add permissions to dependency check workflow #3483

Merged
merged 2 commits into from Dec 13, 2022

Conversation

sashashura
Copy link
Contributor

Description

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.

What is changing?

Explicit permissions added

Is there new documentation needed for these changes?

No, CI only

What is the motivation for this change?

See the description

Double check the following

  • Ran npm run check:lint script
  • Self-review completed using the steps outlined here
  • PR title follows the correct format: <type>(NODE-xxxx)<!>: <description>
  • [N/A] Changes are covered by tests
  • New TODOs have a related JIRA ticket

Signed-off-by: Alex <aleksandrosansan@gmail.com>
@baileympearson baileympearson changed the title GitHub Workflows security hardening ci(NODE-4872): add permissions to dependency check workflow Dec 13, 2022
Copy link
Contributor

@baileympearson baileympearson left a comment

Choose a reason for hiding this comment

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

Hey @sashashura - thanks for the contribution! I'm going to remove the comment added in the workflow file but otherwise it looks good to me.

.github/workflows/dependencies.yml Outdated Show resolved Hide resolved
@baileympearson baileympearson merged commit e3ead58 into mongodb:main Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants