Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
6d6d6a3
chore: capture the BootUI 2.6.0 fixtures and pin 0.11.0 to v2.6.0
ffroliva Dec 5, 2026
d5cc020
chore: flag blanket and unused suppressions
ffroliva Dec 5, 2026
3e49440
test: record the GitHub repositoryContext gap and pin the tool status…
ffroliva Dec 5, 2026
e416269
Merge Task 0.1 (BootUI 2.6.0 capture) into release/0.11.0
ffroliva Dec 5, 2026
b1c4345
chore: group Dependabot updates, add a cooldown and document the merg…
ffroliva Dec 5, 2026
504e8e9
fix: accept only a serialized http(s) origin in the cross-site check
ffroliva Dec 5, 2026
cda6f7c
fix: refuse same-site and malformed browser metadata on a write (Boot…
ffroliva Dec 5, 2026
cea62cd
test: name the ecosystem in each Dependabot assertion
ffroliva Dec 5, 2026
7b302a3
chore: keep the reasons on narrowed suppressions
ffroliva Dec 5, 2026
3621dcc
chore: restore the reasons on removed suppressions
ffroliva Dec 5, 2026
2a795c5
test: one condition per assert in the serialized-origin tests
ffroliva Dec 5, 2026
af89e1c
Merge branch 'chore/0.11.0-t0.5-ruff-suppressions' into release/0.11.0
ffroliva Dec 5, 2026
847bfad
Merge branch 'chore/0.11.0-t0.2-dependabot' into release/0.11.0
ffroliva Dec 5, 2026
1c6d4eb
ci: audit workflows online with zizmor on a schedule
ffroliva Dec 5, 2026
97807f8
Merge branch 'chore/0.11.0-t0.3-zizmor' into release/0.11.0
ffroliva Dec 5, 2026
bc336e6
test: add trust-boundary property tests and state the reporting channel
ffroliva Dec 5, 2026
8cdbbb6
Merge branch 'test/0.11.0-t0.7-fuzz-security' into release/0.11.0
ffroliva Dec 5, 2026
fdfa03d
ci: audit the Python and npm lock files for known vulnerabilities
ffroliva Dec 5, 2026
a10177c
ci: keep the workflow audit off pull request runs
ffroliva Dec 5, 2026
68946b4
Merge branch 'ci/0.11.0-t0.4-dependency-audit' into release/0.11.0
ffroliva Dec 5, 2026
3f012ae
Merge branch 'release/0.11.0' into fix/0.11.0-s1-serialized-origin
ffroliva Dec 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,50 @@
version: 2
updates:
# Cooldowns do not delay Dependabot security updates.
- package-ecosystem: "uv"
directory: "/"
schedule:
interval: "weekly"
groups:
uv-minor-and-patch:
update-types:
- "minor"
- "patch"
cooldown:
default-days: 3
commit-message:
prefix: "chore(deps)"

- package-ecosystem: "pip"
directory: "/website"
schedule:
interval: "weekly"
cooldown:
default-days: 3
commit-message:
prefix: "chore(deps)"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
groups:
github-actions-minor-and-patch:
update-types:
- "minor"
- "patch"
cooldown:
default-days: 3
commit-message:
prefix: "chore(deps)"

# npm updates require running `npm --prefix ui run build` and committing built assets (checked by CI drift job)
# npm updates require rebuilding the committed UI with `npm --prefix ui run build` as described in docs/development/ci.md (Dependency updates); CI checks for drift
- package-ecosystem: "npm"
directory: "/ui"
schedule:
interval: "weekly"
cooldown:
default-days: 3
open-pull-requests-limit: 2
groups:
ui-dependencies:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ jobs:
- run: uv run --no-sync ruff format --check
- run: uv run --no-sync pyright
- run: uvx --from actionlint-py==1.7.12.25 actionlint
- run: uvx zizmor@1.32.0 --offline --min-severity medium .github/workflows
- run: uvx zizmor@1.32.0 --offline --min-severity low .github/workflows
# Dogfood: the example's fixed route must pass `pytest --sharpit`, its planted N+1 must fail it.
- run: uv run --no-sync python -c "import os, sys; os.makedirs(sys.argv[1], exist_ok=True)" "${{ runner.temp }}/speed" # the speed plugins write here
- run: uv run --no-sync python -m pytest examples/fastapi_sqla/tests_gate -k fixed --sharpit --sharpit-junit=sharpit-junit.xml -p scripts.pytest_speed.fixture_timer --fixture-times="${{ runner.temp }}/speed/ft-fixed.jsonl" -p scripts.pytest_speed.rebuild_log --rebuild-log="${{ runner.temp }}/speed/rb-fixed.json" --junitxml="${{ runner.temp }}/junit-fixed.xml"
Expand Down
54 changes: 54 additions & 0 deletions .github/workflows/security-audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: security-audit
on:
schedule:
- cron: "17 5 * * 2"
workflow_dispatch:
pull_request:
paths:
- uv.lock
- ui/package-lock.json
- website/requirements.txt

permissions: {}

jobs:
dependencies:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: astral-sh/setup-uv@1db35dd8eee11c5894872e0b383ae6c406cf738d # v10.4.0
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
- name: Export and audit locked Python dependencies
run: |
uv export --frozen --all-extras --all-groups --no-emit-project -o /tmp/sharpit-requirements.txt
uvx --from pip-audit==2.10.1 pip-audit -r /tmp/sharpit-requirements.txt --no-deps --disable-pip
uvx --from pip-audit==2.10.1 pip-audit -r website/requirements.txt --no-deps --disable-pip
- name: Audit locked npm dependencies
working-directory: ui
run: npm audit --audit-level=high

zizmor:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
permissions:
contents: read
security-events: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: astral-sh/setup-uv@1db35dd8eee11c5894872e0b383ae6c406cf738d # v10.4.0
- name: Audit workflows with zizmor
run: uvx zizmor@1.32.0 --format sarif .github/workflows > zizmor.sarif || true # Findings produce SARIF and a non-zero status.
env:
GH_TOKEN: ${{ github.token }}
- uses: github/codeql-action/upload-sarif@915412ff23e8b7659517e607487dbeae018f2934 # v4.39.5
with:
sarif_file: zizmor.sarif
category: zizmor
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ to loosen. Change a rule only in that test and here, in the same PR, with the re
- **Port BootUI, do not reinvent** (owner, 2026-11-12: "whatever we can directly port from BootUI we should; we don't
need to recreate anything, just rewrite and adapt"). Before writing any code for a feature, read BootUI's own source
for it at the pinned tag, in a BootUI clone, not this repo (`git -C <bootui clone> show v2.3.0:<path>` for 0.6.0;
`v2.4.0` for 0.7.0; `v2.5.0` for 0.8.0), and translate it: same structure, order of checks, thresholds, user-facing texts (env names
`v2.4.0` for 0.7.0; `v2.5.0` for 0.8.0 to 0.10.0; `v2.6.0` for 0.11.0), and translate it: same structure, order of checks, thresholds, user-facing texts (env names
adapted) and tests (`# ported:`). Adapt only where Python/FastAPI/SQLAlchemy forces it or an owner ruling differs;
each adaptation is one deviation row, with its reason, in the lane's matrix fragment
(`docs/reference/matrix-updates/<lane>.tsv`). Never design from a summary of BootUI: read the lines. The safety model
Expand Down
4 changes: 2 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ Security updates are provided only for the latest release on PyPI:

Please report suspected security vulnerabilities privately. **Do not post vulnerability details in public issues or discussions.**

- Once enabled on the repository, report privately via GitHub's "Report a vulnerability" button under the **Security** tab.
- Until private vulnerability reporting is enabled, please open a GitHub issue titled `"Security contact request"` containing **NO details**, and the maintainer will reply with a private channel to share details securely.
- Report privately using GitHub's "Report a vulnerability" button under the **Security** tab. The maintainer acknowledges reports within 7 days.

## Network Egress and Trust Boundaries

Expand All @@ -34,6 +33,7 @@ sharpit enforces strict safety invariants:
- Whole scans have a 60-second default deadline (`SHARPIT_VULNERABILITIES_SCAN_TIMEOUT`); each network request is capped by the remaining scan time.
- **Fails closed**: If network requests to OSV or EPSS fail or time out, the scan reports the failure gracefully without compromising security or crashing the host application.
- **Client address**: The trusted-source decision rests on the ASGI client address and the request's forwarding and client-address headers; the ASGI client address must be the real peer.
- **Cross-site requests**: An `Origin` header must be a serialized `http` or `https` origin (`scheme://host[:port]`, no path, trailing slash, query, fragment or userinfo, no surrounding whitespace, port at most 65535), and its host must be the request's `Host`; an unreadable, empty or `null` origin is refused on every method. On an API path the origin must equal the request's own scheme, host and port. A write that carries `Sec-Fetch-Site` must send `same-origin` or `none`; `same-site`, `cross-site`, an empty value and any unknown value are refused. Every refusal is a 403 with the cross-site message, and a request whose own origin cannot be formed never passes the API-path comparison.

### Request input reaching commands and file paths

Expand Down
24 changes: 24 additions & 0 deletions docs/decisions/004-dependency-audit-tooling.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Dependency audit tooling

## Status

Implemented in the weekly security audit workflow and on pull requests that change a dependency lock or the website requirements.

## Decision

OWASP Dependency-Check is not adopted for dependency auditing. Its [file type analyzer list](https://dependency-check.github.io/DependencyCheck/analyzers/index.html) does not include `uv.lock`. Its Python-related analyzers are “Pip”, which scans `requirements.txt` files, and “Python”, which scans Python source files and package metadata. Both appear under Experimental Analyzers; the documentation says these analyzers are experimental because of higher false positive and false negative rates.

Python dependency coverage comes from `pip-audit` over a requirements file exported from `uv.lock`, plus `website/requirements.txt`. npm dependency coverage comes from `npm audit` on `ui/package-lock.json`. CodeQL uses the `extended` query suite for code analysis, and zizmor audits GitHub Actions workflows.

## Rationale

Dependency-Check cannot directly consume the project’s Python lock file, and its documented Python analyzer only recognizes requirements files and package metadata. Exporting the frozen uv lock gives `pip-audit` the resolved dependency set without asking it to resolve dependencies. npm’s own audit command consumes the committed lock file directly. CodeQL and zizmor cover source-code and workflow risks outside package advisory matching.

## Consequences

The Python audit workflow must keep its export flags aligned with the project’s locked extras and groups and must use `pip-audit` without dependency resolution. The website requirements file is audited separately. npm audit reports high and critical findings as failures. Dependency-Check remains unconfigured; its experimental Python analyzers are not treated as lock-file coverage.

## Enforced by

- `.github/workflows/security-audit.yml` audits the frozen Python export, the website requirements, the npm lock, and the workflow files.
- `tests/test_ci_layout.py` pins the dependency audit triggers and commands; `src/sharpit/cli/docs_catalog.py` includes this decision in the bundled documentation catalog.
1 change: 1 addition & 0 deletions docs/decisions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ Each record states the decision, its status, and the code or tests that enforce
- [Baseline entry owner](baseline-owner.md) explains when a baselined test-runtime finding is reported fixed or inconclusive.
- [WSGI request target validation](wsgi-request-target.md) describes how the WSGI adapter checks the original request target and Host header.
- [Request values in memory](003-request-values-in-memory.md) records the bounded, request-lifetime matching used by the security-sinks sensor.
- [Dependency audit tooling](004-dependency-audit-tooling.md) records the decision not to adopt OWASP Dependency-Check and the package and workflow audit coverage.
17 changes: 17 additions & 0 deletions docs/development/ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,23 @@ full matrix runs on every merge before anything ships.
of that branch, which refreshes the base analysis the PR scans compare against (a stale one made each PR's Python sensor
re-parse ~848 files). Every push is its own concurrency group (`run_id`), so none cancels another.

## Dependency updates

At the start of each release wave, list open Dependabot pull requests with `gh pr list --author "app/dependabot"`.
Land them one at a time. Main protection requires an up-to-date branch and auto-merge is off: merge `origin/main` into
the Dependabot branch, push it, wait for CI, then merge the pull request.

Complete per-bump fixes before merging:

- A SonarSource scan-action bump also updates the scanner cache key
`sonar-${{ runner.os }}-vX.Y.Z` in `.github/workflows/ci.yml`. The key is pinned by
`test_the_sonar_scanner_cache_is_keyed_and_pinned`.
- An npm bump rebuilds `src/sharpit/ui/static` with `cd ui && npm ci --ignore-scripts && npm run build`, then commits the
built assets.

A maintainer commit on a Dependabot branch is signed off. A failed DCO check is fixed with a signed remediation commit,
never a force-push. When every Dependabot pull request fails the same shards, check `main` first.

## CodeQL on release pull requests

The classic branch protection rule for `release/*` enables CodeQL default setup on pull requests into version
Expand Down
38 changes: 38 additions & 0 deletions docs/reference/BOOTUI-2.6.0-DELTA.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# BootUI 2.6.0 static fixture delta

The static capture uses BootUI tag `v2.6.0` at commit `6efc78d31c08baae0fca7d33b00d464e9970bed6`, released on 2026-11-27. The fixtures are generated with `scripts/capture_bootui.py --version 2.6.0` from the BootUI source tree.

## Captured fixture changes

| Fixture | BootUI 2.5.0 | BootUI 2.6.0 | Source or reason |
|---|---:|---:|---|
| Panels | 65 | 65 | `BootUiPanels.java`; the panel catalogue is unchanged. |
| Tools | 116 | 116 | `bootui-cli/src/main/resources/bootui-tools.json`; names, input schemas and action flags are unchanged. Several descriptions changed; the remaining sharpit gaps are recorded in `tests/parity/tools_status.json`. |
| Route contracts | 85 reads, 78 actions, 269 starter mappings | 85 reads, 78 actions, 269 starter mappings | `BootUiApiContractCatalog.java`; route counts are unchanged. The GitHub report contract adds `repositoryContext` as an object. This response-key addition is read from `BootUiApiContractCatalog.java` at v2.6.0 because the route capture does not record response keys; the gap is recorded in `tests/parity/routes_status.json`. |
| Properties | 212 | 219 | `BootUiProperties.java` and generated configuration metadata; adds seven activity persistence and memory scan properties listed below. Four existing descriptions also change: `bootui.activity.persistence.instance-id` is now described as a legacy Live Activity partition key, alongside changes to `bootui.activity.persistence.table-name`, `bootui.github.max-api-calls`, and `bootui.github.max-security-alerts`. |
| Rule identifiers | 688 | 692 | The captured union adds `HIB-FETCH-010`, `HIB-QUERY-010`, `SEC-AUTHZ-006`, and `SPRING-WIRING-012`; no identifiers are removed. `rule-ids-diff.json` records 0 documentation-only and 32 Java-only identifiers. |
| Test inventory | 1,144 classes, 11,204 methods | 1,206 classes, 12,210 methods | Captured from the tagged Java test sources. |

The new properties are `bootui.activity.persistence.application-id`, `bootui.activity.persistence.hot-max-entries`, `bootui.activity.persistence.max-pending-bytes`, `bootui.activity.persistence.max-pending-entries`, `bootui.activity.persistence.namespace-id`, `bootui.activity.persistence.reader-archive-cross-namespace`, and `bootui.memory.include-histogram`. The persistence settings relate to durable activity history; the histogram setting controls JVM memory scanning.

The `GET /github` report gains the `repositoryContext` object, which carries the selected remote and sanitized origin/upstream repository identities. This addition is read from `BootUiApiContractCatalog.java` at v2.6.0 because the route capture does not record response keys; the gap is recorded in `tests/parity/routes_status.json`. Sharpit adds it in Task 1.8 of the 0.11.0 plan (`docs/superpowers/plans/2026-12-05-sharpit-0.11.0/PLAN.md`). `POST /github/refresh` remains the action route. The captured route inventory and starter mapping count do not change.

## JSON specifications

| BootUI source file | v2.5.0 to v2.6.0 change | Sharpit disposition |
|---|---|---|
| `bootui-cli/src/main/resources/bootui-tools.json` | 116 tools; names, input schemas and action flags are unchanged. Descriptions change for `get_live_activity` (including `queryHelp`), `memory_scan`, and `get_spring_data_repositories`. The latter tool's summary changes as well. | `get_live_activity` retains sharpit's wording until Task 3.13 of the 0.11.0 plan (`docs/superpowers/plans/2026-12-05-sharpit-0.11.0/PLAN.md`) adds durable history. The `memory_scan` and `get_spring_data_repositories` rows have status `missing`; each reason classifies the tool as not applicable in `tests/parity/tools_status.json`. |
| `.github/actions/bootui/default-policy.json`; `examples/ci/bootui-policy.json` | Both retain `schemaVersion: 1`; no diff. | No change required. |
| `plugins/bootui/plugin.json` | The version changes from `2.5.0` to `2.6.0`; other fields are unchanged. | Version metadata only. |
| `plugins/bootui/mcp.json`; `plugins/bootui/.claude-plugin/plugin.json` | No diff. | No change required. |
| `bootui-conformance/src/main/resources/io/github/jdubois/bootui/conformance/expected-panels-*.json`; `bootui-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json` | No diff. | No change required. |
| `bootui-conformance/src/main/java/io/github/jdubois/bootui/conformance/BootUiApiContractCatalog.java` | The GitHub report response contract adds `repositoryContext: OBJECT`. | Read from `BootUiApiContractCatalog.java` at v2.6.0 because the route capture does not record response keys; the gap is recorded in `tests/parity/routes_status.json`. Sharpit adds the field in Task 1.8. |

The JSON comparison confirms the planned changes with one additional detail: `get_spring_data_repositories` changes both its summary and description. No names, schemas, action flags, policy schemas, MCP configuration, plugin integration metadata, panel lists, or additional Spring configuration metadata change.

## Status changes

The tools, properties and routes parity tests now use the 2.6.0 fixtures. Seven new property rows are classified as missing in `tests/parity/properties_status.json`; their `reason` fields identify the task that will address or classify each gap. Six activity persistence rows are tracked by Task 3.13; the JVM-only memory histogram property is classified as n-a by Task 2.13 of the 0.11.0 plan (`docs/superpowers/plans/2026-12-05-sharpit-0.11.0/PLAN.md`). Three tool-description rows are recorded in `tests/parity/tools_status.json`: `get_live_activity` remains partial until Task 3.13, while `memory_scan` and `get_spring_data_repositories` have status `missing`; each reason classifies the tool as not applicable under Task 0.1 of the 0.11.0 plan (`docs/superpowers/plans/2026-12-05-sharpit-0.11.0/PLAN.md`).

The existing fixture inventory test remains pinned to its explicit version set because its version-specific count assertions do not cover the 2.6.0 inventory.

Loading
Loading