snoopdave commented on code in PR #401: URL: https://github.com/apache/roller/pull/401#discussion_r4712518528
########## skills/roller-security/src/roller_security/models.py: ########## @@ -0,0 +1,164 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Tiered LLM router for Apache Roller security triage. + +Supports: +- Tier 1 (CHEAP): routine extraction, email drafting, air-gapped public text drafting. +- Tier 2 (FRONTIER): deep codebase investigation, severity/CVSS assessment, disclosure audit. +- Privacy enforcement: when ``local_llm_only=True`` and ``private_context=True``, + routes strictly to a local ``ollama:`` model and rejects any cloud provider spec. +""" + +from __future__ import annotations + +import os +from enum import Enum +from typing import Any, Callable, TypeVar + +from pydantic import BaseModel + +T = TypeVar("T", bound=BaseModel) + + +class ModelTier(str, Enum): + CHEAP = "cheap" + FRONTIER = "frontier" + + +DEFAULT_MODELS: dict[ModelTier, str] = { + ModelTier.CHEAP: "anthropic:claude-sonnet-5-5", Review Comment: 🤖Claude: partly fixed. SKILL.md and README now say that the private-context steps go to the configured cloud models unless `--local-llm` is set, and that nothing checks the account's retention terms. The ZDR wording is gone from README and `state.py`. I left the default as cloud: whether undisclosed reports may go to a cloud model by default is a PMC decision. ########## skills/roller-security/SKILL.md: ########## @@ -24,112 +24,94 @@ limitations under the License. Use this workflow for vulnerability response, not ordinary bug fixes. The PMC owns acceptance, severity, release scope, and disclosure decisions. This skill -supports those decisions; loading it does not authorize messages or publication. -Parts are designed to work with Obsidian (the triage-<year> directory is a vault), -but Obsidian is optional. +supports those decisions; loading it does not authorize sending mail, opening +PRs, or publishing advisories. + +Case tracking and workflow state are managed by this skill's local LangGraph CLI +(`skills/roller-security/`) backed by SQLite (`<triage-dir>/cases.db`), with +generated read-only Markdown views (`CASE.md` and `SUMMARY_BOARD.md`). No +external note app or plugin is required. ## Confidentiality and project practice -Keep reports, reproductions, CVE reservations, reporter identities, investigation -notes, and disclosure schedules in a private workspace. If using `triage-<year>/` -in a checkout, verify its local Git exclusion before adding case material. -Exclusion prevents accidental additions; it is not access control and does not -remove material from Git history. Never force-add private records. - -Roller uses public code review for fixes. Follow the PMC's agreed workflow and -keep vulnerability characterization out of branch names, commits, PR text, tests, -and comments until disclosure. Neutral wording alone does not prove that a diff -is safe: review what the entire change reveals, including related cases. Resolve -uncertainty with the PMC and ASF Security. Do not assume that derivability from -public source makes an unannounced finding appropriate for publication. - -When public text such as a release announcement, blog post or website page is -prepared before disclosure, by a person or another agent, give the author the -permitted facts and the constraints on scope and tone. Do not tell them what is -being withheld or why: the instruction itself must be safe to leak. Keep such text -neutral until the advisories are out. - -Keep only generic procedures and synthetic templates in this skill. Do not add -live portal screenshots, case-derived examples, or release execution notes. - -## Read the case before acting - -1. Locate the private workspace and read its summary and the item's `TRACKING.md`. -2. Read the original report, reproduction evidence and `IMPLEMENTATION.md`. -3. Check the implementation branch, review state and release target against the - actual repository. Do not infer that a message was sent from a draft file, or - that none was received because the record lacks one; search the correspondence - before stating what a reporter said or did not say. -4. Reconcile `CVE_FORM.md` before using the portal or drafting an advisory. - -For new cases, copy `assets/item-template/` into a private item directory. -`TRACKING.md` frontmatter stores facts; checkboxes store workflow state. The -terminal board reads those files directly: +- Keep reports, reproductions, CVE reservations, reporter identities, + investigation notes, `cases.db`, and disclosure schedules in a private + workspace (`TRIAGE_DIR`, e.g. `triage-<year>/`). Verify its local Git + exclusion in `.git/info/exclude` before adding case material. Never + force-add private records. +- Roller uses public code review for fixes. Keep vulnerability characterization + out of branch names, commits, PR text, tests, and comments until disclosure. + Neutral wording alone does not prove a diff is safe: review what the entire + change reveals, including related cases (`shares_code_with`, `related`). +- When preparing public text (PR bodies, release notes, announcements, website + updates) before disclosure, pass only the sanitized `PublicBrief` (permitted + facts and tone constraints)—never reveal what is being withheld or why. +- Keep only generic procedures and synthetic templates in this skill. Do not + add live portal screenshots, case-derived examples, or release execution notes. + +## Operating the LangGraph triage runner + +Run commands from `skills/roller-security/` with `uv run roller-security`: ```sh -python3 skills/roller-security/scripts/triage-status.py "$TRIAGE_DIR" +# View the current board, blockers, release gates, and consistency checks +uv run roller-security board --triage-dir ../../triage-<year> + +# Start a new security case (creates <triage-dir>/cases.db if needed) +uv run roller-security start \ + --repo ../.. \ + --triage-dir ../../triage-<year> \ + --case-id 01 --slug short-neutral-slug --owner <asf-id> \ + --report ../../triage-<year>/raw-report.eml + +# Inspect or resume a paused human gate +uv run roller-security status <case-key> --triage-dir ../../triage-<year> +uv run roller-security resume <case-key> --triage-dir ../../triage-<year> --json '<payload>' + +# Export leak-safe PublicBrief JSON for tools/roller-release-graph --security +uv run roller-security export-briefs --target-release 7.0.0 --triage-dir ../../triage-<year> ``` -Set `TRIAGE_DIR` to the actual private workspace. Commands above run from the -Roller checkout root; when installed elsewhere, resolve scripts relative to this -skill. Plain Markdown editing works; Obsidian Tasks is optional. Read -[tracking conventions](references/obsidian-tasks-tracking.md) when creating or -migrating records. Keep completion dates and mark irrelevant tasks explicitly. +Pass `--local-llm` to restrict all private-context LLM calls to local Ollama, +or `--dry-run --mock-llm` to test a workflow offline. -## Workflow +## Workflow summary Read [ASF process and routing](references/asf-process.md) for policy sources and -project-specific decisions. Verify current policy when performing the workflow. - -1. Acknowledge receipt without inventing a verdict or fix commitment. -2. Investigate reachability, actor privileges, configuration, affected versions, - impact and duplicates. Record evidence separately from inference. Use the - [codebase orientation](references/roller-codebase-map.md) to find entry points. -3. Record the PMC's acceptance, rejection or duplicate decision. Explain a - rejection with verified reasons; re-evaluate each report independently. -4. Tell the reporter the accepted remedy and any agreed schedule. Distinguish - planned work from completed work. Check existing credit preferences first; - ask when unclear. Use [communication templates](references/comms-templates.md). -5. Assess [severity and CVSS](references/severity-and-cvss.md), reconcile the CVE - worksheet, and request an ID from ASF Security through the +project-specific decisions. Each stage is enforced by `tools/roller-security-graph` Review Comment: 🤖Claude: fixed by pointing SKILL.md, README, the CLI help and the release gate at this skill's `roller-security` CLI and the `roller-release` skill. The references to `tools/roller-security-graph`, `tools/roller-release-graph` and `roller-release start --security` are gone. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
