Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .depcheckrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"@vitest/coverage-istanbul",
"@vitest/eslint-plugin",
"@yarnpkg/types",
"@yarnpkg/shell",
Comment thread
FrederikBolding marked this conversation as resolved.
"eslint-config-*",
"eslint-import-resolver-typescript",
"eslint-plugin-*",
Expand Down
2 changes: 1 addition & 1 deletion .oxfmtrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"ignorePatterns": [".yarnrc.yml"],
"ignorePatterns": [".yarnrc.yml", "lavamoat"],
"printWidth": 80,
"quoteProps": "as-needed",
"singleQuote": true,
Expand Down
9 changes: 0 additions & 9 deletions .yarn/plugins/@yarnpkg/plugin-allow-scripts.cjs

This file was deleted.

15 changes: 13 additions & 2 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,20 @@ compressionLevel: mixed

enableGlobalCache: false

# Enable hardened mode to validate lockfile content against remote registries.
enableHardenedMode: true

# Disable Yarn's mirror feature to avoid writing to the global cache.
enableMirror: false
Comment on lines +13 to +14

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Even though we disable the global cache above, Yarn still mirrors the local cache to the global cache (meaning it's still writing there), which is disallowed by the runner plugin in certain cases, e.g., when running yarn dedupe in a script.


enableScripts: false

enableTelemetry: false

# Despite `enableGlobalCache` and `enableMirror` being `false`, Yarn is still
# writing to the global folder.
globalFolder: .yarn/global
Comment on lines +20 to +22

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yarn always instantiates the PNPM linker class (I think?), which does some setup in the constructor including creating folders in the Yarn global folder. To get around this, the global folder is now stored locally.


logFilters:
- code: YN0004
level: discard
Expand All @@ -28,6 +38,7 @@ npmPreapprovedPackages:
- '@metamask-previews/*'
- '@lavamoat/*'

# Protect the runtime of calls to "yarn run" scripts using a local plugin.
plugins:
- path: .yarn/plugins/@yarnpkg/plugin-allow-scripts.cjs
spec: 'https://raw.githubusercontent.com/LavaMoat/LavaMoat/main/packages/yarn-plugin-allow-scripts/bundles/@yarnpkg/plugin-allow-scripts.js'
- path: ./lavamoat/plugin-allow-scripts.js
- path: ./lavamoat/.runner-plugin.js
2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import vitest from '@metamask/eslint-config-vitest';

const config = createConfig([
{
ignores: ['dist/', 'docs/', '.yarn/'],
ignores: ['dist/', 'docs/', '.yarn/', 'lavamoat/'],
},

{
Expand Down
1 change: 1 addition & 0 deletions lavamoat/.env.ban.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["SESSION", "SSH", "KEY", "TOKEN", "SECRET", "PASSWORD", "AUTH"]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What is this

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

These are environment variables that are removed before running a script based on partial key match I believe.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

more specifically - all env vars containing these words will be censored.

Loading