Repository navigation
RFC: Package capability declarations - #933
Open
Jacob-Nuwamanya77 wants to merge 2 commits into
Open
Jacob-Nuwamanya77 wants to merge 2 commits into
Jacob-Nuwamanya77 wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I'm Jacob Nuwamanya. I built TreeCustodian, an open-source static security tool for npm (https://gitlab.com/treecustodian/treecustodian), as part of my Master's in Information Technology at ISBAT University. This proposal comes from measuring its false alarms on legitimate packages, where most came from capabilities that a security tool cannot tell apart from an attack without knowing what the package author intended.
This RFC proposes an optional
capabilitiesfield inpackage.json, in which a package author declares what the package accesses by itself at install and when it is loaded. The four kinds are network hosts, files, programs it starts and environment variables. Aruntimephase is reserved for a later version. The field grants no permission and enforces nothing. It gives package managers something to show, and security tools a statement of intent to compare with what they observe and with the previous published version.It also strengthens RFC #54 (install scripts opt-in). Approval decides whether an install script runs, and a declaration says what it does.
An example implementation that reads the field is on a branch of TreeCustodian, https://gitlab.com/treecustodian/treecustodian/-/tree/18-capability-declarations. The measurement behind the motivation is described at https://gitlab.com/treecustodian/treecustodian/-/blob/main/docs/EVALUATION.md.
Feedback I would especially value:
installandloadare the right phases, and whether the rule that a phase is set by what makes code run is clear