Repository navigation
fix(setup): reconcile security issue-import caller grants #1749
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
base: main
Are you sure you want to change the base?
Changes from all commits
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 |
|---|---|---|
|
|
@@ -270,6 +270,22 @@ When a vetted-ops policy exists, show the `[tracker]` table it needs — | |
| and write it only on the user's confirmation; the policy is a security control, not configuration this step may change unasked. | ||
| Grant the security callers `issue-create`, `issue-search`, `issue-list-label`, `issue-reopen`, `issue-body`, `issue-attach`, `tracker-doctor`, `tracker-pending` and `tracker-publish` in the same diff. | ||
|
|
||
| For the security issue-import workflows, also check the policy's `[callers]` | ||
| table. When those workflows are configured, propose exactly these grants: | ||
|
Member
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. This sits inside Step 3a, which line 217 runs only when |
||
|
|
||
| | Caller | Required operations | | ||
| |---|---| | ||
| | `security-issue-import` | `rollup-append` | | ||
| | `security-issue-import-from-md` | `rollup-append` | | ||
| | `security-issue-import-from-pr` | `pr-view-with-body`, `rollup-append` | | ||
|
|
||
| These are separate caller identities. Do not substitute one for another or | ||
| grant `body-field-set` to an import caller: none of these workflows invokes it. | ||
| Show the proposed policy diff and apply it **only on explicit user confirmation**. | ||
|
Member
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.
|
||
| Merge missing operations into an existing caller array; never duplicate a TOML | ||
| key, remove existing grants, or change unrelated callers. If no vetted-ops | ||
| policy exists, do not create one implicitly. | ||
|
|
||
| ## Step 3b — Record what this run reconciled | ||
|
|
||
| For every skill in scope (Step 1) whose `requires_config:` set now fully | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -150,6 +150,29 @@ baseline required. | |
| name>` requires `<file>`, which is not configured"* — propose | ||
| `/magpie-setup:setup config <skill>` for it. | ||
|
|
||
| 3a. **Import caller policy grants.** When an existing vetted-ops policy | ||
|
Member
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. On Jira / local-files, |
||
| is present and a security issue-import skill is in scope (step 1), | ||
| read its `[callers]` table. Compare the applicable caller against | ||
| the minimum permissions used by the skill: | ||
|
|
||
| Use the exact caller-to-operation mapping in [`config.md` § Step 3a](config.md) for the three security import workflows. Do not infer or add other permissions. | ||
|
potiuk marked this conversation as resolved.
|
||
|
|
||
| A missing caller or missing required operation is a finding. Name the | ||
| caller, the missing operations, and the existing policy path. Propose | ||
| adding only those grants; do not grant `body-field-set`, which these | ||
| import workflows do not use. When a caller already exists, merge | ||
| missing operations into its existing TOML array rather than creating | ||
| a duplicate key. Preserve comments, unrelated callers and existing | ||
| permissions. | ||
|
|
||
| This is a security-control change, not an automatic repair. Show the | ||
| exact proposed diff and obtain item-by-item confirmation before | ||
| writing anything. A declined change leaves the policy unchanged and | ||
| the finding unresolved; do not report or stamp that configuration | ||
| as clean. If the policy does not exist, mark this check not applicable: | ||
| do not create a vetted-ops policy during reconciliation. If the | ||
| policy cannot be read or parsed, report it as unchecked, not clean. | ||
|
|
||
| 4. **Sandboxed sessions cover what they can reach.** Resolving a | ||
| skill's anchors (check 2) needs that skill's `SKILL.md` **and its | ||
| sibling detail files**. On a pinned-snapshot install they sit inside | ||
|
|
@@ -182,8 +205,8 @@ baseline required. | |
|
|
||
| ## Step 1 — Present the findings | ||
|
|
||
| List every finding from checks 2–3 as a numbered proposal, one item per | ||
| override or `requires_config` gap: | ||
| List every finding from checks 2–3a as a numbered proposal, one item per | ||
| override, `requires_config` gap, or missing import caller policy grant: | ||
|
|
||
| ```text | ||
| 1. .apache-magpie-overrides/issue-triage.md anchors to | ||
|
|
@@ -195,8 +218,8 @@ override or `requires_config` gap: | |
| → /magpie-setup:setup config pr-management-code-review | ||
| ``` | ||
|
|
||
| No findings → say so plainly (*"every configured skill's anchors and | ||
| `requires_config` entries resolve"*), name any `unchecked` skills from | ||
| No findings → say so plainly (*"every configured skill's anchors, | ||
| `requires_config` entries and applicable vetted-ops caller grants resolve"*), name any `unchecked` skills from | ||
| check 4, and go straight to Step 2 with nothing to confirm — writing | ||
| the stamp needs no confirmation when nothing is changing. | ||
|
|
||
|
|
@@ -209,6 +232,13 @@ maintainer's judgement call, not pattern-matching. A `requires_config` | |
| gap can be closed mechanically by chaining into | ||
| `/magpie-setup:setup config <skill>`; offer it per item. | ||
|
|
||
| For an import caller policy finding (check 3a), show the minimum-grant | ||
| TOML diff before asking. Apply it only after confirmation. A refusal does | ||
| not authorize a policy edit or a clean reconciliation stamp for that | ||
| unresolved configuration. Do not treat resolved `requires_config` files | ||
| alone as proof of a clean skill when its required caller grants are missing. | ||
| Preserve existing policy content not covered by the confirmed change. | ||
|
|
||
| Both `acknowledged` writes below fire **on decline**, not on show — unlike | ||
| the pre-flight block's own per-skill check | ||
| ([`tools/dev/preflight-block.md`](../../../../tools/dev/preflight-block.md) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| { | ||
| "proposals": [ | ||
| { | ||
| "kind": "policy", | ||
| "skill": "security-issue-import", | ||
| "override_file": null, | ||
| "detail": "Missing caller security-issue-import in .apache-magpie-overrides/tools/vetted-ops/config.toml; propose rollup-append only." | ||
| }, | ||
| { | ||
| "kind": "policy", | ||
| "skill": "security-issue-import-from-md", | ||
| "override_file": null, | ||
| "detail": "Existing caller security-issue-import-from-md lacks rollup-append; preserve its issue-view grant." | ||
| }, | ||
| { | ||
| "kind": "policy", | ||
| "skill": "security-issue-import-from-pr", | ||
| "override_file": null, | ||
| "detail": "Existing caller security-issue-import-from-pr lacks pr-view-with-body; preserve its rollup-append grant." | ||
| } | ||
| ], | ||
| "unchecked": [], | ||
| "stamp_written": false | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| <!-- SPDX-License-Identifier: Apache-2.0 | ||
| https://www.apache.org/licenses/LICENSE-2.0 --> | ||
|
|
||
| Install method: `git-branch` (pinned snapshot). | ||
|
|
||
| Scope: 3 configured security import skills, no override files. | ||
| All three skills' `requires_config:` entries resolve from the personal | ||
| layer or committed overrides. All their SKILL.md files are readable. | ||
| No anchor or required-configuration findings exist. | ||
|
|
||
| Existing vetted-ops policy: | ||
| `.apache-magpie-overrides/tools/vetted-ops/config.toml` | ||
| The policy is valid TOML and has this `[callers]` section: | ||
|
|
||
| ```toml | ||
| [callers] | ||
| "security-issue-import-from-md" = ["issue-view"] | ||
| "security-issue-import-from-pr" = ["rollup-append"] | ||
| "security-issue-sync" = ["issue-view", "rollup-append"] | ||
| ``` | ||
|
|
||
| The following workflows are configured and in scope: | ||
|
|
||
| - `security-issue-import` requires `rollup-append`. | ||
| - `security-issue-import-from-md` requires `rollup-append`. | ||
| - `security-issue-import-from-pr` requires `pr-view-with-body` | ||
| and `rollup-append`. | ||
|
|
||
| No one has confirmed changes to the vetted-ops policy. | ||
| Do not modify the policy or write a clean reconciliation stamp. | ||
| Return the missing caller/grant proposals only. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These grants already live in the
[callers]example intools/vetted-ops/README.md, and #1750 addsissue-list-with-bodiesthere. With a second copy here, whichever PR merges second leaves this stale, and reconcile's "do not add other permissions" would then refuse the grant import needs. Please point Step 3 / check 3a at the README block instead of restating it.