Repository navigation
fix(security): isolate saleable readiness subprocess authority #107
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 2 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
0216fda
test(security): require minimal readiness subprocess environment
seonghobae f25812c
fix(security): constrain readiness subprocess environment
seonghobae a7edd13
test(security): preserve explicit readiness report-only override
seonghobae c913196
fix(security): preserve explicit readiness report-only override
seonghobae e6b9262
merge: refresh readiness subprocess isolation onto latest main
seonghobae 091cb6c
merge: refresh readiness subprocess isolation onto OpenAPI-integrated…
seonghobae 1cb6ad1
merge: refresh readiness subprocess isolation onto exchange-integrate…
seonghobae 795653d
chore(security): merge latest protected main into saleable readiness …
seonghobae 7b2f1b7
chore(security): merge current protected main into saleable readiness…
seonghobae 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
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 |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| import { readFileSync } from "node:fs"; | ||
| import { describe, expect, it } from "vitest"; | ||
|
|
||
| describe("saleable readiness subprocess authority", () => { | ||
| it("passes only the explicit non-secret runtime contract to child commands", () => { | ||
| const script = readFileSync("scripts/saleable-readiness-audit.mjs", "utf8"); | ||
|
|
||
| expect(script).toContain("readinessSubprocessEnvironmentKeys"); | ||
| expect(script).toContain("createReadinessSubprocessEnvironment"); | ||
| expect(script).toContain("const env = createReadinessSubprocessEnvironment(options.env)"); | ||
| expect(script).not.toContain("...process.env"); | ||
|
|
||
| for (const requiredRuntimeKey of [ | ||
| "PATH", | ||
| "PATHEXT", | ||
| "SystemRoot", | ||
| "ComSpec", | ||
| "CI", | ||
| "NO_COLOR", | ||
| "TZ", | ||
| "LANG", | ||
| "LC_ALL", | ||
| "NODE_EXTRA_CA_CERTS", | ||
| "SSL_CERT_FILE", | ||
| "SSL_CERT_DIR", | ||
| "NOEMA_KPI_FAILURE_THRESHOLD", | ||
| "NOEMA_KPI_P95_THRESHOLD_MS", | ||
| "NOEMA_KPI_REQUIRE_WINDOW_DAYS", | ||
| "NOEMA_KPI_LOG_PATH", | ||
| "NOEMA_KPI_PROVENANCE_PATH", | ||
| "NOEMA_KPI_EVIDENCE_PATH", | ||
| "NOEMA_ALERT_5M_FAILURE_RATE", | ||
| "NOEMA_ALERT_5M_P95_MS", | ||
| "NOEMA_ALERT_RATE_LIMIT_MINUTES", | ||
| "NOEMA_ALERT_WORKFLOW_SPIKE_MULTIPLIER", | ||
| ]) { | ||
| expect(script).toContain(`\"${requiredRuntimeKey}\"`); | ||
| } | ||
|
|
||
| for (const forbiddenAmbientAuthority of [ | ||
| "NVIDIA_NIM_API_KEY", | ||
| "GH_TOKEN", | ||
| "GITHUB_TOKEN", | ||
| "NOEMA_MAINTAINER_APP_PRIVATE_KEY", | ||
| "NOEMA_REVIEWER_APP_PRIVATE_KEY", | ||
| "CLOUDFLARE_API_TOKEN", | ||
| "NODE_OPTIONS", | ||
| "HTTPS_PROXY", | ||
| "HTTP_PROXY", | ||
| ]) { | ||
| expect(script).not.toContain(`\"${forbiddenAmbientAuthority}\"`); | ||
| } | ||
| }); | ||
| }); |
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.