Commit graph

8 commits

Author SHA1 Message Date
amertensreplit
543fd96afd Verbindungscheck beim Provider-Einrichten (Task #10)
Add an inline "Verbindung testen" button to the Neuer/Bearbeiten provider
dialogs so users can test a connection with the currently entered values
before saving.

Backend:
- New endpoint POST /providers/test-connection that accepts an ad-hoc provider
  config (apiType, baseUrl, model, optional apiToken, optional providerId) in
  the request body and runs a one-shot test via the existing callProvider
  logic. When apiToken is empty and providerId is given, it falls back to the
  stored token of that provider (edit case). Returns { ok, message }; the token
  is never returned or leaked (existing redactSecrets still applies to errors).
- Defined ProviderTestConnectionInput schema + path in openapi.yaml and ran
  codegen for Zod schemas and the React client.

Frontend (artifacts/skillguard/src/pages/admin.tsx):
- Add dialog: "Verbindung testen" button (disabled until Base URL + Token set
  or while testing) with loading spinner and an inline green success / red
  error result box. Result resets when the dialog closes.
- Edit dialog: same inline test; empty token field falls back to the stored
  token via providerId. Result resets on open/close.
- The existing per-card "Verbindung testen" button is unchanged.

Verification: typecheck passes for api-server and skillguard; curl tested the
new endpoint for success-path (fetch error surfaced), empty-token, and invalid
body (400) cases. Token not present in any response.

Deviations: none.
Replit-Task-Id: 4f77293f-468c-496a-ab05-1f10e7bf8137
2026-06-10 18:54:56 +00:00
Replit Agent
434ec07885 Add live progress updates and detailed scan checkpoints to scan results
Introduce streaming endpoint for NDJSON scan progress, incorporate scan checkpoints into scan details, and update UI components to display this new information.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 0d01f99a-ea6a-447d-82fd-311715434a39
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: 2852b526-3bf8-4a93-a62a-a50e26291074
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/e32d2b99-1721-47dd-833c-98b372f48008/0d01f99a-ea6a-447d-82fd-311715434a39/8MCgDZm
Replit-Helium-Checkpoint-Created: true
2026-06-10 18:53:17 +00:00
amertensreplit
87d71c1dca Bericht zusätzlich als PDF exportieren
Adds a "Als PDF exportieren" button to the scan report page next to the
existing JSON export, fulfilling Task #3.

Implementation:
- artifacts/skillguard/src/pages/scan-report.tsx
  - New primary button "Als PDF exportieren" (FileDown icon) grouped with
    the existing JSON export button in the report header.
  - handleExportPdf opens a new window, writes a self-contained print-
    friendly HTML document, and triggers window.print() (browser
    "Als PDF speichern"). No new dependencies added.
  - buildReportHtml(data) generates the document containing: title +
    verdict, metadata (date, source, file count, KI flag), optional AI
    warning, Risiko-Score with summary text, Achsen-Zusammenfassung table
    (severity + axis counts incl. total), all findings (severity/axis/
    rule/detection, location, description, snippet, remediation), and the
    checked files table.
  - All labels are German via VERDICT/SEVERITY/AXIS/SOURCE/KIND label maps;
    no emojis used; print-friendly inline CSS with page-break-inside avoid
    on findings.
  - User-provided content is escaped via escapeHtml to prevent HTML
    injection in the generated document.

Verification:
- pnpm --filter @workspace/skillguard typecheck passes.
- Created test scan (id 8) via API, confirmed button renders and German
  label mapping is correct for verdict/severity/axis.

Deviations: none. Chose the browser print-to-PDF approach (zero new deps)
over a client-side PDF library, which keeps the bundle lean and produces
selectable, print-friendly output.

Replit-Task-Id: e3f37193-89fd-42de-8cec-9383c8406b25
2026-06-10 13:57:05 +00:00
amertensreplit
9f7b67972f Task #2: Skill mit konfigurierter KI tatsächlich semantisch analysieren
Verified the AI analysis end-to-end with a real provider and fixed two gaps
found during the live run.

Findings & fixes:
- gpt-5 series (Replit AI Integrations modelfarm default) rejected the hardcoded
  `temperature: 0.1` with HTTP 400, silently disabling AI analysis. Removed the
  temperature param from the OpenAI-compatible request for broad model
  compatibility (aiAnalysis.ts).
- Per-rule AI config (enable/disable/severity) was only a global on/off gate and
  AI findings weren't mapped to the AI rule IDs, so individual rule severity was
  ignored. runAiAnalysis now receives the enabled AI rules, instructs the model
  to classify each finding into one of those ruleIds, drops findings for
  disabled rules, and overrides severity/axis with the configured values
  (aiAnalysis.ts + scanEngine.ts).

End-to-end verification (Replit OpenAI integration, gpt-5-mini provider):
- "KI-Analyse aktivieren" produces AI findings mapped to AI-PROMPT-INJECTION,
  AI-MALICIOUS-INTENT, AI-DATA-PRIVACY.
- Disabling AI-MALICIOUS-INTENT removed its finding; setting AI-PROMPT-INJECTION
  to critical was reflected in the result.
- Wrong baseUrl and invalid token (real OpenAI endpoint) produce understandable
  aiError messages with no token leak.

Side effects / notes:
- Set up the Replit OpenAI AI Integration (env vars) and created one enabled
  provider row ("Replit OpenAI") so AI analysis works out of the box. Each
  AI-enabled scan bills the user's Replit credits.
- Test scans created during verification were deleted.
- artifacts/api-server typecheck passes.

Replit-Task-Id: 7321caa4-5079-4db7-8ed2-4ccaa74fa577
2026-06-10 13:56:15 +00:00
Replit Agent
8eae5f4fe6 SkillGuard: complete frontend wiring and harden backend
Original task: build "SkillGuard", a German web app to audit agent skills on
two axes (IT-Sicherheit, Datenschutz) with static rule engine + Replit-independent
AI analysis configured via an admin backend.

This session:
- Fixed frontend TS errors: lucide-react name collisions (Badge from ui, Activity
  from lucide), widened apiType to AiProviderApiType, added queryKey to useGetScan.
- Verified all pages render in German (Dashboard, Prüfen, Bericht, Verlauf, Admin)
  and the full scan flow works end-to-end (malicious sample -> verdict block).

Code-review-driven hardening:
- POST /api/scans now returns the full ScanDetail (files + findings) to match the
  OpenAPI contract, instead of only the summary.
- AI provider error bodies are redacted (token, Bearer, sk- patterns) before being
  returned/persisted, and provider fetches now have a 60s timeout.
- ZIP parsing rewritten to use fflate's streaming Unzip: caps (max files, total
  and per-file uncompressed bytes) are enforced DURING decompression. Oversized
  entries are skipped via the header size before inflation; chunked pushing with
  per-chunk size checks aborts early, so a zip bomb cannot be fully inflated into
  memory. Verified: 120MB->123KB bomb rejected with the service staying healthy;
  normal archives still parse correctly.

