Lavamoat build system integration for WebApp#12242
Conversation
This comment has been minimized.
This comment has been minimized.
… lavamoat-webapp-bg4
This comment has been minimized.
This comment has been minimized.
bbbb538 to
f80c385
Compare
Builds ready [f80c385]
Page Load Metrics (406 ± 49 ms)
|
|
TODO: review |
| browserPlatforms, | ||
| ); | ||
| renderHtmlFile('home', groupSet, commonSet, browserPlatforms); | ||
| useLavamoat: false, |
There was a problem hiding this comment.
It would be nice to pass in useLavamoat as a CLI flag
There was a problem hiding this comment.
im not sure the usecase, can add later. would need to specify it for every entry/webpage
There was a problem hiding this comment.
I mean so the Lavamoat build can be tested without modifying this file. You'd have to go through and swap every useLavamoat: false, to useLavamoat: true, right?
|
Lavamoat policy validation is here: https://github.com/MetaMask/metamask-extension/blob/develop/.circleci/config.yml#L171 So because the |
|
request for QA on firefox esp wrt to popup init perf |
|
add debugging information if policy fails https://github.com/MetaMask/metamask-extension/blob/develop/.circleci/scripts/validate-lavamoat-policy.sh#L9 |
… lavamoat-webapp-bg4
Builds ready [e464859]
Page Load Metrics (376 ± 44 ms)
|
|
Other than the popup init time issue I am 👍🏻 on this |
… lavamoat-webapp-bg4
|
@brad-decker did you see a difference in pop perf time with lavamoat disabled as it is now? |
|
removing e2e test delays that are likely only required for actually turning lavamoat on |
|
ive gotten a few QA reports that firefox popup startup perf looks fine |
brad-decker
left a comment
There was a problem hiding this comment.
With QA and my own testing not finding popup delays I'm good with this 💯
This reverts commit 79c3479.
|
removing delays failed 😿 |
Builds ready [0612a3f]
Page Load Metrics (371 ± 41 ms)
|
🌋 🦊 🌋 🦊 🌋 🦊 🌋 🦊 🌋 🦊 🌋 🦊 🌋 🦊 🌋 🦊 🌋 🦊 🌋 🦊 🌋 🦊 🌋 🦊 🌋 🦊 🌋
the next step in incrementally locking down metamask:
providing the build process with a switch for adding lavamoat to each page
currently does not apply lavamoat to any page
🌋 🦊 🌋 🦊 🌋 🦊 🌋 🦊 🌋 🦊 🌋 🦊 🌋 🦊 🌋 🦊 🌋 🦊 🌋 🦊 🌋 🦊 🌋 🦊 🌋 🦊 🌋
summary of code changes
app/*.htmlinclude aif-block to optionally apply lavamoat by loading the commonjs or lavamoat runtime. commonjs still needs an external lockdown scriptbuild/scripts.jschange packer tolavapack, append policy loader, and render html with theuseLavamoatswitchlavamoat/browserify, add combined background and ui policies (ui policy is not enforced yet)lavamoat/nodeupdate policies to include running lavamoat and other added depspackage.jsonadd new scripts for generating lavamoat policies and add depstest/e2e/tests/contract-interactions.spec.jsadd delays to fix race conditionyarn.locklavamoat dep additionssummary of work flow changes
yarn lavamoat:autoto update the policies. these policies are not applied yet, but makes PRs consistent with the future requirement where we will soon apply these policies when lavamoat is enabled.things to be aware of
withstatement is wrapping theglobalThis. This is done to have a matching module initialization structure to the lavamoat protected components.TODO:
ci - improve lavamoat validation debug info #12259
lockdown-run.jsadditions beyond lockdownlockdown - breakout making globalThis properties non-writable #12258