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.
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
feat(lavamoat/lavadome): update integration to improve security #25653
feat(lavamoat/lavadome): update integration to improve security #25653
Changes from 4 commits
8ffe855
fc8f9dc
965044f
ad0e483
7d9fbd8
a1b9251
bfb52b7
b45f3c4
12c8181
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are the intrinsic not sufficiently protected by lavamoat?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no because LavaMoat protects TC39 JS intrinsics without taking platform oriented intrinsics into account (such as dom/web apis)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just FYI: there are 8 or 9 other files that already run before this "first" thing here (not including the lavamoat runtime wrapper):
And the next line after this
import '@lavamoat/lavadome-react';
is:So it is looking like we have a few files that already run before our "first" files, and we have two files that now "must be run first" (that won't be). I don't mind having a "first" comment in this file (despite it not actually being first in the context of the entire application), but we should certainly have only one of these comments in this file.
My current thinking is that
./lib/setup-initial-state-hooks
should be run beforelavadome-react
unless you can guarantee that@lavamoat/lavadome-react
will absolutely never be the cause of an error.In either case (
setup-initial-state-hooks
orlavadoem-react
running "first"), can you update the comments to reflect their actual "firstness"? :-)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As for the phrasing b45f3c4.
Regarding sentry before lavadome, i understand your concern, but eventually,
./lib/setup-initial-state-hooks
transitively requires tons of stuff that can end up undermining crucial LavaMoat related protections. This includes Snow, LavaMoat and LavaDome too - all of which we decided to trust to run before any other code we can't 100% trust. Just like LavaMoat and Snow, LavaDome can potentially cause an error, but we take all the measures needed to mitigate this risk as much as possible, and live with any small risk left of causing error, knowing that it's worth deploying powerful defense to our runtime environment.