-
Notifications
You must be signed in to change notification settings - Fork 1
COR-1549: decide vuln-api token-send by endpoint trust, not by whether it is the default #135
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
Changes from all commits
6a2e52d
dbc9577
158fb84
b8acb23
dc93969
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -4,6 +4,14 @@ use std::{env, fs, io}; | |||||
|
|
||||||
| pub const DEFAULT_VULN_API_URL: &str = "https://cve-worker-staging.corgea.workers.dev"; | ||||||
|
|
||||||
| /// Whether `DEFAULT_VULN_API_URL` is an endpoint Corgea tokens belong to. | ||||||
| /// The `-staging` hostname is historical: this worker serves as the production | ||||||
| /// vuln-api, so a token may be sent to it and authenticated (fail-closed) | ||||||
| /// verdicts apply by default. Set to `false` if the default is ever repointed | ||||||
| /// at an endpoint that customer tokens should not reach — token-send and | ||||||
| /// fail-closed then both require the explicit opt-in. | ||||||
| pub const DEFAULT_VULN_API_URL_IS_PRODUCTION: bool = true; | ||||||
|
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. The trust flag currently defeats the security change this PR is scoped to deliver. Set the flag to
Suggested change
Contributor
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. The premise is out of date rather than the code. You did surface a real defect, though: this PR's title and description still described the On the matrix test — correct that it branches on the constant and accepts either outcome, so it cannot catch a wrong classification. That is by design and not fixable in-repo: the constant encodes a deployment fact, not a code property, so no unit test can validate it. The doc comment at |
||||||
|
|
||||||
| #[derive(Serialize, Deserialize, Clone)] | ||||||
| pub struct Config { | ||||||
| pub(crate) url: String, | ||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.