Repository navigation
Conversation
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
… file Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
…e protocol Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
The Origin header is parsed as scheme://host[:port] with an http or https scheme, as BootUI 2.6.0 does: a path (a trailing slash included), query, fragment, userinfo, control character, trailing colon, unsupported scheme or a port above 65535 makes the origin unreadable, and an unreadable origin is cross-site. The value is no longer trimmed.\n\nA port of more than five digits is refused before int() converts it, in the origin and in the request's own Host, so a very long port is a cross-site refusal and no longer an unhandled ValueError. Adds a property test of the origin parser. Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
…UI 2.6.0) A write that carries Sec-Fetch-Site must send same-origin or none (ASCII, case-insensitive); same-site, cross-site, an empty value and any unknown value are refused. A present but empty Origin header is an unreadable origin and is cross-site, no longer read as absent. A same-site navigation GET still loads the shell, and an API path still requires the request's own scheme, host and port. A request whose own origin cannot be formed stays cross-site where that comparison applies.\n\nDocuments the rule in SECURITY.md and the BootUI contract note, and records the deviations in the 0.11.0 guard matrix fragment. Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Record the two deviations of the inactivity log from BootUI 2.6.0 in a matrix fragment, update the MVP plan text that still described the old log line, extract the inactivity logging of install() into a helper to keep its complexity at the pinned count, and wrap one over-long test assertion. Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
An invalid SHARPIT_ENABLED must log exactly one record, the fixed warning, as BootUI does. The count of the remaining configuration warnings stays. Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
An invalid SHARPIT_ENABLED is already reported by the fixed inactive warning. Counting its settings warning as well produced a second WARNING record, where BootUI logs one. Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
…tests Port BootUiInactiveStartupDiagnosticTests.deliberateDisablementIsSilentAtInfo, cite the BootUI tests the other inactivity tests port, and keep the expected log texts in one test module. A single Inactivity alias types the inactivity category. The matrix row for the warning count records that it leaves out the invalid SHARPIT_ENABLED warning. Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com> # Conflicts: # tests/fuzz/test_trust_boundary_fuzz.py
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
…r section Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
# Conflicts: # docs/reference/matrix-updates/0.11.0-github.tsv # src/sharpit/engine/collectors/github/client.py
This branch has not been deployed
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.
Summary
Task 1.7 of the 0.11.0 plan (#367), the alert-pagination row of the BootUI 2.6.0 delta: Dependabot, code-scanning and
secret-scanning alerts are read across pages, as BootUI's
GitHubAlertPaginationandGitHubApiClient.addSecuritySignaldo, instead of extrapolating a total from the first page'slastlink.src/sharpit/engine/collectors/github/pagination.py(new): theLinkheader parser and traversal state. Numberedand cursor links;
lastis read beforenext; a link is followed only when its scheme, host, port and path matchthe request (the endpoint or its
repositories/{id}alias), with no user info or fragment, allowed query names only,one selector, no blank, control or replacement characters; page numbers and alert counts are bounded to the 32-bit
range; a repeated page or cursor, or a repeated page digest (SHA-256 over canonical JSON), stops the traversal.
src/sharpit/engine/collectors/github/client.py: each alert section pages until the last page, the call budget(with BootUI's reservation for later sections) or the refresh deadline. A later page that fails, times out, is
oversized or invalid makes only that section
UNAVAILABLE, with an "At least N alerts were observed" lower boundand a warning; the refresh is
PARTIAL. The next request URL is rebuilt from the configured path and a validatedselector, so credentials go only to the API host. Dependabot alert details stay within the configured cap across
pages. Multiple
Linkheaders are read withget_all.docs/reference/matrix-updates/0.11.0-github.tsv:op:github.refresh.alert-pagination(matched),op:github.refresh.alert-pagination-deadline(adapted: sharpit's 30 s refresh deadline stops a traversal with thetime-limit reason; BootUI has no overall deadline) and
op:github.refresh.alert-link-parser(adapted: JavaURI,URLDecoder/URLEncoderand 32-bit arithmetic expressed with explicit checks).Behaviour change for users: alert totals are counted from the pages read rather than estimated from the
lastlink;when a section cannot be read to the end it reports a lower bound instead of an estimate.
Review scope
The branch was cut from the 0.11.0 integration line, so against
mainthe diff also shows the earlier 0.11.0 pullrequests (Wave 0, #368 to #379). The changes of this pull request are in the files listed above and in
tests/engine/collectors/github/(fakes.py,test_github_alerts.py,test_github_client.py,test_github_pagination.py).Red evidence
test_github_alerts.py(traversal, caps, budget, digest, canonical-alias cases)client.py@in the authority, overflowing numbers)test_github_pagination.py::test_link_parser_python_leniency,test_rejects_count_overflow_and_invalid_page_sizes,test_cursor_reencoding_matches_java_url_encoderscripts/dev/red_check.py)test_github_client.py::test_github_last_page_uses_known_host,test_github_odd_last_page_links_keep_the_first_page_counttest_later_alert_page_transport_or_size_failure_keeps_section_only_unavailable[timeout, oversized]'ERROR' == 'PARTIAL'with the per-section handler removed| A lone surrogate escape in an alert page failed the whole refresh when the page digest was computed (review) |
test_github_alerts.pylone-surrogate cases | assertion: refreshERROR|| A digest failure escaped its section (review) |
test_github_alerts.pydigest-failure case | assertion |Page digests encode the canonical JSON as UTF-8 with replacement, as BootUI's
getBytes(UTF_8)does; any digestfailure makes only that section unavailable. Nesting depth is bounded at 500 by the response decoder (#378).
Verification
uv run ruff check,uv run ruff format --check,uv run pyright(0 errors); targeted run overtests/engine,tests/fastapi,tests/masking,tests/safety,tests/parity,tests/fuzz, the root rule tests andtests/docs;the overhead budget tests run alone. The full suite runs in CI.