Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
7155726
Add a permission audit script for generating LavaMoat configs
Mrtenz Sep 24, 2026
e6b294f
Only classify reads as resolution probes
Mrtenz Sep 24, 2026
1b31f3d
Run each CI command through the audit when debugging
Mrtenz Sep 24, 2026
5854f0c
Name the build, lint, and test steps
Mrtenz Sep 24, 2026
1c8343d
Show the audited command's output in debug runs
Mrtenz Sep 24, 2026
a0292b2
Print the report on the same stream as the config
Mrtenz Sep 24, 2026
e53dec9
Forward unrecognised arguments to the audited script
Mrtenz Sep 24, 2026
a9d9e4d
Rename script to `audit-script`
Mrtenz Sep 28, 2026
0e2be29
Fix JSDoc for constants
Mrtenz Sep 28, 2026
2a1b04d
Rename `CASE_INSENSITIVE` to `USE_CASE_INSENSITIVE_PATHS`
Mrtenz Sep 28, 2026
7e693ac
Rename grant properties
Mrtenz Sep 28, 2026
f51191c
Rename functions
Mrtenz Sep 28, 2026
58cd8e1
Further improve naming of prefixes
Mrtenz Sep 28, 2026
94f32fe
Rename `passthrough` to `scriptArgs` and reorder parameters
Mrtenz Sep 28, 2026
bf6f53f
Remove redundant comments
Mrtenz Sep 28, 2026
5410c2a
Rename `buildAncestors` and add explicit path parameter
Mrtenz Sep 30, 2026
4a5fc0e
Clean up collect function
Mrtenz Sep 30, 2026
44532a6
Add comment to `PERMISSION_AUDIT_LOG` usage
Mrtenz Sep 30, 2026
c1964b8
Clean up compareStrings function
Mrtenz Sep 30, 2026
bb92e92
Rename `report` to `reportSummary`
Mrtenz Sep 30, 2026
5a666e6
Update `reportSummary` documentation
Mrtenz Sep 30, 2026
fd3a99b
Rename `isResolutionProbe` to `isAncestorSearchPath` and clarify purpose
Mrtenz Sep 30, 2026
118563f
Clean up report output
Mrtenz Sep 30, 2026
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
34 changes: 28 additions & 6 deletions .github/workflows/build-lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ on:
permissions:
contents: read

env:
# How each command below is invoked. Jobs override this when debug logging is
# enabled, so that commands run through the permission audit rather than
# directly, without every step needing a second copy of itself.
RUN: yarn

jobs:
prepare:
name: Prepare
Expand Down Expand Up @@ -36,7 +42,11 @@ jobs:
is-high-risk-environment: false
persist-credentials: false
node-version: ${{ matrix.node-version }}
- run: yarn build
- name: Enable permission audit for debug runs
if: ${{ runner.debug == '1' && matrix.node-version == '26.x' }}
run: echo 'RUN=yarn audit-script --verbose' >> "$GITHUB_ENV"
- name: Build
run: $RUN build
Comment thread
cursor[bot] marked this conversation as resolved.
- name: Require clean working directory
shell: bash
run: |
Expand All @@ -59,13 +69,17 @@ jobs:
is-high-risk-environment: false
persist-credentials: false
node-version: ${{ matrix.node-version }}
- run: yarn lint
- name: Enable permission audit for debug runs
if: ${{ runner.debug == '1' && matrix.node-version == '26.x' }}
run: echo 'RUN=yarn audit-script --verbose' >> "$GITHUB_ENV"
- name: Lint
run: $RUN lint
- name: Validate RC changelog
if: ${{ startsWith(github.head_ref, 'release/') }}
run: yarn lint:changelog --rc
run: $RUN lint:changelog --rc
- name: Validate changelog
if: ${{ !startsWith(github.head_ref, 'release/') }}
run: yarn lint:changelog
run: $RUN lint:changelog
- name: Require clean working directory
shell: bash
run: |
Expand All @@ -88,7 +102,11 @@ jobs:
is-high-risk-environment: false
persist-credentials: false
node-version: ${{ matrix.node-version }}
- run: yarn test
- name: Enable permission audit for debug runs
if: ${{ runner.debug == '1' && matrix.node-version == '26.x' }}
run: echo 'RUN=yarn audit-script --verbose' >> "$GITHUB_ENV"
- name: Test

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.

Can be seen here (expand the "Test" step).

run: $RUN test
- name: Require clean working directory
shell: bash
run: |
Expand All @@ -113,7 +131,11 @@ jobs:
node-version: ${{ matrix.node-version }}
- name: Install dependencies via Yarn
run: rm yarn.lock && YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn
- run: yarn test
- name: Enable permission audit for debug runs
if: ${{ runner.debug == '1' && matrix.node-version == '26.x' }}
run: echo 'RUN=yarn audit-script --verbose' >> "$GITHUB_ENV"
- name: Test
run: $RUN test
- name: Restore lockfile
run: git restore yarn.lock
- name: Require clean working directory
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lts/*
v26.9.0
Comment thread
mcmire marked this conversation as resolved.
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"registry": "https://registry.npmjs.org/"
},
"scripts": {
"audit-script": "node ./scripts/audit-script.ts",
"build": "tsc --project tsconfig.build.json",
"build:docs": "typedoc",
"lint": "yarn lint:oxlint && yarn lint:constraints && yarn lint:misc --check && yarn lint:dependencies --check && yarn lint:changelog",
Expand All @@ -52,7 +53,8 @@
"@metamask/oxlint-config-nodejs": "^0.1.1",
"@metamask/oxlint-config-typescript": "^0.1.1",
"@metamask/oxlint-config-vitest": "^0.1.1",
"@types/node": "^18.18",
Comment thread
Mrtenz marked this conversation as resolved.
"@types/node": "^26.6.2",
"@types/yargs": "^17.0.35",
"@typescript/native": "npm:typescript@^7.0.2",
"@vitest/coverage-istanbul": "^4.1.4",
"@vitest/eslint-plugin": "^1.1.4",
Expand All @@ -65,7 +67,8 @@
"typedoc": "^0.26.11",
"typescript": "npm:@typescript/typescript6@^6.0.2",
"vite": "^8.0.8",
"vitest": "^4.1.4"
"vitest": "^4.1.4",
"yargs": "^18.2.0"
},
"resolutions": {
"fflate": "0.8.2"
Expand All @@ -88,6 +91,7 @@
},
"scriptsConfig": {
"#default": "lavamoat/scripts.strict.json",
"audit-script": "lavamoat/scripts.yarn.json",
"build": "lavamoat/scripts.build.json",
"lint": "lavamoat/scripts.yarn.json",
"lint:changelog": "lavamoat/scripts.lint.json",
Expand Down
Loading
Loading