Skip to content

feat(security): import email-delivered scans; add submit-to-oss-scan - #1786

Merged
potiuk merged 2 commits into
apache:mainfrom
potiuk:feat/scan-import-oss-scanner-email
Oct 24, 2026
Merged

potiuk merged 2 commits into
apache:mainfrom
potiuk:feat/scan-import-oss-scanner-email

Conversation

@potiuk

@potiuk potiuk commented Oct 24, 2026

Copy link
Copy Markdown
Member

Summary

  • Import a scan that arrives as one email. The Anthropic OSS Scanner discloses a whole scan in a single multi-MB plain-text mail (an INDEX, one ANT-YYYY-… block per finding, a "NOT SECURITY" list, a GPG-encrypted archive). security-issue-import-from-scan only knew ASVS report folders and GitHub issues. This adds an anthropic-oss-scanner scan-format adapter: security-management issue-import-from-scan parse-email turns the .eml (or a saved Gmail-connector result) into a scan folder (index.json + one evidence/<id>.md per finding) and refuses to call a scan complete unless the preamble totals, every severity banner, the INDEX, the parsed blocks and the closing signature all agree. Attachments are saved byte-exact (sha256, OpenPGP framing checked, never decrypted); every file is written owner-only.
  • Read the whole message. New read-only oauth-draft-fetch-message saves a Gmail message's raw RFC-5322 source to a file. The Gmail connector inlines bodies into context and its text rendering drops control characters (a NUL-byte password reads as ""), so connector-derived input is marked lossy. Reports built from a private mail never go to a gist.
  • security-submit-to-oss-scan, a new skill. Prepares the enrolment (or update) PR against anthropics/oss-scanner — project.yaml, an offline-capable Dockerfile derived from the project's own CI, and a threat_model.md derived from the project's security model — and walks the maintainer through tools/validate.py / tools/check before anything is opened. The summary is wired into the model lifecycle: security-model-prepare hands off to it, security-model-update Step 12 refreshes stale copies (tracked by model commit in a new Scanner threat-model summaries table), and issue-import-from-scan routes repeat by-design clusters back to security-model-update.

Type of change

  • Skill change — new security-submit-to-oss-scan; issue-import-from-scan, security-model-update, security-model-prepare amended; eval suite added
  • Tool / bridge contract (tools/scan-format/README.md — email-delivered scans)
  • Python package (tools/security-management, tools/gmail/oauth-draft)
  • Project template (security-model.md — scanner summaries table)
  • Documentation

Test plan

  • prek run on every changed file passes
  • uv run pytest for tools/security-management and tools/gmail/oauth-draft (new: test_issue_import_from_scan_oss_scanner.py, test_fetch_message.py)
  • End to end on a real 115-finding disclosure (3.27 MB .eml): 115 findings + 16 not-security bugs, checks.complete: true, identical parse from the .eml and the connector JSON except where the connector dropped control characters; the 1.5 MB encrypted archive saved intact
  • New eval suite tools/skill-evals/evals/security-submit-to-oss-scan/ (threat-model derivation: supported claim vs model gap)
  • Nine rounds of roborev review, every finding fixed with a regression test

RFC-AI-0004 compliance

  • HITL — the import never auto-imports; the enrolment PR, its checklist boxes and the CLA signature stay the maintainer's
  • Sandbox — tools/check is never run by the agent; nothing executes the scanner's reproducers
  • Vendor neutrality — placeholders throughout; the scan-format contract stays adapter-based
  • Write-access discipline — drafts only; gh pr create --web for the enrolment PR
  • Privacy LLM — private disclosure mail stays local (no gist), files are 0600

Notes for reviewers

  • The parser was exercised against the real layout, which differs from the Gmail rendering (padded header fields, an RFC 3676 signature delimiter); the fixture mirrors the raw form.
  • The scanner asks fixers to cite the finding id in the commit; the adapter doc notes that for a pre-advisory fix that line would disclose the vulnerability, so the id belongs in the tracker.

Gen-AI disclosure: drafted with Claude Code (Opus 5); reviewed by the submitter.

🤖 Generated with Claude Code

The Anthropic OSS Scanner discloses a whole scan in one multi-MB
plain-text email. Add an `anthropic-oss-scanner` scan-format adapter:
`security-management issue-import-from-scan parse-email` turns the
.eml (or a saved Gmail-connector result) into a scan folder and checks
completeness against the preamble, banners, INDEX and signature;
attachments are saved byte-exact with their OpenPGP framing checked,
never decrypted, and every file is owner-only. Add the read-only
`oauth-draft-fetch-message` so a message that large lands in a file
rather than the context; a private source never goes to a gist.

Add the `security-submit-to-oss-scan` skill: the enrolment PR against
anthropics/oss-scanner, with a threat_model.md derived from the
project's security model, and wire it into security-model-prepare and
security-model-update (a Scanner threat-model summaries table tracks
each copy by model commit).

Generated-by: Claude Opus 5
@github-actions github-actions Bot added family:security security-* skills family:setup setup-* skills family:tools tools/* family:docs Docs, MISSION.md, READMEs family:ci .github workflows, prek, validators capability:intake Import external signal + sync tracker state capability:reassess Re-run historical issues against current code capability:platform Framework / agent substrate skills (install, verify, doctor, override, status, setup bootstrap) capability:authoring Skills that author or maintain other skills: write-skill, optimize-skill contract:mail-archive Tool capability: mailing-list / forum archive reads contract:mail-source Tool capability: inbound-mail ingestion (mbox / IMAP / ...) contract:mail-create Tool capability: outbound mail composition (editable draft; sending is a separate human step) contract:scan-format Tool capability: security-scanner report parsing substrate:analytics Tool substrate: read-only metrics / dashboards / renderers substrate:framework-dev Tool substrate: build / validate / eval the framework itself labels Oct 24, 2026
CodeQL: `_LOC` and `_FENCE` were left behind when entry and header
parsing moved to `_ENTRY_LOCATION` and `_HEADER_BLOCK`.

Generated-by: Claude Opus 5
@potiuk
potiuk merged commit 374d85b into apache:main Oct 24, 2026
18 checks passed
@potiuk
potiuk deleted the feat/scan-import-oss-scanner-email branch October 24, 2026 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

capability:authoring Skills that author or maintain other skills: write-skill, optimize-skill capability:intake Import external signal + sync tracker state capability:platform Framework / agent substrate skills (install, verify, doctor, override, status, setup bootstrap) capability:reassess Re-run historical issues against current code contract:mail-archive Tool capability: mailing-list / forum archive reads contract:mail-create Tool capability: outbound mail composition (editable draft; sending is a separate human step) contract:mail-source Tool capability: inbound-mail ingestion (mbox / IMAP / ...) contract:scan-format Tool capability: security-scanner report parsing family:ci .github workflows, prek, validators family:docs Docs, MISSION.md, READMEs family:security security-* skills family:setup setup-* skills family:tools tools/* substrate:analytics Tool substrate: read-only metrics / dashboards / renderers substrate:framework-dev Tool substrate: build / validate / eval the framework itself

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants