Skip to content

Discovery: open threats as an OpenThreat descriptor, with a per-installation announce switch - #181

Merged
ralyodio merged 1 commit into
masterfrom
openthreat-discovery
Sep 13, 2026
Merged

Discovery: open threats as an OpenThreat descriptor, with a per-installation announce switch#181
ralyodio merged 1 commit into
masterfrom
openthreat-discovery

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

Adds threatcrush.com/discovery, the list of threats ThreatCrush identified in the open, and serves it as an OpenThreat 0.1 descriptor at /.well-known/openthreat.json (spec: https://logicsrc.com/openthreat, logicsrc PR #167; first directory: nichedb.dev threats collection, niche-db PR #66).

Published: findings from the latest complete scan of each public, still-attached repository on an active, announcing installation: rule, CWE, category, severity, confidence, subject (owner/repo, GitHub URL, ref, commit), status open or fixed, first and last seen, count. The id is a hash of repo, rule and file, stable across line shifts.

Never published: private repositories, installation ids, account and sender logins, organizations, servers, properties, detections, and every finding's excerpt. Sensitive findings (secrets) also withhold file, line, message and consequence. assertNoPrivateData throws if any forbidden key reaches the serialized descriptor.

The announce switch (on by default): github_installations.announce, toggled under Account > Scan announcements by the person whose GitHub login matches the installation's account_login or sender_login. GET/PATCH /api/github/installations.

Migration step after merge: apply supabase/migrations/20260913030000_installation_announce.sql to project odhaoehucfyrqhanthyq via the Supabase MCP (memory: migrations are not auto-applied). Nothing breaks before that: a missing column reads as announce on, and the toggle answers 503 with a message.

Checks: vitest run on the two new test files: 21 passed. tsc --noEmit: five pre-existing errors (contact guard and x402-gateway modules missing from the hardlinked node_modules), none in the new files. Prod currently holds 0 scans, so /discovery shows its empty state until the GitHub App scans a public repository.

🤖 Generated with Claude Code

https://claude.ai/code/session_014cmNRtR2vL1p89dbVQ7FZJ

…llation announce switch

threatcrush.com/discovery lists what the GitHub App found in PUBLIC
repositories, and /.well-known/openthreat.json serves the same list as an
OpenThreat 0.1 descriptor (logicsrc.com/openthreat) for nichedb.dev and
any other directory to read.

What is published: findings from the latest complete scan of each public,
still-attached repository on an active, announcing installation, with
rule, cwe, category, severity, confidence, subject (owner/repo, URL, ref,
commit), status open or fixed, first and last seen. What is never
published: private repositories, installation ids, account and sender
logins, organizations, servers, properties, detections, and any finding's
excerpt. A sensitive finding (secrets) also withholds file, line, message
and consequence. assertNoPrivateData throws if a forbidden key ever
reaches the serialized descriptor.

The announce switch: github_installations.announce (migration, default
true). The installer turns it off under Account > Scan announcements; the
API gates on the signed-in user's GitHub login matching the installation's
account_login or sender_login. Until the migration is applied the code
treats a missing column as announce on and the toggle answers 503 with a
plain message.

Tests: open-threats (12) and the installations route (9), 21 passing.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014cmNRtR2vL1p89dbVQ7FZJ
@github-actions

Copy link
Copy Markdown

ThreatCrush Security Scan

12 finding(s)

HIGH/CRITICAL: 1 | MEDIUM: 6 | LOW: 5

Severity Rule Location
HIGH secret-aws-access-key prd/0003-detect-hardcoded-secrets-before-they-are-committed-or-served.md:126
MEDIUM js-open-redirect apps/web/src/app/auth/login/page.tsx:50
MEDIUM js-unescaped-html-sink apps/web/src/app/hire/page.tsx:104
MEDIUM js-unescaped-html-sink apps/web/src/app/hire/page.tsx:108
MEDIUM js-open-redirect apps/web/src/components/funding/FundingClient.tsx:97
MEDIUM js-unescaped-html-sink apps/web/src/components/GuideReader.tsx:265
MEDIUM js-uninitialized-buffer packages/scan/src/node-rules.ts:456
LOW secret-generic-credential PRD.md:269
LOW tls-verification-disabled prd/0004-find-dangerous-code-patterns-without-pretending-to-be-a-compiler.md:121
LOW tls-verification-disabled prd/0004-find-dangerous-code-patterns-without-pretending-to-be-a-compiler.md:122
LOW sh-remote-script-execution scripts/smoke-test.sh:47
LOW secret-aws-access-key scripts/smoke-test.sh:112

Snippets are redacted; ThreatCrush never prints matched credential material.

@ralyodio
ralyodio marked this pull request as ready for review September 13, 2026 03:28
@ralyodio
ralyodio merged commit b0f00ed into master Sep 13, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant