-
Notifications
You must be signed in to change notification settings - Fork 28
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 #712
base: master
Are you sure you want to change the base?
feat: lavamoat #712
Conversation
c39da8d
to
2ada178
Compare
2ada178
to
2306201
Compare
@@ -0,0 +1,1383 @@ | |||
{ |
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.
This file is generated by lavamoat automatically (because we have generatePolicy: true
in our plugin config). All manual changes are done in the policy-override.json
fc421cb
to
e8c3382
Compare
} | ||
}); | ||
|
||
config.module.rules.push({ |
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.
Add comment for this rule also
"jquery": { | ||
"globals": { | ||
"document": true, | ||
"window": true, |
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.
When you allow window
, does it allow all window.*
?
"document.title": true | ||
} | ||
}, | ||
"unleash-proxy-client": { |
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.
This is our package, right?
"console": true, | ||
"Error": true, | ||
"Object": true, | ||
"XMLHttpRequest": true, |
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.
We send requests only through axios. Does it make sense to remove this and allow only in axios?
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.
Waiting dependencies review
Motivation
Add LavaMoat to protect against supply chain attacks and upgrade react-scripts to version 5.
Description
Added LavaMoat webpack plugin to production builds only. This required upgrading react-scripts from v4 to v5, which in turn required several changes:
Added react-app-rewired to customize the webpack config (and add the lavamoat plugin)
Added polyfills that were removed in react-scripts v5:
Created buffer-shim.js to handle Buffer compatibility issues in the elliptic package
Updated imports in our code to use browserify versions (e.g. path -> path-browserify)
Acceptance Criteria
LavaMoat runs only in production builds as
@lavamoat/webpack
is missing a hookDevelopment builds work without LavaMoat
All functionality remains unchanged with lavamoat and react-scripts v5 activated
Make sure you do not include new dependencies in the project unless strictly necessary and do not include dev-dependencies as production ones. More dependencies increase the possibility of one of them being hijacked and affecting us.