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

policy review document #8

Merged
merged 7 commits into from
Sep 17, 2024
Merged

policy review document #8

merged 7 commits into from
Sep 17, 2024

Conversation

naugtur
Copy link
Member

@naugtur naugtur commented Sep 4, 2024

No description provided.

@leotm leotm self-requested a review September 16, 2024 17:41
leotm
leotm previously approved these changes Sep 16, 2024
Copy link
Member

@leotm leotm left a comment

Choose a reason for hiding this comment

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

ah formatting remaining, i'll fix

@leotm leotm force-pushed the naugtur/policy-diff branch from 3ea03c3 to 4aa1355 Compare September 16, 2024 18:08
- markdownlint: specify json in fenced code block
- prettier: format doc, except powerful APIs table
@leotm leotm force-pushed the naugtur/policy-diff branch from 4aa1355 to e7ee012 Compare September 16, 2024 18:11
@leotm leotm self-requested a review September 16, 2024 18:12
Copy link
Member

@leotm leotm left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Contributor

@boneskull boneskull left a comment

Choose a reason for hiding this comment

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

  • I had a couple questions about intent and terminology that I think should be addressed (this and that).
  • Everything else is mostly just grammar & style. Honestly, I'm wondering if you should just merge this and I'll play copy editor after. 😄


The Policy File generated by LavaMoat is based on a scan of your codebase, identifying all the powers it uses. The initial policy doesn't provide security on its own. Instead, it's your review of the initial policy and the subsequent updates (with new or updated dependencies) that makes your application secure.

Reviewing diffs as you go lets you spot suspicious packages or limit the powers you wish newly added packages can use.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Reviewing diffs as you go lets you spot suspicious packages or limit the powers you wish newly added packages can use.
Reviewing diffs as dependencies change lets you spot suspicious packages and/or limit the powers granted to new dependencies.
  • again unsure about "powers"
  • "granted" may not be the right/consistent terminology

Reviewing diffs as you go lets you spot suspicious packages or limit the powers you wish newly added packages can use.

The review of your initial policy may seem like a lot of effort, but it's an investment in a good starting point for your application.
If you generate the initial policy from a known uncompromised version of your application, the main purpose of the initial review is to potentially take away some of the excessive powers from packages you don't use in their full capacity.
Copy link
Contributor

Choose a reason for hiding this comment

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

this is kind of a run-on sentence. maybe break up into something like

The purpose of the initial review is twofold: 

1. It helps you build confidence that the current state of your app is not compromised
2. You may deny powers to dependencies if you determine they are excessive (assuming it does not break your app)


The goal of reviewing the diff is to spot a malicious package being added.

#### TL;DR
Copy link
Contributor

Choose a reason for hiding this comment

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

this usually comes first 😄

Copy link
Member Author

Choose a reason for hiding this comment

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

It's a TLDR of this paragraph - what to look for.

Comment on lines 30 to 33
- check `globals` and `builtins` for new powers and investigate if you're surprised the package would need them
- check if new relationships in `packages` are pointing to packages with very [powerful APIs](#powerful-apis) (e.g. spawning child processes in Node.js)
- be aware that the identifier may change to `pkgC>actual-name` from `pkgB>pkgA>actual-name` BUT! If the package now also has totally different powers, it's likely a different package of the same name. Investigate! `npm ls actual-name` should help.
- when a new package is added, consider limiting its powers to what you actually use.
Copy link
Contributor

Choose a reason for hiding this comment

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

  • I'd capitalize the first letter of each list item
  • remove periods at the end of the last two items
  • he fourth item is unclear to me. you mean: identify the powers my app uses? (how do I do this?) I want to disallow anything that isn't in that my list of powers?

@naugtur
Copy link
Member Author

naugtur commented Sep 17, 2024

* Everything else is mostly just grammar & style.  Honestly, I'm wondering if you should just merge this and I'll play copy editor after. 😄

I hereby give you the explicit (altho not new) permission to add a commit with grammar/style edits to a branch where I write prose without asking first.

@naugtur naugtur merged commit 73b7a7f into main Sep 17, 2024
4 checks passed
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.

3 participants