@preventive/triage 1.0.0-alpha.5 → 1.0.0-alpha.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE-APACHE +202 -0
- package/README.md +16 -0
- package/api/reap.ts +17 -0
- package/cli.js +6 -0
- package/client/dependency-paths.d.ts +3 -0
- package/client/dependency-paths.js +36 -0
- package/client/finding-link.js +305 -0
- package/client/linked-findings.d.ts +1 -0
- package/client/linked-findings.js +115 -0
- package/common/bundle-commit.d.ts +1 -0
- package/common/bundle-commit.js +4 -0
- package/common/bundle-compare-diff.d.ts +3 -0
- package/common/bundle-compare-diff.js +357 -0
- package/common/bundle-compare-inputs.d.ts +2 -0
- package/common/bundle-compare-inputs.js +65 -0
- package/common/bundle-compare-versions.js +172 -0
- package/common/bundle-comparison.d.ts +8 -0
- package/common/bundle-comparison.js +62 -0
- package/common/bundle-metadata.d.ts +15 -0
- package/common/bundle-metadata.js +226 -0
- package/common/bundle-pkg-of.d.ts +1 -0
- package/common/bundle-pkg-of.js +90 -0
- package/common/bundle-reasons.d.ts +2 -0
- package/common/bundle-reasons.js +21 -0
- package/common/bundle-source-links.d.ts +6 -0
- package/common/bundle-source-links.js +216 -0
- package/common/bundle-sourcemap.d.ts +10 -0
- package/common/bundle-sourcemap.js +100 -0
- package/common/bundle-sources.d.ts +7 -0
- package/common/bundle-sources.js +333 -0
- package/common/bundle-stats.js +41 -0
- package/common/bundle-tabs.js +1 -0
- package/common/code-language.js +65 -0
- package/common/default-scan-models.ts +31 -0
- package/common/dependency-reviews.d.ts +18 -0
- package/common/dependency-reviews.js +64 -0
- package/common/finding-duplicates.js +58 -0
- package/common/finding-filters.js +274 -0
- package/common/finding-id.js +47 -0
- package/common/github-issue-labels.d.ts +1 -0
- package/common/github-issue-labels.js +11 -0
- package/common/github-pr.ts +56 -0
- package/common/gzip.js +59 -0
- package/common/line-diff.d.ts +8 -0
- package/common/line-diff.js +57 -0
- package/common/linked-workspace-groups.js +63 -0
- package/common/managed/agent-tasks.ts +292 -0
- package/common/managed/comments.ts +34 -0
- package/common/managed/finding-detail.d.ts +2 -0
- package/common/managed/finding-detail.js +32 -0
- package/common/managed/github-agents.ts +114 -0
- package/common/managed/github-logins.ts +49 -0
- package/common/managed/npm-packages.d.ts +5 -0
- package/common/managed/npm-packages.js +34 -0
- package/common/managed/permissions.ts +31 -0
- package/common/managed/report-content.ts +72 -0
- package/common/managed/report-filter.ts +109 -0
- package/common/managed/repository-alias.ts +65 -0
- package/common/managed/roles.ts +35 -0
- package/common/managed/routes.d.ts +2 -0
- package/common/managed/routes.js +347 -0
- package/common/managed/scan-models.ts +6 -0
- package/common/managed/team-app.d.ts +5 -0
- package/common/managed/team-app.js +31 -0
- package/common/managed/triage.ts +83 -0
- package/common/managed/upload-seal.ts +126 -0
- package/common/pretty-print.d.ts +5 -0
- package/common/pretty-print.js +24 -0
- package/common/revalidation-conflicts.js +48 -0
- package/common/revalidation-input-groups.js +56 -0
- package/common/save-error-reason.ts +20 -7
- package/common/scan-server.ts +13 -0
- package/common/security-links.d.ts +5 -0
- package/common/security-links.js +33 -0
- package/common/server-info.ts +46 -0
- package/common/utf8.d.ts +3 -0
- package/common/utf8.js +45 -0
- package/common/workspace-app.js +39 -0
- package/common/workspace-groups.js +176 -0
- package/out/activity.js +4 -0
- package/out/brotli-fallback.js +3 -3
- package/out/chunk-2WDZPXVL.js +3 -0
- package/out/chunk-2XUEZHIP.js +28 -0
- package/out/chunk-2ZDZWLFY.js +1 -0
- package/out/chunk-4HI2MSAV.js +17 -0
- package/out/chunk-4XMP7YVH.js +36 -0
- package/out/chunk-6LNQTKAV.js +52 -0
- package/out/chunk-6S2U2UYG.js +232 -0
- package/out/chunk-75YLHBCM.js +3 -0
- package/out/chunk-7BKKYVWR.js +7 -0
- package/out/chunk-7C7DWL7I.js +1 -0
- package/out/chunk-7VAWINQF.js +6 -0
- package/out/chunk-C4Z6ZBXV.js +10 -0
- package/out/chunk-FC65TPUB.js +1 -0
- package/out/chunk-FKBXNUW4.js +1 -0
- package/out/chunk-GDPCLSOS.js +2 -0
- package/out/chunk-GO7FT4OD.js +1 -0
- package/out/chunk-HTBYHSPG.js +1 -0
- package/out/chunk-IYPY47MC.js +1 -0
- package/out/chunk-IZ7POWI3.js +18 -0
- package/out/chunk-JCIIBLKR.js +1 -0
- package/out/chunk-NRPC74AM.js +1 -0
- package/out/chunk-OOJM4CTU.js +1 -0
- package/out/chunk-PBZPYIG7.js +1 -0
- package/out/chunk-PNHBZGDD.js +1 -0
- package/out/chunk-PWFUOLZK.js +17 -0
- package/out/chunk-PXK7EU4V.js +1 -0
- package/out/chunk-QB4CBOX2.js +1 -0
- package/out/chunk-R3NZFXVR.js +1 -0
- package/out/chunk-R5O6FAW4.js +2 -0
- package/out/chunk-SXV2T5C4.js +80 -0
- package/out/chunk-TQJDYHVE.js +2 -0
- package/out/chunk-TUII34K2.js +1 -0
- package/out/chunk-UK7RGJT6.js +3 -0
- package/out/chunk-VFWMQ3LG.js +2 -0
- package/out/chunk-VH4XMZIW.js +2 -0
- package/out/chunk-WCPJDAYA.js +10 -0
- package/out/chunk-WFYLMF6Z.js +10 -0
- package/out/chunk-WYLQWYLA.js +1 -0
- package/out/client-managed-import.js +4 -0
- package/out/client-managed.js +33 -0
- package/out/client-sync.js +11 -17
- package/out/compare.js +35 -0
- package/out/dialogs.js +55 -0
- package/out/github-issue-authorized.html +3 -0
- package/out/github-issue-authorized.js +1 -0
- package/out/graph.js +17 -4
- package/out/index.html +90 -8
- package/out/prism.js +14 -10
- package/out/scan.js +2 -0
- package/out/stasis.svg +20 -0
- package/out/terminal.js +366 -39
- package/out/view.css +1 -1
- package/out/view.js +19 -144
- package/package.json +362 -59
- package/risk/actions/findings.js +161 -0
- package/risk/actions/resolve.js +219 -0
- package/risk/actions/scripts/commands.js +182 -0
- package/risk/actions/scripts/grade.js +113 -0
- package/risk/actions/scripts/packages.js +123 -0
- package/risk/actions/scripts/shell.js +169 -0
- package/risk/actions/uses.js +76 -0
- package/risk/actions/workflow.js +110 -0
- package/risk/files/characters.js +196 -0
- package/risk/files/hosts.js +205 -0
- package/risk/files/readability.js +177 -0
- package/risk/files/runs-code.js +615 -0
- package/risk/files/script.js +118 -0
- package/risk/files/stamps.js +47 -0
- package/risk/index.d.ts +254 -0
- package/risk/index.js +11 -0
- package/risk/npm/assess.js +285 -0
- package/risk/npm/combined.js +68 -0
- package/risk/npm/compare.js +257 -0
- package/risk/npm/dependencies.js +172 -0
- package/risk/npm/diff.js +79 -0
- package/risk/npm/downloads.js +84 -0
- package/risk/npm/files.js +445 -0
- package/risk/npm/held.js +63 -0
- package/risk/npm/install-scripts.js +34 -0
- package/risk/npm/malware.js +36 -0
- package/risk/npm/manifest.js +65 -0
- package/risk/npm/new-dependency.js +60 -0
- package/risk/npm/old-version.js +108 -0
- package/risk/npm/registry.js +388 -0
- package/risk/npm/release.js +85 -0
- package/risk/npm/score.js +59 -0
- package/risk/npm/specs.js +124 -0
- package/risk/npm/tarball.js +96 -0
- package/server-common/database-config.ts +16 -0
- package/server-common/initialize.ts +18 -0
- package/server-common/npm-advisories.ts +101 -0
- package/{server → server-common}/origin.ts +5 -5
- package/server-common/reap.ts +48 -0
- package/server-common/scan-config.ts +19 -0
- package/server-common/standalone.ts +29 -0
- package/server-common/storage-crypto.ts +182 -0
- package/server-common/storage-log.ts +38 -0
- package/server-common/vercel-blob.ts +103 -0
- package/server-e2e/app.ts +487 -0
- package/{server → server-e2e}/bus-receiver.ts +2 -1
- package/{server → server-e2e}/cli.js +9 -4
- package/{server → server-e2e}/config.ts +50 -42
- package/{server → server-e2e}/db-neon.ts +2 -2
- package/{server → server-e2e}/db-revision-sql.ts +1 -1
- package/{server → server-e2e}/db-stmt.ts +2 -2
- package/{server → server-e2e}/db.ts +7 -7
- package/{server → server-e2e}/http.ts +44 -13
- package/{server → server-e2e}/hub.ts +40 -9
- package/server-e2e/index.ts +17 -0
- package/server-e2e/lifecycle.ts +95 -0
- package/{server → server-e2e}/neon-driver.ts +2 -2
- package/{server → server-e2e}/npm-proxy.ts +12 -145
- package/{server → server-e2e}/objstore/blob-vercel.ts +10 -114
- package/{server → server-e2e}/objstore/blob.ts +1 -1
- package/server-e2e/objstore/fetch-mint-guard.ts +74 -0
- package/{server → server-e2e}/objstore/handlers.ts +9 -8
- package/{server → server-e2e}/objstore/init.ts +19 -27
- package/{server → server-e2e}/objstore/reaper.ts +1 -1
- package/server-e2e/objstore/rest-deny.ts +28 -0
- package/server-e2e/objstore/rest-mint.ts +224 -0
- package/{server → server-e2e}/objstore/rest.ts +3 -3
- package/{server → server-e2e}/objstore/store-neon.ts +6 -10
- package/{server → server-e2e}/objstore/store.ts +7 -7
- package/{server → server-e2e}/objstore/tokens.ts +2 -2
- package/{server → server-e2e}/pubsub.ts +12 -9
- package/{server → server-e2e}/sign.ts +4 -4
- package/{server → server-e2e}/sse-server.ts +60 -33
- package/{server → server-e2e}/static.ts +31 -21
- package/{server → server-e2e}/sync-handlers.ts +64 -30
- package/{server → server-e2e}/ws-server.ts +20 -9
- package/server-managed/activity.ts +258 -0
- package/server-managed/agent-merges.ts +109 -0
- package/server-managed/app-agents.ts +21 -0
- package/server-managed/avatar-store.ts +13 -0
- package/server-managed/blob-store.ts +17 -0
- package/server-managed/brotli.ts +10 -0
- package/server-managed/bundle-advisories.ts +120 -0
- package/server-managed/bundle-advisory-inventory.ts +77 -0
- package/server-managed/bundle-build-diagnostics.d.ts +10 -0
- package/server-managed/bundle-build-diagnostics.js +23 -0
- package/server-managed/bundle-build-leases.ts +41 -0
- package/server-managed/bundle-build-worker.js +115 -0
- package/server-managed/bundle-build.ts +200 -0
- package/server-managed/bundle-cache.ts +211 -0
- package/server-managed/bundle-catalog.ts +29 -0
- package/server-managed/bundle-commits.ts +140 -0
- package/server-managed/bundle-store.ts +24 -0
- package/server-managed/bundle-summary-cache.ts +130 -0
- package/server-managed/bundle.ts +119 -0
- package/server-managed/cache-storage.ts +20 -0
- package/server-managed/cli.js +21 -0
- package/server-managed/combined.ts +47 -0
- package/server-managed/comments.ts +151 -0
- package/server-managed/commit-coauthors.ts +106 -0
- package/server-managed/commit-lockfiles.ts +73 -0
- package/server-managed/comparison.ts +41 -0
- package/server-managed/config.ts +164 -0
- package/server-managed/content-access.ts +15 -0
- package/server-managed/crypto.ts +25 -0
- package/server-managed/db-methods.ts +1923 -0
- package/server-managed/db-neon.ts +458 -0
- package/server-managed/db-schema.ts +238 -0
- package/server-managed/db-table-names.ts +22 -0
- package/server-managed/db.ts +142 -0
- package/server-managed/dependabot-access.ts +60 -0
- package/server-managed/dependabot-alerts.ts +185 -0
- package/server-managed/dependency-review-comments.ts +100 -0
- package/server-managed/dependency-reviews.ts +346 -0
- package/server-managed/github-accounts.ts +60 -0
- package/server-managed/github-actions.ts +71 -0
- package/server-managed/github-app.ts +415 -0
- package/server-managed/github-errors.ts +70 -0
- package/server-managed/github-graphql.ts +39 -0
- package/server-managed/github-issue-links.ts +140 -0
- package/server-managed/github-issue-oauth.ts +47 -0
- package/server-managed/github-issues.ts +152 -0
- package/server-managed/github-link-oauth.ts +69 -0
- package/server-managed/github-links.ts +204 -0
- package/server-managed/github-metadata.ts +213 -0
- package/server-managed/github-oauth.ts +238 -0
- package/server-managed/github-pulls.ts +227 -0
- package/server-managed/github-requests.ts +39 -0
- package/server-managed/github-users.ts +30 -0
- package/server-managed/http-response.ts +76 -0
- package/server-managed/http.ts +5329 -0
- package/server-managed/import-triage.ts +51 -0
- package/server-managed/index.ts +192 -0
- package/server-managed/kept-briefly.ts +37 -0
- package/server-managed/kept.ts +28 -0
- package/server-managed/link-reports.ts +162 -0
- package/server-managed/locked-packages.ts +129 -0
- package/server-managed/lockfile-scope.ts +49 -0
- package/server-managed/lru.ts +30 -0
- package/server-managed/managed-issues.ts +78 -0
- package/server-managed/management-catalog.ts +45 -0
- package/server-managed/management.ts +99 -0
- package/server-managed/npm-delta-worker.js +23 -0
- package/server-managed/npm-delta.ts +194 -0
- package/server-managed/npm-insights.ts +449 -0
- package/server-managed/npm-kept.ts +215 -0
- package/server-managed/npm-loads.ts +264 -0
- package/server-managed/npm-manifest.ts +115 -0
- package/server-managed/npm-packages.ts +454 -0
- package/server-managed/npm-provenance.ts +123 -0
- package/server-managed/npm-risk.ts +285 -0
- package/server-managed/object-storage-disk.ts +148 -0
- package/server-managed/object-storage-vercel.ts +67 -0
- package/server-managed/object-storage.ts +75 -0
- package/server-managed/package-entry-points.ts +51 -0
- package/server-managed/pretty-print.ts +434 -0
- package/server-managed/public-workspace.ts +238 -0
- package/server-managed/pull-comment-reviews.ts +161 -0
- package/server-managed/pull-dependencies.ts +348 -0
- package/server-managed/pull-dependency-reviews.ts +328 -0
- package/server-managed/pull-reviews.ts +205 -0
- package/server-managed/queue.ts +39 -0
- package/server-managed/release-commits.ts +84 -0
- package/server-managed/rename-diff-worker.js +26 -0
- package/server-managed/rename-diff.ts +279 -0
- package/server-managed/repo-path.ts +21 -0
- package/server-managed/report-migration.ts +35 -0
- package/server-managed/report-query.ts +10 -0
- package/server-managed/report-response.ts +16 -0
- package/server-managed/report-sources.ts +178 -0
- package/server-managed/report-store.ts +85 -0
- package/server-managed/repository-actions.ts +218 -0
- package/server-managed/repository-agents.ts +355 -0
- package/server-managed/repository-aliases.ts +91 -0
- package/server-managed/repository-browser.ts +294 -0
- package/server-managed/repository-changes.ts +284 -0
- package/server-managed/repository-code.ts +215 -0
- package/server-managed/repository-dependency-reviews.ts +165 -0
- package/server-managed/repository-discovery.ts +82 -0
- package/server-managed/repository-history.ts +432 -0
- package/server-managed/repository-issues.ts +195 -0
- package/server-managed/repository-policy.ts +27 -0
- package/server-managed/repository-pulls.ts +156 -0
- package/server-managed/repository-pulse.ts +460 -0
- package/server-managed/repository-risk-assess.ts +105 -0
- package/server-managed/repository-risk-audit.ts +79 -0
- package/server-managed/repository-risk-read.ts +170 -0
- package/server-managed/repository-risk.ts +491 -0
- package/server-managed/repository-squashes.ts +168 -0
- package/server-managed/request-timing.ts +63 -0
- package/server-managed/reviewed-dependencies.ts +150 -0
- package/server-managed/revisions.ts +35 -0
- package/server-managed/scan-downloads.ts +87 -0
- package/server-managed/session.ts +132 -0
- package/server-managed/slugs.ts +38 -0
- package/server-managed/solidity-entry-points.ts +71 -0
- package/server-managed/sql-postgres.ts +34 -0
- package/server-managed/sql.ts +88 -0
- package/server-managed/static.ts +28 -0
- package/server-managed/storage-command.ts +16 -0
- package/server-managed/storage-db.ts +183 -0
- package/server-managed/storage-encryption.ts +290 -0
- package/server-managed/storage-maintenance.ts +259 -0
- package/server-managed/storage-payload.ts +121 -0
- package/server-managed/storage-stores.ts +91 -0
- package/server-managed/storage.ts +82 -0
- package/server-managed/team-app.ts +134 -0
- package/server-managed/team-catalog.ts +7 -0
- package/server-managed/team-feed.ts +180 -0
- package/server-managed/team-npm-scopes.ts +106 -0
- package/server-managed/team-reports.ts +307 -0
- package/server-managed/triage-response.ts +16 -0
- package/server-managed/type-only-worker.js +19 -0
- package/server-managed/type-only.ts +105 -0
- package/server-managed/uploads.ts +106 -0
- package/server-managed/upstream-cache.ts +243 -0
- package/server-managed/view-as.ts +58 -0
- package/server-managed/workspace-shares.ts +169 -0
- package/server.ts +70 -0
- package/server/index.ts +0 -480
- package/server/lifecycle.ts +0 -208
- /package/{LICENSE → LICENSE-MIT} +0 -0
- /package/{server → server-e2e}/auth.ts +0 -0
- /package/{server → server-e2e}/config.example.json +0 -0
- /package/{server → server-e2e}/objstore/blob-fs.ts +0 -0
- /package/{server → server-e2e}/objstore/fs.ts +0 -0
- /package/{server → server-e2e}/objstore/sign.ts +0 -0
- /package/{server → server-e2e}/peer.ts +0 -0
- /package/{server → server-e2e}/sse-session.ts +0 -0
- /package/{server → server-e2e}/util.ts +0 -0
- /package/{server → server-e2e}/validation.ts +0 -0
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@preventive/triage",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.50",
|
|
4
4
|
"description": "Client & relay server for triaging of automated reports",
|
|
5
|
-
"license": "MIT",
|
|
5
|
+
"license": "MIT OR Apache-2.0",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Nikita Skovoroda",
|
|
8
8
|
"email": "chalkerx@gmail.com",
|
|
@@ -29,63 +29,344 @@
|
|
|
29
29
|
"#client/sync-host.js": "./client/sync-host.js"
|
|
30
30
|
},
|
|
31
31
|
"exports": {
|
|
32
|
-
"./
|
|
32
|
+
"./reap": "./api/reap.ts",
|
|
33
|
+
"./server": "./server.ts",
|
|
34
|
+
"./server-e2e": "./server-e2e/index.ts",
|
|
35
|
+
"./bundle-build-worker": "./server-managed/bundle-build-worker.js",
|
|
33
36
|
"./strip-types-loader": "./strip-types-loader.js",
|
|
34
37
|
"./package.json": "./package.json"
|
|
35
38
|
},
|
|
36
39
|
"bin": {
|
|
37
|
-
"triage-server": "
|
|
40
|
+
"triage-server": "cli.js",
|
|
41
|
+
"triage-e2e-server": "server-e2e/cli.js",
|
|
42
|
+
"triage-managed-server": "server-managed/cli.js"
|
|
38
43
|
},
|
|
39
44
|
"files": [
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"server
|
|
45
|
-
"server/
|
|
46
|
-
"server/
|
|
47
|
-
"server/
|
|
48
|
-
"server/
|
|
49
|
-
"server/
|
|
50
|
-
"server/
|
|
51
|
-
"server/
|
|
52
|
-
"server/
|
|
53
|
-
"server/
|
|
54
|
-
"server/
|
|
55
|
-
"server/
|
|
56
|
-
"server/
|
|
57
|
-
"server/
|
|
58
|
-
"server/
|
|
59
|
-
"server/
|
|
60
|
-
"server/objstore/
|
|
61
|
-
"server/objstore/
|
|
62
|
-
"server/objstore/
|
|
63
|
-
"server/objstore/
|
|
64
|
-
"server/objstore/
|
|
65
|
-
"server/objstore/
|
|
66
|
-
"server/
|
|
67
|
-
"server/
|
|
68
|
-
"server/
|
|
69
|
-
"server/
|
|
70
|
-
"server/
|
|
71
|
-
"server/
|
|
72
|
-
"server/
|
|
73
|
-
"server/
|
|
74
|
-
"server/
|
|
75
|
-
"server/
|
|
76
|
-
"server/
|
|
77
|
-
"server/
|
|
45
|
+
"LICENSE-APACHE",
|
|
46
|
+
"LICENSE-MIT",
|
|
47
|
+
"api/reap.ts",
|
|
48
|
+
"cli.js",
|
|
49
|
+
"server.ts",
|
|
50
|
+
"server-e2e/app.ts",
|
|
51
|
+
"server-e2e/auth.ts",
|
|
52
|
+
"server-e2e/bus-receiver.ts",
|
|
53
|
+
"server-e2e/cli.js",
|
|
54
|
+
"server-e2e/config.ts",
|
|
55
|
+
"server-e2e/db-neon.ts",
|
|
56
|
+
"server-e2e/db-revision-sql.ts",
|
|
57
|
+
"server-e2e/db-stmt.ts",
|
|
58
|
+
"server-e2e/db.ts",
|
|
59
|
+
"server-e2e/http.ts",
|
|
60
|
+
"server-e2e/hub.ts",
|
|
61
|
+
"server-e2e/index.ts",
|
|
62
|
+
"server-e2e/lifecycle.ts",
|
|
63
|
+
"server-e2e/neon-driver.ts",
|
|
64
|
+
"server-e2e/npm-proxy.ts",
|
|
65
|
+
"server-e2e/objstore/blob-fs.ts",
|
|
66
|
+
"server-e2e/objstore/blob-vercel.ts",
|
|
67
|
+
"server-e2e/objstore/blob.ts",
|
|
68
|
+
"server-e2e/objstore/fetch-mint-guard.ts",
|
|
69
|
+
"server-e2e/objstore/fs.ts",
|
|
70
|
+
"server-e2e/objstore/handlers.ts",
|
|
71
|
+
"server-e2e/objstore/init.ts",
|
|
72
|
+
"server-e2e/objstore/reaper.ts",
|
|
73
|
+
"server-e2e/objstore/rest-deny.ts",
|
|
74
|
+
"server-e2e/objstore/rest-mint.ts",
|
|
75
|
+
"server-e2e/objstore/rest.ts",
|
|
76
|
+
"server-e2e/objstore/sign.ts",
|
|
77
|
+
"server-e2e/objstore/store-neon.ts",
|
|
78
|
+
"server-e2e/objstore/store.ts",
|
|
79
|
+
"server-e2e/objstore/tokens.ts",
|
|
80
|
+
"server-e2e/peer.ts",
|
|
81
|
+
"server-e2e/pubsub.ts",
|
|
82
|
+
"server-e2e/sign.ts",
|
|
83
|
+
"server-e2e/sse-server.ts",
|
|
84
|
+
"server-e2e/sse-session.ts",
|
|
85
|
+
"server-e2e/static.ts",
|
|
86
|
+
"server-e2e/sync-handlers.ts",
|
|
87
|
+
"server-e2e/util.ts",
|
|
88
|
+
"server-e2e/validation.ts",
|
|
89
|
+
"server-e2e/ws-server.ts",
|
|
90
|
+
"server-e2e/config.example.json",
|
|
91
|
+
"server-managed/activity.ts",
|
|
92
|
+
"server-managed/agent-merges.ts",
|
|
93
|
+
"server-managed/release-commits.ts",
|
|
94
|
+
"server-managed/app-agents.ts",
|
|
95
|
+
"server-managed/avatar-store.ts",
|
|
96
|
+
"server-managed/blob-store.ts",
|
|
97
|
+
"server-managed/brotli.ts",
|
|
98
|
+
"server-managed/bundle-advisories.ts",
|
|
99
|
+
"server-managed/bundle-advisory-inventory.ts",
|
|
100
|
+
"server-managed/bundle-cache.ts",
|
|
101
|
+
"server-managed/bundle-build.ts",
|
|
102
|
+
"server-managed/bundle-build-leases.ts",
|
|
103
|
+
"server-managed/bundle-build-worker.js",
|
|
104
|
+
"server-managed/bundle-build-diagnostics.js",
|
|
105
|
+
"server-managed/bundle-build-diagnostics.d.ts",
|
|
106
|
+
"server-managed/bundle-catalog.ts",
|
|
107
|
+
"server-managed/bundle-commits.ts",
|
|
108
|
+
"server-managed/bundle-store.ts",
|
|
109
|
+
"server-managed/bundle-summary-cache.ts",
|
|
110
|
+
"server-managed/bundle.ts",
|
|
111
|
+
"server-managed/cache-storage.ts",
|
|
112
|
+
"server-managed/cli.js",
|
|
113
|
+
"server-managed/combined.ts",
|
|
114
|
+
"server-managed/commit-coauthors.ts",
|
|
115
|
+
"server-managed/comparison.ts",
|
|
116
|
+
"server-managed/comments.ts",
|
|
117
|
+
"server-managed/config.ts",
|
|
118
|
+
"server-managed/content-access.ts",
|
|
119
|
+
"server-managed/crypto.ts",
|
|
120
|
+
"server-managed/db-methods.ts",
|
|
121
|
+
"server-managed/db-neon.ts",
|
|
122
|
+
"server-managed/db-schema.ts",
|
|
123
|
+
"server-managed/db-table-names.ts",
|
|
124
|
+
"server-managed/db.ts",
|
|
125
|
+
"server-managed/dependabot-access.ts",
|
|
126
|
+
"server-managed/dependabot-alerts.ts",
|
|
127
|
+
"server-managed/dependency-review-comments.ts",
|
|
128
|
+
"server-managed/dependency-reviews.ts",
|
|
129
|
+
"server-managed/github-accounts.ts",
|
|
130
|
+
"server-managed/github-actions.ts",
|
|
131
|
+
"server-managed/github-app.ts",
|
|
132
|
+
"server-managed/github-errors.ts",
|
|
133
|
+
"server-managed/github-graphql.ts",
|
|
134
|
+
"server-managed/github-metadata.ts",
|
|
135
|
+
"server-managed/github-issue-oauth.ts",
|
|
136
|
+
"server-managed/github-issues.ts",
|
|
137
|
+
"server-managed/github-issue-links.ts",
|
|
138
|
+
"server-managed/github-link-oauth.ts",
|
|
139
|
+
"server-managed/github-links.ts",
|
|
140
|
+
"server-managed/github-users.ts",
|
|
141
|
+
"server-managed/github-oauth.ts",
|
|
142
|
+
"server-managed/github-pulls.ts",
|
|
143
|
+
"server-managed/github-requests.ts",
|
|
144
|
+
"server-managed/http-response.ts",
|
|
145
|
+
"server-managed/http.ts",
|
|
146
|
+
"server-managed/link-reports.ts",
|
|
147
|
+
"server-managed/locked-packages.ts",
|
|
148
|
+
"server-managed/lru.ts",
|
|
149
|
+
"server-managed/import-triage.ts",
|
|
150
|
+
"server-managed/managed-issues.ts",
|
|
151
|
+
"server-managed/management.ts",
|
|
152
|
+
"server-managed/management-catalog.ts",
|
|
153
|
+
"server-managed/object-storage.ts",
|
|
154
|
+
"server-managed/object-storage-disk.ts",
|
|
155
|
+
"server-managed/object-storage-vercel.ts",
|
|
156
|
+
"server-managed/index.ts",
|
|
157
|
+
"server-managed/npm-insights.ts",
|
|
158
|
+
"server-managed/npm-risk.ts",
|
|
159
|
+
"server-managed/npm-provenance.ts",
|
|
160
|
+
"server-managed/kept.ts",
|
|
161
|
+
"server-managed/kept-briefly.ts",
|
|
162
|
+
"server-managed/npm-kept.ts",
|
|
163
|
+
"server-managed/npm-loads.ts",
|
|
164
|
+
"server-managed/npm-delta.ts",
|
|
165
|
+
"server-managed/npm-delta-worker.js",
|
|
166
|
+
"server-managed/lockfile-scope.ts",
|
|
167
|
+
"server-managed/npm-manifest.ts",
|
|
168
|
+
"server-managed/npm-packages.ts",
|
|
169
|
+
"server-managed/package-entry-points.ts",
|
|
170
|
+
"server-managed/pretty-print.ts",
|
|
171
|
+
"server-managed/pull-reviews.ts",
|
|
172
|
+
"server-managed/rename-diff.ts",
|
|
173
|
+
"server-managed/rename-diff-worker.js",
|
|
174
|
+
"server-managed/public-workspace.ts",
|
|
175
|
+
"server-managed/pull-dependencies.ts",
|
|
176
|
+
"server-managed/pull-dependency-reviews.ts",
|
|
177
|
+
"server-managed/pull-comment-reviews.ts",
|
|
178
|
+
"server-managed/commit-lockfiles.ts",
|
|
179
|
+
"server-managed/queue.ts",
|
|
180
|
+
"server-managed/repo-path.ts",
|
|
181
|
+
"server-managed/report-migration.ts",
|
|
182
|
+
"server-managed/report-query.ts",
|
|
183
|
+
"server-managed/report-response.ts",
|
|
184
|
+
"server-managed/report-store.ts",
|
|
185
|
+
"server-managed/report-sources.ts",
|
|
186
|
+
"server-managed/revisions.ts",
|
|
187
|
+
"server-managed/repository-browser.ts",
|
|
188
|
+
"server-managed/repository-changes.ts",
|
|
189
|
+
"server-managed/repository-code.ts",
|
|
190
|
+
"server-managed/repository-dependency-reviews.ts",
|
|
191
|
+
"server-managed/request-timing.ts",
|
|
192
|
+
"server-managed/reviewed-dependencies.ts",
|
|
193
|
+
"server-managed/repository-agents.ts",
|
|
194
|
+
"server-managed/repository-history.ts",
|
|
195
|
+
"server-managed/repository-squashes.ts",
|
|
196
|
+
"server-managed/repository-issues.ts",
|
|
197
|
+
"server-managed/repository-pulse.ts",
|
|
198
|
+
"server-managed/repository-pulls.ts",
|
|
199
|
+
"server-managed/repository-aliases.ts",
|
|
200
|
+
"server-managed/repository-discovery.ts",
|
|
201
|
+
"server-managed/repository-policy.ts",
|
|
202
|
+
"server-managed/repository-actions.ts",
|
|
203
|
+
"server-managed/repository-risk.ts",
|
|
204
|
+
"server-managed/repository-risk-assess.ts",
|
|
205
|
+
"server-managed/repository-risk-audit.ts",
|
|
206
|
+
"server-managed/repository-risk-read.ts",
|
|
207
|
+
"server-managed/scan-downloads.ts",
|
|
208
|
+
"server-managed/session.ts",
|
|
209
|
+
"server-managed/slugs.ts",
|
|
210
|
+
"server-managed/solidity-entry-points.ts",
|
|
211
|
+
"server-managed/sql-postgres.ts",
|
|
212
|
+
"server-managed/sql.ts",
|
|
213
|
+
"server-managed/static.ts",
|
|
214
|
+
"server-managed/storage.ts",
|
|
215
|
+
"server-managed/storage-command.ts",
|
|
216
|
+
"server-managed/storage-db.ts",
|
|
217
|
+
"server-managed/storage-encryption.ts",
|
|
218
|
+
"server-managed/storage-maintenance.ts",
|
|
219
|
+
"server-managed/storage-payload.ts",
|
|
220
|
+
"server-managed/storage-stores.ts",
|
|
221
|
+
"server-managed/team-catalog.ts",
|
|
222
|
+
"server-managed/team-feed.ts",
|
|
223
|
+
"server-managed/team-npm-scopes.ts",
|
|
224
|
+
"server-managed/team-app.ts",
|
|
225
|
+
"server-managed/team-reports.ts",
|
|
226
|
+
"server-managed/triage-response.ts",
|
|
227
|
+
"server-managed/type-only.ts",
|
|
228
|
+
"server-managed/type-only-worker.js",
|
|
229
|
+
"server-managed/uploads.ts",
|
|
230
|
+
"server-managed/view-as.ts",
|
|
231
|
+
"server-managed/upstream-cache.ts",
|
|
232
|
+
"server-managed/workspace-shares.ts",
|
|
233
|
+
"server-common/database-config.ts",
|
|
234
|
+
"server-common/initialize.ts",
|
|
235
|
+
"server-common/reap.ts",
|
|
236
|
+
"server-common/npm-advisories.ts",
|
|
237
|
+
"server-common/origin.ts",
|
|
238
|
+
"server-common/standalone.ts",
|
|
239
|
+
"server-common/storage-log.ts",
|
|
240
|
+
"server-common/storage-crypto.ts",
|
|
241
|
+
"server-common/vercel-blob.ts",
|
|
242
|
+
"server-common/scan-config.ts",
|
|
243
|
+
"common/bundle-commit.d.ts",
|
|
244
|
+
"common/bundle-commit.js",
|
|
245
|
+
"common/bundle-compare-diff.js",
|
|
246
|
+
"common/bundle-compare-versions.js",
|
|
247
|
+
"common/bundle-comparison.d.ts",
|
|
248
|
+
"common/bundle-comparison.js",
|
|
249
|
+
"common/bundle-compare-diff.d.ts",
|
|
250
|
+
"common/bundle-compare-inputs.d.ts",
|
|
251
|
+
"common/bundle-compare-inputs.js",
|
|
252
|
+
"common/bundle-metadata.d.ts",
|
|
253
|
+
"common/bundle-pkg-of.d.ts",
|
|
254
|
+
"common/bundle-pkg-of.js",
|
|
255
|
+
"common/bundle-metadata.js",
|
|
256
|
+
"common/bundle-reasons.d.ts",
|
|
257
|
+
"common/bundle-reasons.js",
|
|
258
|
+
"common/bundle-sources.d.ts",
|
|
259
|
+
"common/bundle-sources.js",
|
|
260
|
+
"common/bundle-source-links.d.ts",
|
|
261
|
+
"common/bundle-source-links.js",
|
|
262
|
+
"common/bundle-sourcemap.d.ts",
|
|
263
|
+
"common/bundle-sourcemap.js",
|
|
264
|
+
"common/bundle-stats.js",
|
|
265
|
+
"common/bundle-tabs.js",
|
|
266
|
+
"common/code-language.js",
|
|
267
|
+
"common/default-scan-models.ts",
|
|
268
|
+
"common/dependency-reviews.js",
|
|
269
|
+
"common/dependency-reviews.d.ts",
|
|
270
|
+
"common/finding-id.js",
|
|
271
|
+
"common/finding-duplicates.js",
|
|
272
|
+
"common/finding-filters.js",
|
|
273
|
+
"common/github-pr.ts",
|
|
274
|
+
"common/github-issue-labels.js",
|
|
275
|
+
"common/github-issue-labels.d.ts",
|
|
276
|
+
"common/gzip.js",
|
|
277
|
+
"common/pretty-print.d.ts",
|
|
278
|
+
"common/pretty-print.js",
|
|
279
|
+
"common/line-diff.d.ts",
|
|
280
|
+
"common/line-diff.js",
|
|
281
|
+
"common/linked-workspace-groups.js",
|
|
282
|
+
"common/managed/agent-tasks.ts",
|
|
283
|
+
"common/managed/comments.ts",
|
|
284
|
+
"common/managed/finding-detail.d.ts",
|
|
285
|
+
"common/managed/finding-detail.js",
|
|
286
|
+
"common/managed/github-agents.ts",
|
|
287
|
+
"common/managed/github-logins.ts",
|
|
288
|
+
"common/managed/npm-packages.d.ts",
|
|
289
|
+
"common/managed/npm-packages.js",
|
|
290
|
+
"common/managed/permissions.ts",
|
|
291
|
+
"common/managed/report-content.ts",
|
|
292
|
+
"common/managed/repository-alias.ts",
|
|
293
|
+
"common/managed/report-filter.ts",
|
|
294
|
+
"common/managed/roles.ts",
|
|
295
|
+
"common/managed/routes.d.ts",
|
|
296
|
+
"common/managed/routes.js",
|
|
297
|
+
"common/managed/scan-models.ts",
|
|
298
|
+
"common/managed/team-app.js",
|
|
299
|
+
"common/managed/team-app.d.ts",
|
|
300
|
+
"common/managed/triage.ts",
|
|
301
|
+
"common/managed/upload-seal.ts",
|
|
78
302
|
"common/save-error-reason.ts",
|
|
303
|
+
"common/revalidation-conflicts.js",
|
|
304
|
+
"common/revalidation-input-groups.js",
|
|
305
|
+
"common/server-info.ts",
|
|
306
|
+
"common/scan-server.ts",
|
|
307
|
+
"common/security-links.d.ts",
|
|
308
|
+
"common/security-links.js",
|
|
79
309
|
"common/utf8.d.ts",
|
|
80
310
|
"common/utf8.js",
|
|
311
|
+
"common/workspace-app.js",
|
|
312
|
+
"common/workspace-groups.js",
|
|
313
|
+
"risk/index.js",
|
|
314
|
+
"risk/index.d.ts",
|
|
315
|
+
"risk/files/characters.js",
|
|
316
|
+
"risk/files/hosts.js",
|
|
317
|
+
"risk/files/readability.js",
|
|
318
|
+
"risk/files/runs-code.js",
|
|
319
|
+
"risk/files/script.js",
|
|
320
|
+
"risk/files/stamps.js",
|
|
321
|
+
"risk/npm/assess.js",
|
|
322
|
+
"risk/npm/combined.js",
|
|
323
|
+
"risk/npm/compare.js",
|
|
324
|
+
"risk/npm/dependencies.js",
|
|
325
|
+
"risk/npm/diff.js",
|
|
326
|
+
"risk/npm/held.js",
|
|
327
|
+
"risk/npm/files.js",
|
|
328
|
+
"risk/npm/downloads.js",
|
|
329
|
+
"risk/npm/install-scripts.js",
|
|
330
|
+
"risk/npm/malware.js",
|
|
331
|
+
"risk/npm/manifest.js",
|
|
332
|
+
"risk/npm/new-dependency.js",
|
|
333
|
+
"risk/npm/old-version.js",
|
|
334
|
+
"risk/npm/registry.js",
|
|
335
|
+
"risk/npm/release.js",
|
|
336
|
+
"risk/npm/score.js",
|
|
337
|
+
"risk/npm/specs.js",
|
|
338
|
+
"risk/npm/tarball.js",
|
|
339
|
+
"risk/actions/findings.js",
|
|
340
|
+
"risk/actions/resolve.js",
|
|
341
|
+
"risk/actions/uses.js",
|
|
342
|
+
"risk/actions/workflow.js",
|
|
343
|
+
"risk/actions/scripts/commands.js",
|
|
344
|
+
"risk/actions/scripts/grade.js",
|
|
345
|
+
"risk/actions/scripts/packages.js",
|
|
346
|
+
"risk/actions/scripts/shell.js",
|
|
347
|
+
"client/dependency-paths.d.ts",
|
|
348
|
+
"client/dependency-paths.js",
|
|
349
|
+
"client/finding-link.js",
|
|
350
|
+
"client/linked-findings.d.ts",
|
|
351
|
+
"client/linked-findings.js",
|
|
352
|
+
"out/activity.js",
|
|
81
353
|
"out/brotli-fallback.js",
|
|
354
|
+
"out/chunk-*.js",
|
|
355
|
+
"out/client-managed.js",
|
|
356
|
+
"out/client-managed-import.js",
|
|
82
357
|
"out/client-sync.js",
|
|
358
|
+
"out/compare.js",
|
|
359
|
+
"out/dialogs.js",
|
|
83
360
|
"out/graph.js",
|
|
361
|
+
"out/github-issue-authorized.html",
|
|
362
|
+
"out/github-issue-authorized.js",
|
|
84
363
|
"out/icon-maskable.svg",
|
|
85
364
|
"out/icon.svg",
|
|
86
365
|
"out/index.html",
|
|
87
366
|
"out/manifest.webmanifest",
|
|
88
367
|
"out/prism.js",
|
|
368
|
+
"out/scan.js",
|
|
369
|
+
"out/stasis.svg",
|
|
89
370
|
"out/terminal.js",
|
|
90
371
|
"out/view.css",
|
|
91
372
|
"out/view.html",
|
|
@@ -94,40 +375,59 @@
|
|
|
94
375
|
],
|
|
95
376
|
"scripts": {
|
|
96
377
|
"lint": "node --run lint:js && node --run lint:css && node --run lint:ts",
|
|
97
|
-
"lint:js": "oxlint -c .oxlintrc.json --ignore-pattern=ui/logs.js ./tests/ ./common/ ./server/ ./client/ ./ui/",
|
|
378
|
+
"lint:js": "oxlint -c .oxlintrc.json --ignore-pattern=ui/logs.js ./cli.js ./server.ts ./tests/ ./common/ ./server-common/ ./server-e2e/ ./server-managed/ ./client/ ./ui/ ./risk/ ./api/",
|
|
98
379
|
"lint:css": "stylelint 'ui/**/*.css'",
|
|
99
380
|
"lint:ts": "tsc --noEmit",
|
|
100
381
|
"prepack": "node --run build",
|
|
101
382
|
"build": "node build.js build",
|
|
102
383
|
"serve": "node build.js serve",
|
|
103
|
-
"server": "node server
|
|
104
|
-
"
|
|
384
|
+
"server": "node --run server-e2e --",
|
|
385
|
+
"server-e2e": "node server-e2e/index.ts",
|
|
386
|
+
"server-managed": "node server-managed/index.ts",
|
|
387
|
+
"server-managed-test": "node server-managed/test-server.ts",
|
|
388
|
+
"test": "node --js-base-64 --require=./tests/_resource-loader.js --experimental-test-module-mocks --test-timeout=120000 --test-concurrency=$(node -p 'Math.ceil(os.availableParallelism() * 1.5)') --test ./tests/*.test.js"
|
|
105
389
|
},
|
|
106
390
|
"devDependencies": {
|
|
107
|
-
"@electric-sql/pglite": "^0.
|
|
108
|
-
"@
|
|
109
|
-
"@
|
|
110
|
-
"@preventive/terminal": "^1.3.0",
|
|
391
|
+
"@electric-sql/pglite": "^0.5.8",
|
|
392
|
+
"@noble/ciphers": "^2.4.0",
|
|
393
|
+
"@preventive/terminal": "2.0.0-beta.3",
|
|
111
394
|
"@rray/frontend": "^1.0.0",
|
|
112
|
-
"@stylistic/stylelint-plugin": "^5.1
|
|
113
|
-
"@types/node": "^
|
|
114
|
-
"@types/ws": "^8.18.
|
|
395
|
+
"@stylistic/stylelint-plugin": "^5.3.1",
|
|
396
|
+
"@types/node": "^26.6.4",
|
|
397
|
+
"@types/ws": "^8.18.2",
|
|
398
|
+
"@vercel/functions": "^3.9.11",
|
|
115
399
|
"brotli": "^1.3.3",
|
|
116
|
-
"esbuild": "^0.
|
|
117
|
-
"lit": "^3.3.
|
|
400
|
+
"esbuild": "^0.28.2",
|
|
401
|
+
"lit": "^3.3.3",
|
|
118
402
|
"minify-html-literals": "^1.3.5",
|
|
119
|
-
"oxlint": "^1.
|
|
403
|
+
"oxlint": "^1.87.0",
|
|
120
404
|
"prismjs": "^1.30.0",
|
|
121
|
-
"stylelint": "^17.
|
|
405
|
+
"stylelint": "^17.16.0",
|
|
122
406
|
"stylelint-config-recommended": "^18.0.0",
|
|
123
|
-
"typescript": "^
|
|
407
|
+
"typescript": "^7.0.2"
|
|
124
408
|
},
|
|
125
409
|
"dependencies": {
|
|
126
|
-
"
|
|
410
|
+
"@exodus/stasis": "1.0.0-beta.11",
|
|
411
|
+
"@exodus/stasis-core": "1.0.0-beta.11",
|
|
412
|
+
"@preventive/archive": "^1.2.0",
|
|
413
|
+
"@preventive/compare": "^1.2.11",
|
|
414
|
+
"@preventive/diff": "^1.1.0",
|
|
415
|
+
"@preventive/lockfile": "^1.2.0",
|
|
416
|
+
"@preventive/publishers": "^1.1.0",
|
|
417
|
+
"@preventive/report": "^1.0.0",
|
|
418
|
+
"@preventive/sourcemap": "1.0.0-alpha.1",
|
|
419
|
+
"@preventive/upstream": "^1.3.0",
|
|
420
|
+
"css-tree": "^3.2.1",
|
|
421
|
+
"oxc-minify": "^0.152.0",
|
|
422
|
+
"oxc-parser": "^0.152.0",
|
|
423
|
+
"oxfmt": "^0.72.0",
|
|
424
|
+
"semver": "^7.8.5",
|
|
425
|
+
"ws": "^8.22.0"
|
|
127
426
|
},
|
|
128
427
|
"peerDependencies": {
|
|
129
428
|
"@neondatabase/serverless": "^1.0.2",
|
|
130
|
-
"@vercel/blob": "^2.3.3"
|
|
429
|
+
"@vercel/blob": "^2.3.3",
|
|
430
|
+
"@vercel/functions": "^3.9.11"
|
|
131
431
|
},
|
|
132
432
|
"peerDependenciesMeta": {
|
|
133
433
|
"@neondatabase/serverless": {
|
|
@@ -135,6 +435,9 @@
|
|
|
135
435
|
},
|
|
136
436
|
"@vercel/blob": {
|
|
137
437
|
"optional": true
|
|
438
|
+
},
|
|
439
|
+
"@vercel/functions": {
|
|
440
|
+
"optional": true
|
|
138
441
|
}
|
|
139
442
|
},
|
|
140
443
|
"packageManager": "pnpm@10.33.4+sha512.1c67b3b359b2d408119ba1ed289f34b8fc3c6873412bec6fd264fbdc82489e510fcbecb9ce9d22dae7f3b76269d8441046014bdca53b9979cd7a561ad631b800"
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
// What a workflow, or an action's metadata, calls for by its own text (README.md).
|
|
2
|
+
import { YamlError } from '@preventive/lockfile/yaml.js'
|
|
3
|
+
import { readWorkflow } from './workflow.js'
|
|
4
|
+
import { installsOf } from './scripts/commands.js'
|
|
5
|
+
import { dotted, imageFinding, lockedName, namesPullHead, scriptFindings, scriptInjections, within } from './scripts/grade.js'
|
|
6
|
+
import { ownerKind, usesKey } from './uses.js'
|
|
7
|
+
import { resolved } from '../npm/files.js'
|
|
8
|
+
|
|
9
|
+
// What a `uses:` calls for by its pin, a reference's with its `key`.
|
|
10
|
+
function usesFinding(uses, owner) {
|
|
11
|
+
if (uses.kind === 'invalid') return { id: 'invalid-uses', severity: 'low', uses: uses.uses }
|
|
12
|
+
if (uses.kind === 'docker') return uses.digest ? null : imageFinding(uses.uses, uses)
|
|
13
|
+
if ((uses.kind !== 'action' && uses.kind !== 'workflow') || uses.pin === 'sha') return null
|
|
14
|
+
const at = { uses: uses.uses, key: usesKey(uses) }
|
|
15
|
+
return uses.pin === 'short-sha' ? { id: 'short-sha', severity: 'high', ...at } : { id: 'unpinned', severity: ownerKind(uses.repo, owner) === 'third-party' ? 'high' : 'moderate', ...at, ref: uses.ref }
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// An action that installs a project's npm packages, by its name: npm's,
|
|
19
|
+
// Yarn's, pnpm's or Bun's install of dependencies (`bahmutov/npm-install`),
|
|
20
|
+
// not another tool's (`cachix/install-nix-action`).
|
|
21
|
+
const INSTALLER = /(?:npm|yarn|pnpm|bun|node[-_]?modules)[-_]?(?:ci|install)|install[-_]?(?:npm|yarn|pnpm|bun|node[-_]?modules|dep(?:endencie)?s|packages)/iu
|
|
22
|
+
|
|
23
|
+
// Where a step installs a project's packages, each `{ at, prod }`: a
|
|
24
|
+
// script's install's directory or the one it names, and whether it leaves
|
|
25
|
+
// devDependencies out; an action of its own's, by its metadata (ScanOptions
|
|
26
|
+
// `actions`), anywhere (null) where none is told; and anywhere for an action
|
|
27
|
+
// that installs them (cypress-io/github-action's unless `install: false`,
|
|
28
|
+
// pnpm/action-setup's with `run_install`).
|
|
29
|
+
const ANYWHERE = [{ at: null, prod: false }]
|
|
30
|
+
function installs(step, actions, seen = new Set()) {
|
|
31
|
+
if (step.uses?.kind === 'local') return actions ? ownInstalls(actions, step.uses.path, seen) : ANYWHERE
|
|
32
|
+
const repo = step.uses?.repo?.toLowerCase()
|
|
33
|
+
if (repo && (INSTALLER.test(repo) || (repo === 'cypress-io/github-action' && String(step.with?.install) !== 'false'))) return ANYWHERE
|
|
34
|
+
if (repo === 'pnpm/action-setup' && /^(?:true|\[|\{|-)/u.test(String(step.with?.run_install ?? '').trim())) return ANYWHERE
|
|
35
|
+
return step.run ? installsOf(step.run.script, step.run.production).map(({ into, prod }) => ({ at: directoryOf(step.run.workingDirectory, into), prod })) : []
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Where the repository's own action at `dir` installs, by its steps, each
|
|
39
|
+
// action of its own once.
|
|
40
|
+
function ownInstalls(actions, dir, seen) {
|
|
41
|
+
const read = actions.has(dir) && !seen.has(dir) && seen.add(dir) ? readWorkflow('action', actions.get(dir)) : null
|
|
42
|
+
return read && !(read instanceof YamlError) ? read.jobs.flatMap(job => job.steps.flatMap(step => installs(step, actions, seen))) : []
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// A step's directory, and a path from it (`into`), from the repository's
|
|
46
|
+
// root, '' for it; as written where an expression or a variable names it, or
|
|
47
|
+
// it is out of the repository, so that it is within the same alone.
|
|
48
|
+
function directoryOf(workingDirectory, into = null) {
|
|
49
|
+
const path = into?.startsWith('/') ? into : [workingDirectory, into].filter(Boolean).join('/')
|
|
50
|
+
return /\$|^\//u.test(path) ? path : resolved([], path)?.join('/') ?? path
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Whether the nearest lockfiles at or above `directory`, its project's, lock
|
|
54
|
+
// what npx runs by `name`: `dev` where only devDependencies need it in each
|
|
55
|
+
// that does.
|
|
56
|
+
const lockDir = path => path.includes('/') ? path.slice(0, path.lastIndexOf('/')) : ''
|
|
57
|
+
function lockedIn(lockfiles, directory, name) {
|
|
58
|
+
const above = lockfiles.filter(({ path }) => within(lockDir(path), directory))
|
|
59
|
+
const nearest = Math.max(...above.map(({ path }) => lockDir(path).length))
|
|
60
|
+
const locking = above.filter(({ path, names }) => lockDir(path).length === nearest && lockedName(names, name))
|
|
61
|
+
return locking.length > 0 && (locking.every(({ dev }) => dev && lockedName(dev, name)) ? 'dev' : true)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// The inputs a text names (`${{ inputs.title }}`).
|
|
65
|
+
const inputsIn = text => typeof text === 'string' ? [...dotted(text).matchAll(/\$\{\{[^}]*?\binputs\s*\.\s*([\w-]+)/gu)].map(match => match[1]) : []
|
|
66
|
+
|
|
67
|
+
// The inputs a step's action, or a job's reusable workflow, writes into a
|
|
68
|
+
// script: github-script's `script`; those one of the repository's own
|
|
69
|
+
// (ScanOptions `actions`) names in its `run:`s or its jobs' images, or hands
|
|
70
|
+
// to such an input of a step's or a job's; and each of another reusable
|
|
71
|
+
// workflow's, or one whose text isn't told, as it may.
|
|
72
|
+
function scriptInputs(step, actions, seen = new Set()) {
|
|
73
|
+
if (step.uses?.repo?.toLowerCase() === 'actions/github-script') return ['script']
|
|
74
|
+
if (step.uses?.kind === 'workflow' || (step.uses?.job && !actions?.has(step.uses.path))) return Object.keys(step.with ?? {})
|
|
75
|
+
const path = step.uses?.kind === 'local' && actions?.has(step.uses.path) && !seen.has(step.uses.path) ? step.uses.path : null
|
|
76
|
+
const read = path === null ? null : readWorkflow(step.uses.job ? 'workflow' : 'action', actions.get(path))
|
|
77
|
+
if (!read || read instanceof YamlError) return []
|
|
78
|
+
const inner = new Set(seen).add(path)
|
|
79
|
+
const handed = each => scriptInputs(each, actions, inner).flatMap(input => inputsIn(each.with?.[input]))
|
|
80
|
+
return [...new Set(read.jobs.flatMap(job => [...job.uses ? handed(job) : [], ...job.images.flatMap(image => inputsIn(image.text)),
|
|
81
|
+
...job.steps.flatMap(each => [...inputsIn(each.run?.script), ...handed(each)])]))]
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// Injections through the inputs an action writes into its scripts, and a
|
|
85
|
+
// fork's code or artifacts taken where the workflow runs with its secrets.
|
|
86
|
+
function stepFindings(step, triggers, actions) {
|
|
87
|
+
const repo = step.uses?.repo?.toLowerCase()
|
|
88
|
+
const found = scriptInputs(step, actions).flatMap(input => scriptInjections(step.with?.[input], triggers).map(({ index: _index, ...finding }) => ({ ...finding, line: step.withLines[input] })))
|
|
89
|
+
const forks = ['pull_request_target', 'workflow_run', 'issue_comment'].some(event => triggers.includes(event))
|
|
90
|
+
if (forks && repo === 'actions/checkout' && (namesPullHead(step.with?.ref) || namesPullHead(step.with?.repository))) {
|
|
91
|
+
found.push({ id: 'pwn-request', severity: 'critical', ref: String(step.with.ref ?? step.with.repository), line: step.withLines.ref ?? step.withLines.repository ?? step.line })
|
|
92
|
+
}
|
|
93
|
+
if (forks && step.run && /\bgh\s+pr\s+checkout\b/u.test(step.run.script)) found.push({ id: 'pwn-request', severity: 'critical', ref: 'gh pr checkout', line: step.run.line })
|
|
94
|
+
if (triggers.includes('workflow_run') && ((repo === 'actions/download-artifact' && (step.with?.['run-id'] !== undefined || step.with?.['github-token'] !== undefined))
|
|
95
|
+
|| repo === 'dawidd6/action-download-artifact' || /\bgh\s+run\s+download\b/u.test(step.run?.script ?? ''))) found.push({ id: 'untrusted-artifact', severity: 'high', line: step.uses?.line ?? step.run.line })
|
|
96
|
+
return found
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// A job's findings, each script graded by the installs before it and its lockfiles.
|
|
100
|
+
function jobFindings(job, triggers, { owner, lockfiles, external, actions }) {
|
|
101
|
+
const found = []
|
|
102
|
+
if (job.uses) {
|
|
103
|
+
const finding = usesFinding(job.uses, owner)
|
|
104
|
+
if (finding) found.push({ ...finding, line: job.uses.line })
|
|
105
|
+
if (job.secrets === 'inherit' && job.uses.repo && ownerKind(job.uses.repo, owner) === 'third-party') found.push({ id: 'secrets-inherited', severity: 'high', uses: job.uses.uses, key: usesKey(job.uses), line: job.uses.line })
|
|
106
|
+
// An input a reusable workflow writes into its scripts.
|
|
107
|
+
for (const input of scriptInputs(job, actions)) for (const { index: _index, ...injected } of scriptInjections(job.with?.[input], triggers)) found.push({ ...injected, line: job.withLines[input] })
|
|
108
|
+
}
|
|
109
|
+
for (const image of job.images) {
|
|
110
|
+
if (!image.read?.digest && !image.text.includes('${{')) found.push({ ...imageFinding(image.text, image.read), line: image.line })
|
|
111
|
+
for (const { index: _index, ...injected } of scriptInjections(image.text, triggers)) found.push({ ...injected, line: image.line })
|
|
112
|
+
}
|
|
113
|
+
const installed = []
|
|
114
|
+
for (const step of job.steps) {
|
|
115
|
+
const finding = step.uses && usesFinding(step.uses, owner)
|
|
116
|
+
if (finding) found.push({ ...finding, line: step.uses.line })
|
|
117
|
+
if (step.run) {
|
|
118
|
+
const directory = dir => directoryOf(step.run.workingDirectory, dir)
|
|
119
|
+
const locked = (name, dir) => !external && lockedIn(lockfiles, directory(dir), name)
|
|
120
|
+
const before = (dev, dir) => installed.some(({ at, prod }) => within(at, directory(dir)) && !(prod && dev))
|
|
121
|
+
found.push(...scriptFindings(step.run, { locked, installed: before, external, triggers }))
|
|
122
|
+
}
|
|
123
|
+
found.push(...stepFindings(step, triggers, actions))
|
|
124
|
+
installed.push(...installs(step, actions))
|
|
125
|
+
}
|
|
126
|
+
return found
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// Every finding of a workflow read (readWorkflow), in its lines' order, by
|
|
130
|
+
// index.d.ts ScanOptions.
|
|
131
|
+
export function workflowFindings(read, { owner = null, lockfiles = [], external = false, actions = null } = {}) {
|
|
132
|
+
const found = read.jobs.flatMap(job => jobFindings(job, read.triggers, { owner, lockfiles, external, actions }))
|
|
133
|
+
if (/^node(?:12|16)$/u.test(read.using ?? '')) found.push({ id: 'deprecated-runtime', severity: 'low', using: read.using, line: read.usingLine })
|
|
134
|
+
return found.toSorted((a, b) => (a.line ?? 0) - (b.line ?? 0))
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// The references a workflow read makes: of GitHub's, each with its `key`, and
|
|
138
|
+
// of its own (`local`).
|
|
139
|
+
export function workflowUses(read) {
|
|
140
|
+
return read.jobs.flatMap(job => [job.uses, ...job.steps.map(step => step.uses)]).flatMap(uses => {
|
|
141
|
+
if (uses?.kind === 'local') return [uses]
|
|
142
|
+
return uses?.kind === 'action' || uses?.kind === 'workflow' ? [{ ...uses, key: usesKey(uses) }] : []
|
|
143
|
+
})
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// The actions of the repository's own a workflow or an action uses, by
|
|
147
|
+
// their directories, and a Docker action's Dockerfile; none for one GitHub
|
|
148
|
+
// can't run.
|
|
149
|
+
export function ownFilesOf(kind, text) {
|
|
150
|
+
const read = readWorkflow(kind, text)
|
|
151
|
+
if (read instanceof YamlError) return { actions: [], dockerfile: null }
|
|
152
|
+
return { actions: workflowUses(read).flatMap(uses => uses.kind === 'local' && !uses.job ? [uses.path] : []), dockerfile: read.dockerfile?.path ?? null }
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// A workflow's or an action's metadata's (`kind`) references and findings;
|
|
156
|
+
// why not (`workflow-unreadable`) for one GitHub can't run.
|
|
157
|
+
export function scanWorkflow(kind, text, options = {}) {
|
|
158
|
+
const read = readWorkflow(kind, text)
|
|
159
|
+
if (read instanceof YamlError) return { error: 'workflow-unreadable', detail: read.message.slice(0, 500) }
|
|
160
|
+
return { uses: workflowUses(read), findings: workflowFindings(read, options) }
|
|
161
|
+
}
|