Repository navigation
feat: add a permission audit script for generating LavaMoat configs #344
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
Merged
Merged
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 e6b294f
Only classify reads as resolution probes
Mrtenz 1b31f3d
Run each CI command through the audit when debugging
Mrtenz 5854f0c
Name the build, lint, and test steps
Mrtenz 1c8343d
Show the audited command's output in debug runs
Mrtenz a0292b2
Print the report on the same stream as the config
Mrtenz e53dec9
Forward unrecognised arguments to the audited script
Mrtenz a9d9e4d
Rename script to `audit-script`
Mrtenz 0e2be29
Fix JSDoc for constants
Mrtenz 2a1b04d
Rename `CASE_INSENSITIVE` to `USE_CASE_INSENSITIVE_PATHS`
Mrtenz 7e693ac
Rename grant properties
Mrtenz f51191c
Rename functions
Mrtenz 58cd8e1
Further improve naming of prefixes
Mrtenz 94f32fe
Rename `passthrough` to `scriptArgs` and reorder parameters
Mrtenz bf6f53f
Remove redundant comments
Mrtenz 5410c2a
Rename `buildAncestors` and add explicit path parameter
Mrtenz 4a5fc0e
Clean up collect function
Mrtenz 44532a6
Add comment to `PERMISSION_AUDIT_LOG` usage
Mrtenz c1964b8
Clean up compareStrings function
Mrtenz bb92e92
Rename `report` to `reportSummary`
Mrtenz 5a666e6
Update `reportSummary` documentation
Mrtenz fd3a99b
Rename `isResolutionProbe` to `isAncestorSearchPath` and clarify purpose
Mrtenz 118563f
Clean up report output
Mrtenz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
|
@@ -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 | ||
| - name: Require clean working directory | ||
| shell: bash | ||
| run: | | ||
|
|
@@ -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: | | ||
|
|
@@ -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 | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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: | | ||
|
|
@@ -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 | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| lts/* | ||
| v26.9.0 | ||
|
mcmire marked this conversation as resolved.
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.