Repository navigation
fix: don't audit the Convox CLI's own requests as denials - #187
Merged
Merged
Conversation
Since unforwarded rack routes became denials, every deploy, run and log stream has
added one or two: the Convox CLI makes requests for itself that no rack answers,
and it ignores the 404.
- GET /machines and GET /racks: the SDK sends one before each websocket (build
logs, run, exec, logs) to start a Convox Console session.
- GET /apps/{app}/configs/cli-env-mask: `convox env` and `convox releases info`
read Convox's env mask before printing to a terminal, and print the env as it
came on a 404. The gateway has already masked secret values.
The gateway still answers these with 404 and writes the request log line, but no
denial entry. Another method, another config name, a websocket upgrade, or a path
that isn't a safe rack path is still a denial.
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| JavaScript | Oct 25, 2026 7:54p.m. | Review ↗ | |
| Go | Oct 25, 2026 7:54p.m. | Review ↗ |
Important
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Since v0.1.15 the gateway audits requests for rack routes it doesn't forward as denials. That turned up requests the Convox CLI makes for itself on every deploy, run and log stream. No rack answers them, and the CLI ignores the 404:
GET /machinesandGET /racks: the Convox SDK sends one before each websocket (build logs,run,exec, logs) to start a Convox Console session (sdk/sdk.go,Websocket). It discards the answer, and a self-hosted rack has neither route./rackshas been there since 2019;/machinescame with Convox's cloud CLI in 3.22.2.GET /apps/{app}/configs/cli-env-mask:convox envandconvox releases inforead Convox's own env mask (convox env mask set) before printing to a terminal. On a 404 they print the env as it came, and the gateway has already masked secret values in it.These requests say nothing about the caller, so each one only added a denial row: a few dozen a day per rack for an ordinary deploy pipeline.
Change
isRoutineConvoxCLIRequestlists the three requests by exact method and canonical path. The gateway still answers them with 404 and writes the request log line, but records no denial.PUT .../cli-env-maskfromconvox env mask set), another config name, a websocket upgrade, or a path that failsisSafeRackPath.AGENTS.md(where to add such a request after a Convox upgrade) andinternal/gateway/AGENTS.md.Not adapting to Convox's env mask
The gateway already masks env values before they leave it: secret-looking names,
CONVOX_SECRET_ENV_VARS, each app'ssecret_env_varsandprotected_env_vars, and values with credentials in them. Convox's mask only hides values when the CLI prints to a terminal, and the rack still returns them in full. Its per-app key list does the same job assecret_env_vars. Answering the read with the gateway's own list would change nothing, since those values already arrive masked. App configs can hold secrets, so/configsstays unforwarded.Testing
TestIsRoutineConvoxCLIRequestcovers the three matches and the near misses.TestRoutineConvoxCLIRequestsAreNotAuditedAsDenials: 404, nothing forwarded, no audit entry even after the repeat counts are flushed.TestNearRoutineRequestsAreStillAuditedAsDenials: aPUTof the mask, another config, a machine ID, a websocket upgrade, a dot-segment app and an encoded?are each recorded as a denial.task go:lintis clean and./internal/gateway/proxy/passes.Summary by CodeRabbit
/machines,/racks, and the CLI environment-mask config endpoint still receive a 404 without being recorded as denied. The environment-mask request remains in the request log. Other methods and similar unmatched requests continue to be audited as denials.