Updated replit.md (project overview, decisions, gotchas) and added a memory note
on lucide-react icon name collisions.
2026-06-08 15:05:17 +00:00
Replit Agent
a70b0d580a SkillGuard: complete frontend wiring and harden backend
Original task: build "SkillGuard", a German web app to audit agent skills on
two axes (IT-Sicherheit, Datenschutz) with static rule engine + Replit-independent
AI analysis configured via an admin backend.

This session:
- Fixed frontend TS errors: lucide-react name collisions (Badge from ui, Activity
  from lucide), widened apiType to AiProviderApiType, added queryKey to useGetScan.
- Verified all pages render in German (Dashboard, Prüfen, Bericht, Verlauf, Admin)
  and the full scan flow works end-to-end (malicious sample -> verdict block).

Code-review-driven hardening:
- POST /api/scans now returns the full ScanDetail (files + findings) to match the
  OpenAPI contract, instead of only the summary.
- AI provider error bodies are redacted (token, Bearer, sk- patterns) before being
  returned/persisted, and provider fetches now have a 60s timeout.
- ZIP parsing now enforces limits (max files, total + per-file size) to mitigate
  zip-bomb DoS.

Updated replit.md (project overview, decisions, gotchas) and added a memory note
on lucide-react icon name collisions.
2026-06-08 14:59:17 +00:00
Replit Agent
c93934b8f6 Transitioned from Plan to Build mode
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 0d01f99a-ea6a-447d-82fd-311715434a39
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: b23599f3-3ae7-429c-bc3b-8ec0cbc2cf2d
Replit-Helium-Checkpoint-Created: true
2026-06-08 14:28:26 +00:00
Replit Agent
2246770e5b Initial commit 2026-05-28 23:37:31 +00:00