Repository navigation
feat(security): security-tracker contract with local-files and private Jira backends - #1647
Merged
Merged
Conversation
…e Jira backends The security skills assumed the tracker is a private GitHub repository. Teams that keep reports as Markdown files in a private SVN area or repository, or that triage in Jira, had no way in. Add contract:security-tracker (tools/security-tracker/) with two new backends behind it: - tools/local-tracker/ (magpie-local-tracker): reports as Markdown files in a private Git or SVN working copy. `detect` learns the format of the reports already in the folder (layout, ID pattern, metadata style and keys, state values or state folders, heading level, comments) and commits it as .magpie-tracker.json; with none, a documented default applies. Writes are refused until a human confirms the repository is access-restricted. `pending` / `publish` commit only the tracker folder, and push on Git. - tools/jira-security-tracker/ (magpie-jira-tracker): a Jira project whose issues carry an issue-security level. `create` always sets the level, and every write on an issue without one is refused. Skills reach every backend through vetted operations. The contract maps each tracker `gh` command the skills use to a vetted operation, and vetted-ops translates it for the backend its `[tracker]` policy names: fixed program, policy-pinned target, bodies on stdin, unmapped operations refused by name. Six operations give every tracker shape a vetted form: issue-create, issue-reopen, issue-list-label, issue-search, tracker-pending and tracker-publish. A shared block in the 12 tracker-touching security skills routes them, and ends a local-files session with a commit-and-push proposal. `/magpie-setup config` Step 3a picks the backend, detects the existing format and asks the access question. `tracker.platform` defaults to `github`, so existing adopters see no change. Design: docs/designs/2026-10-15-security-tracker-backends.md Generated-by: Claude Opus 5
tools/jira gained a Python REST client (jira_bridge.rest) that binds the token to a host the user confirmed, sends it only to that host over https, and refuses redirects. The Jira security tracker shipped its own HTTP client without those rules. Keep one client and one Jira tool. - jira_bridge.rest: JiraRest gains `user` (Basic user:token encoding, as bridge.groovy does) and `send()`, the one write path. `send()` applies every token rule and refuses any non-GET request when the token was withheld, so a write never goes out anonymously or to a re-pointed URL. - The security tracker moves in as jira_bridge.security_tracker, tracker_client and markup; `magpie-jira-tracker` is now a tools/jira script. Its credentials are JiraRest's: JIRA_API_TOKEN or ~/.config/apache-magpie/jira-token, with JIRA_API_HOST or a host= line. - tools/jira-security-tracker/ is removed; vetted-ops, the contract, the capability docs, the spec and the design point at tools/jira. Generated-by: Claude Opus 5
12 of 15 tasks
potiuk
added a commit
that referenced
this pull request
Oct 17, 2026
#1683) * fix(security-tracker): harden the local and Jira backends after review The security-tracker backends merged in #1647 without the fixes from its last review rounds. This carries them forward and closes the findings of the final review that were still open. Local-files tracker (git run outside the sandbox through vetted-ops): - publish pushes `HEAD:<branch>` to exactly the remote and ref it checked, with --no-follow-tags, so push.default=matching, a remote's push refspecs or push.followTags cannot send other branches or tags; - git reads attributes from the empty tree (GIT_ATTR_SOURCE), so no .gitattributes can switch on a filter, diff or merge driver even if one is configured after the per-command config check; - network-only pushes, no gc/maintenance hooks, and a tree comparison against the destination (from the earlier rounds); - descriptor names may contain spaces (`in progress`), still one path component; a bare number naming two reports is ambiguous, and underscore slugs resolve by their bare ID; - inline lists split on real item boundaries (apostrophes, escapes); - comment-marker authors are percent-encoded, so names with spaces read back. Jira tracker and setup: - a fence closes only on a matching fence of the same character and at least the same length, so a longer block cannot expose PoC headings; - the CLI takes an explicit --deployment, which vetted-ops always passes, so an inherited JIRA_DEPLOYMENT cannot switch a Server tracker to Cloud endpoints; - fresh setup scaffolds `tracker.platform: TODO`, so the backend question is asked; the Jira steps map labels to whitespace-free names and require `doctor` to pass. The plugin's copy of the vetted-ops sources and README is brought back in line with tools/vetted-ops. Generated-by: Claude Opus 5 * fix(security-tracker): ship the backends in the plugin; code-aware CVE fields - The jira and local-tracker backends reached the vetted-ops plugin as symlinks out of the plugin root, which a self-contained install (Codex, a plugin cache) does not carry. They are now generated copies, like vetted-ops itself, through the plugin generator's `copies` table. The plugins member's ruff run skips the jira copy, whose source is checked under its own settings in tools/jira. - generate-cve-json read a `### <field>` heading even inside a code block, so a PoC quoting `### CVE tool link` with an example CVE ID before the real field supplied that ID. Field extraction and the attachment splice now skip Markdown fences (matching character and length) and Jira {code}/{noformat} blocks, for bodies from any tracker. Generated-by: Claude Opus 5 * fix(generate-cve-json): code blocks cannot merge a private field into a public one The code-aware field parser let reporter text hide later field headings: an unclosed fence, a fence closed in a later field, or a line-leading Jira macro in the public summary made it absorb the following fields, including the private security-thread URL, into the public CVE description. Field boundaries follow the body-field contract again: every `###` line splits fields. The one exception is a `### X` line inside a code block that both opens and closes when field X also has a heading outside every code block, which is a PoC quoting a field, not the field. A heading with no counterpart outside code stays a boundary even inside a block, so a field can only ever be shorter than the old split, never longer. Jira blocks open only on a line that starts with the macro, so an inline `{code}` mention is just text. Generated-by: Claude Opus 5 * fix(generate-cve-json): field boundaries never depend on code blocks Dropping a quoted heading as a boundary still lengthened the field before it: an unfenced fake `### Security mailing list thread` earlier in the report made the real heading inside a spanning fence look like a quote, and the public summary absorbed the private thread URL. Every `###` line now ends a field, as the body-field contract says, so a value is always exactly one section of that split. Code blocks only pick which `### <heading>` starts the requested field: the first one outside every closed block, else the first, so a PoC quoting `### CVE tool link` inside a fence is still not taken for the field. Generated-by: Claude Opus 5
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
contract:security-tracker(tools/security-tracker/) with two new backends next to GitHub, selected bytracker.platform(defaultgithub, so existing adopters see no change):local-files—tools/local-tracker/: reports as Markdown in a private Git or SVN working copy.detectlearns the format of the reports already in the folder (layout, ID pattern, metadata style and keys, state values or state folders, heading level, comments) and commits it as.magpie-tracker.json; with no reports a documented default applies. Writes are refused until a human confirms the repository is access-restricted. A session that wrote to the tracker ends with a commit-and-push proposal;publishcommits only the tracker folder (and pushes on Git; on SVN the commit is the publish).jira—magpie-jira-trackerintools/jira/: a Jira project whose issues carry an issue-security level.createalways sets the level; every write on an issue without one is refused. Built on the existingjira_bridge.restclient, which gains a write path (send()) under the same host-bound-token rules and refuses writes when the token was withheld.ghcommand the security skills use to a vetted operation; vetted-ops translates it for the backend named in its[tracker]policy (fixed program, policy-pinned target, bodies on stdin) and refuses by name the operations with no counterpart (boards, milestone admin, roster,rollup-fold). Six operations give every tracker shape a vetted form:issue-create,issue-reopen,issue-list-label,issue-search,tracker-pending,tracker-publish. A shared block in the 12 tracker-touching security skills routes them;/magpie-setup configStep 3a picks the backend, runsdetect, and asks the access question.Design and plan:
docs/designs/2026-10-15-security-tracker-backends.md.Type of change
tracker-backendblock in 12 security skills; setupconfigStep 3atools/security-tracker/contract.md)tools/local-tracker,tools/jira,tools/vetted-ops)tracker.platform,tracker.local.*,tracker.jira.*)Test plan
prek run --all-filespasses (after rebasing onmain)tools/local-tracker: 16 tests, incl. real Git (bare remote) and SVN (svnadmin) commit-and-push; ruff, mypy cleantools/jira: Python tests pass (REST client incl. the newsend()token rules; 58 security-tracker CLI + markup tests); Groovy tests skip without Groovy, as beforetools/vetted-ops: full suite passes, incl. a test that derives the tracker operations from the catalogue and fails if any is neither translated nor refused, and an end-to-end run through vetted-ops against the real local trackerimport-from-mdstep 1 case-4 (findings-format.md),issue-fixstep 7 case-1 (Step 7 text byte-identical tomain),issue-importstep 2b case-4 and step 5 case-3 (screening-and-proposal.md),issue-syncGHSA case-5 (github-advisory.md); the two I re-ran failed identically, so they are pre-existing onmain.RFC-AI-0004 compliance
[tracker]table only on confirmationtracker-publishis the one new operation onvetted-op-trackerLinked issues
Refs #301 (Jira write support).
Notes for reviewers
access_restricted: true, anddoctorfails on a public GitHub remote. Worth a careful read intools/jira/src/jira_bridge/security_tracker.pyandtools/local-tracker/src/magpie_local_tracker/store.py.tracker_backends.pyis the translation; the policy supplies only data (the backend's tool directory, which must be the one the platform names, and its target), never a command.issue-searchrefuses:so arepo:qualifier cannot re-target it, and ends options with--.tools/jira-security-tracker/; after rebasing onmain(which addedjira_bridge.rest) it is folded intotools/jiraso there is one client and one credential rule. That is the second commit.~/.claude/magpie/vetted-ops) needs refreshing (setup-isolated-setup-update) before the new operations work in a sandboxed session.Gen-AI disclosure: prepared with the assistance of Claude Code (Claude Opus 5); reviewed by the author.
🤖 Generated with Claude Code