Skip to content

fix: include GitHub Enterprise internal repositories in scans - #37

Closed
ai-anant wants to merge 1 commit into
cyfinoid:mainfrom
ai-anant:fix/6-internal-repos
Closed

ai-anant wants to merge 1 commit into
cyfinoid:mainfrom
ai-anant:fix/6-internal-repos

Conversation

@ai-anant

@ai-anant ai-anant commented Aug 2, 2026

Copy link
Copy Markdown

Summary

Fixes #6 — GitHub Enterprise (Server/Cloud) organizations can have internal repositories (visible to all enterprise members, but not public). The org/user scan pipeline silently skipped them.

Root cause

In js/github-client.js, getRepositories() filtered every repository list with:

const isPublic = repo.visibility === 'public';
  • Org path (GET /orgs/{owner}/repos, line ~764): repos with visibility: 'internal' were dropped, even when the configured token had access to them.
  • User REST path (GET /users/{owner}/repos, line ~823): same filter.

The GitHub API only returns internal repos to authenticated callers with access, so unauthenticated scans are unaffected (they never see internal repos in the response). Internal visibility is org-owned on GitHub Enterprise; the user path change is for parity.

Changes

  • js/github-client.js: org + user REST filters now accept public or internal visibility.
  • js/app.js: the "No public repositories found" alert reworded to "No public or internal repositories found".
  • CHANGELOG.md: entry added under [Unreleased] → Fixed (per repo policy, every change is recorded).

Notes / limitations

  • Fetching an SBOM for an internal repo still requires a token with access to that repo; existing fetchSBOM 401/403 handling covers the failure case gracefully.
  • The app's API base URL is hardcoded to https://api.github.com — pointing the app at a GitHub Enterprise Server instance (different API host) is a separate feature, not addressed here.
  • The GraphQL user path hardcodes visibility: 'public'; user-owned repos cannot be internal, so this is not a functional gap.

Verification

  • node --check js/github-client.js
  • node --check js/app.js
  • No files added/removed → validate-deployment.yml file-presence checks unaffected.

Fixes #6

The repository filter in getRepositories() only kept visibility === 'public',
so internal repositories (org-owned repos visible to all enterprise members
but not public) were silently dropped even when the configured token could
see them. The org and user REST paths now accept both 'public' and
'internal' visibility. Unauthenticated scans are unaffected since the API
only returns internal repos to authenticated callers with access.

Fixes cyfinoid#6
anantshri added a commit that referenced this pull request Aug 6, 2026
@anantshri anantshri mentioned this pull request Aug 6, 2026
anantshri added a commit that referenced this pull request Aug 6, 2026
* feat: add Risk Portfolio dashboard (insights3) — domain-segmented due-diligence view

Design philosophy: three-column risk-domain breakdown (Security / Operational /
Compliance) each with score bar, key stats, and traffic-light badge. Overall
grade header with plain-English verdict.

- Security Posture: vulns, CVE dwell, malware, dep confusion
- Operational Health: EOL, version drift, repo activity, SBOM coverage
- License & Compliance: copyleft risk, unknown licenses, pinned actions
- Each domain scored 0-100 with color-coded progress bar
- Plain-English overall verdict tailored to risk level

* feat: add Org Report Card dashboard (insights4) — school-report format for execs

Design philosophy: universal report-card metaphor. Overall GPA + 6 subjects
with letter grades, status badges (Excellent/Good/Fair/Poor), and plain-English
comments. Everyone understands a report card.

- Vulnerability Management
- Dependency Freshness
- License Compliance
- Code Activity
- Supply Chain Security
- Maintenance Hygiene
- Overall GPA computed from subject grades

* feat: add One-Pager Snapshot dashboard (insights5) — single-viewport exec summary

Design philosophy: absolute minimal — one screen, 6 tiles, one verdict line.
No scrolling, no tables, no charts. Designed to fit on a laptop screen or
slide within a deck.

- Giant grade letter with health score and one-line verdict
- 6 metric tiles in 3x2 grid: repos, C+H vulns, EOL, licenses, drift, CVE dwell
- Color-coded left-border indicator on each tile (green/yellow/red)
- 'Top Concerns' tag cloud shown only when issues exist
- 'All clear' message when nothing needs attention

* feat: add AI Insights dashboard (insights-ai) — Chrome Gemini Nano-powered executive analysis

Uses Chrome's built-in Prompt API (window.ai.languageModel) to generate
natural-language executive briefs from SBOM data. Four analysis modes:

- Executive Summary — 2-3 paragraph CISO-facing overview
- Risk Deep-Dive — prioritized risk identification with severity context
- Recommendations — actionable, data-backed remediation steps
- M&A Due Diligence — acquisition-target assessment with deal recommendation

Design:
- Compact KPI strip always visible
- 4 mode-selector pills trigger on-device AI generation
- Streaming output with typing cursor
- Graceful fallback when AI API unavailable
- All processing on-device — zero data leaves the browser
- Nav links added across all insight pages for easy access

* feat: add AI Chat dashboard (insights-chat) — conversational SBOM analyst

Multi-turn chat interface powered by Chrome's Gemini Nano (Prompt API).
Users can ask free-form questions about their SBOM analysis data and get
natural-language answers grounded in the actual metrics.

Key features:
- Persistent AI session across multiple turns (conversation history)
- Streaming responses with live cursor
- 8 suggested questions as quick-start chips
- Compact KPI strip always visible for reference
- 'New conversation' button to reset context
- Session auto-recreation on error
- Warning at 25+ exchanges to start fresh
- Gemini Nano availability detection with graceful fallback
- Syncs analysis selector with other insight pages
- All processing on-device — zero data leaves the browser

* feat: add AI Agent (insights-agent) — Gemini Nano queries SBOM data via tool-use

Paradigm shift from pre-digested context to on-demand data access. The AI
decides what data it needs and calls query_sbom() as a registered tool,
like an analyst querying a database.

Architecture:
- Registers query_sbom() as a Prompt API tool with 12 data types
- Agent loop: AI calls function → JS executes → returns results → AI continues
- 12 queryable categories: overview, vulnerabilities, dependencies,
  repositories, licenses, eol, versionDrift, malware, techDebt,
  supplyChain, perRepo, hygiene, vulnAge
- Each query returns structured JSON with human-readable summary
- Tool calls shown in UI as log entries for transparency
- Max 6 tool-use turns per response to prevent infinite loops
- Graceful fallback if tools not supported in current Chrome
- Streams final answer with typing cursor

* initial code and ab testing

* ai chat bot fixed

* ai chat bot streamlining

* insights linking

* insights

* menu alignment

* insights finalized

* location fix

* clearly marking localai

* ported #37 and #36 over with adjustments.

* release: bump SBOM Play to v0.2

Promote accumulated Unreleased changelog to 0.2, update cache-busters and About version display, and bump actions/checkout to v7.0.1.

* release: bump SBOM Play to v0.2.1

v0.2 tag was burned by an erroneous release; re-version all cache-busters,
About page, and CHANGELOG header to 0.2.1. Also corrects about.html assets
that were missed in the prior bump.

* code review fixes

---------
@anantshri anantshri closed this Aug 6, 2026
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.

Github Enterprise Server : Fetching Internal Repo

2 participants