Skip to content

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

@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.

@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

Development

Successfully merging this pull request may close these issues.

2 participants