Skip to content

feat(infrastructure): Terraform AWS infrastructure with multi-environment support#55

Closed
Dumorro wants to merge 66 commits intoKeygraphHQ:mainfrom
Dumorro:009-terraform-infrastructure
Closed

feat(infrastructure): Terraform AWS infrastructure with multi-environment support#55
Dumorro wants to merge 66 commits intoKeygraphHQ:mainfrom
Dumorro:009-terraform-infrastructure

Conversation

@Dumorro
Copy link
Copy Markdown

@Dumorro Dumorro commented Jan 19, 2026

Summary

Implements Terraform infrastructure-as-code for AWS, providing a complete foundation for deploying Shannon platform resources across dev, staging, and production environments.

Changes

Phase 1: Project Setup

  • Terraform version constraint (1.6.0) via .terraform-version
  • TFLint configuration with AWS ruleset for linting
  • Infrastructure README with quick start guide
  • Updated .gitignore with Terraform patterns

Phase 2: Bootstrap Module

  • S3 bucket for remote state storage (AES-256 encryption, versioning enabled)
  • DynamoDB table for state locking
  • Public access blocking on state bucket

Phase 3: Networking Module + Dev Environment

  • Networking module with:
    • VPC with configurable CIDR
    • Public and private subnets across multiple AZs
    • Internet Gateway and NAT Gateway(s)
    • Route tables with proper associations
    • Security groups for ALB, application servers, and databases
  • Dev environment configured with cost-optimized settings (t3.micro, single NAT)

Phase 4: Multi-Environment Support

  • Staging environment: t3.small instances, single NAT, 10.1.0.0/16 CIDR
  • Production environment: t3.medium instances, multi-AZ NAT (HA), 3 AZs, 10.2.0.0/16 CIDR

Environment Comparison

Setting Dev Staging Prod
VPC CIDR 10.0.0.0/16 10.1.0.0/16 10.2.0.0/16
Availability Zones 2 2 3
Instance Type t3.micro t3.small t3.medium
NAT Gateway Single Single Multi-AZ
ASG Min/Max 1/2 2/4 3/10
RDS Multi-AZ No No Yes

Specification Updates

  • Added 5 clarifications to spec.md (IAM permissions, promotion workflow, naming convention, timeouts, validation)
  • Updated author-review checklist (15/15 items resolved)
  • Marked 33/90 tasks complete in tasks.md

Testing

Terraform CLI validation required locally:

cd infrastructure/bootstrap && terraform init && terraform validate
cd infrastructure/environments/dev && terraform init && terraform validate
cd infrastructure/environments/staging && terraform init && terraform validate
cd infrastructure/environments/prod && terraform init && terraform validate
Related
Spec: specs/009-terraform-infrastructure/spec.md
Tasks: specs/009-terraform-infrastructure/tasks.md (33/90 complete)

claude and others added 30 commits January 16, 2026 01:38
- Add comprehensive SaaS transformation plan (idea.md)
  - Complexity analysis (8/10 complexity rating)
  - Detailed architecture design with diagrams
  - Technology stack recommendations
  - Database schema (PostgreSQL)
  - Kubernetes infrastructure setup
  - Cost estimations (~$1,500/month base)
  - 3-phase roadmap (6-9 months to MVP)

- Add Product Requirements Document (prd.md)
  - Executive summary with vision and mission
  - 3 detailed user personas
  - 32 user stories across 5 epics
  - MVP and post-MVP feature requirements
  - UX/UI wireframes and design system
  - Technical requirements (8 FRs, 5 NFRs)
  - Security, compliance, and GDPR considerations
  - Success metrics and KPIs
  - Go-to-market strategy and launch plan
  - Future roadmap (2026-2027+)
  - Competitive analysis

Documents provide complete blueprint for transforming Shannon CLI
into a self-service SaaS platform for AI-powered penetration testing.
Add comprehensive 20-slide pitch deck covering:
- Problem statement (manual pentests cost $15k-$50k)
- Solution (AI agents that pentest in 10-15 minutes)
- Product demo with UI mockups
- Market opportunity ($12.6B TAM)
- Business model (Free/$99/$499+ tiers)
- Unit economics (14:1 LTV:CAC ratio, 75% margins)
- Go-to-market strategy (PLG → Sales-assisted → Enterprise)
- Competitive analysis vs Snyk, Checkmarx, HackerOne
- Team structure and hiring plan
- Financials ($504k ARR Year 1 projection)
- Fundraising ask ($1.5M pre-seed, 18-month runway)
- Vision (autonomous security copilot)
- FAQs

Deck is investor-ready and includes ASCII diagrams,
unit economics, and detailed competitive positioning.
Add detailed financial planning model with:

Revenue Model:
- Month-by-month projections (Year 1)
- Quarterly projections (Years 2-3)
- Customer cohort analysis
- ARR growth: $303k → $1.62M → $4.09M
- Revenue by tier breakdown (Free/Pro/Enterprise)
- Deferred revenue tracking

Cost Structure:
- Infrastructure costs (AWS: $827 → $2,685/mo)
- LLM API costs ($3/scan, volume discounts)
- Fully-loaded headcount (9 → 17 → 24 employees)
- OpEx breakdown (Personnel, S&M, G&A)

P&L Statements:
- Year 1: Monthly detail + quarterly summary
- Years 2-3: Quarterly P&L
- 3-year summary: -$7.9M cumulative loss
- Gross margin improvement: 21% → 29% → 45%

Cash Flow:
- Quarterly cash flow projections
- Fundraising schedule (Pre-Seed $1.5M, Series A $5M)
- Runway analysis (18-month pre-seed, 24-month Series A)
- Break-even projection: Q1 2030

Unit Economics:
- LTV by tier: Pro ($416 → $1,782), Enterprise ($5,240 → $22,455)
- CAC: $150 → $110 → $75 (improving)
- LTV:CAC ratio: 12:1 → 29:1 → 82:1
- CAC payback: 7.2mo → 3.8mo → 1.7mo
- Magic Number: 0.42 → 3.51 → 4.12

Hiring Plan:
- Detailed hiring timeline (month-by-month Year 1)
- Role-by-role compensation (fully-loaded)
- Headcount by function (Eng, Sales, Marketing, CS)
- Revenue per employee tracking

Customer Acquisition:
- Acquisition funnel metrics
- Channel attribution (Organic, Paid, Referral, Sales)
- Cohort retention analysis
- Churn reduction: 5% → 3.5% → 2.5%

Scenario Analysis:
- Base case (current model)
- Optimistic (+30%): $5.32M ARR Year 3
- Pessimistic (-30%): $2.86M ARR Year 3
- Sensitivity analysis (10% variable changes)

Key Metrics:
- SaaS metrics dashboard (ARR, MRR, Churn, NRR)
- Rule of 40: -562% → +255% → +72%
- Leading indicators (DAU, activation, conversion)

Fundraising:
- Dilution schedule (founders 100% → 51.2% post-Series B)
- Valuation benchmarks (25x ARR multiple)
- Use of funds (Series A $5M allocation)

Model includes 11 sections, 50+ tables, 3 scenarios,
and investor-grade financial projections.
Implement comprehensive onboarding and authentication infrastructure for Shannon SaaS:

  - Add Speckit workflow automation commands for feature development lifecycle
    - /speckit.specify - Feature specification creation
    - /speckit.plan - Implementation planning
    - /speckit.tasks - Task generation
    - /speckit.implement - Task execution
    - /speckit.analyze - Cross-artifact consistency analysis
    - /speckit.clarify - Specification clarification
    - /speckit.checklist - Custom checklist generation
    - /speckit.constitution - Project constitution management
    - /speckit.taskstoissues - GitHub issue generation

  - Create Next.js 16 web application with modern stack
    - React 19 with TypeScript
    - Clerk authentication for OAuth (Google/GitHub) and email/password
    - Prisma ORM for database management
    - Tailwind CSS 4 for styling
    - Next.js App Router architecture
    - Lucide React icons
    - Svix webhook integration

  - Add feature specification for onboarding (001-onboarding-setup)
    - User authentication (OAuth + email/password)
    - Organization management and multi-tenancy
    - Team collaboration with role-based access control
    - Two-factor authentication (TOTP)
    - Audit logging for security events

  - Configure Speckit template system (.specify/)
    - Specification templates
    - PowerShell automation scripts
    - Memory management for workflow state

  - Update .gitignore for Next.js, Prisma, IDE files, and environment variables
  feat: Shannon SaaS MVP - Onboarding, Authentication, and Organization Management
  Complete Phase 2 foundational infrastructure and Phase 3 User Story 1 (Quick Start First Scan) implementation.

  Phase 2 - Foundational Infrastructure (8 tasks):
  - Add organization context provider in web/lib/organization-context.tsx
  - Create organization switching API routes in web/app/api/org/
  - All foundational services verified and operational

  Phase 3 - Quick Start First Scan MVP (13 tasks):
  - Extend database schema with Project, Scan, and Finding models
  - Create migration 20260116202945_add_scans_and_findings
  - Implement comprehensive scan management in web/lib/actions/scans.ts
    - createScan() with URL validation and audit logging
    - getScans(), getScan(), getScanStats() for dashboard
    - updateScanProgress() for Temporal workflow integration
  - Build New Scan modal UI in web/components/new-scan-modal.tsx
  - Update dashboard to display scan statistics and recent scans
  - Create unified scan progress/results page at web/app/(dashboard)/scans/[scanId]/page.tsx
    - Real-time progress tracking
    - Severity breakdown visualization
    - Detailed findings display with remediation guidance
  - Add reusable severity badge components in web/components/severity-badge.tsx
  - Create PDF report generation endpoint stub at web/app/api/scans/[scanId]/report/route.ts
  - Add Temporal workflow integration stubs in web/lib/temporal-client.ts
  - Integrate audit logging for all scan lifecycle events

  Key Features:
  - Users can create scans by entering a target URL
  - Dashboard shows live scan statistics (total scans, open findings, fixed issues)
  - Real-time scan progress tracking with phase indicators
  - Severity-based finding categorization (critical, high, medium, low, info)
  - Complete audit trail for all scan operations
  - Type-safe implementation with Prisma ORM and TypeScript
  - Ready for Temporal workflow and PDF generation integration

  Technical Details:
  - Next.js 16 App Router with Server Actions
  - Prisma ORM with PostgreSQL
  - Clerk authentication and authorization
  - React 19 with TypeScript
  - Tailwind CSS 4 for styling
…ement (Phase 4)

Add User Story 2 - Account Creation with Email functionality:

- Enhanced sign-up and sign-in pages with improved styling and branding
- Email verification pending page with resend functionality
- Forgot password flow with email code verification
- Account settings page with profile editing and account deletion
- Security settings with password change and session management
- Updated dashboard navigation with settings subsections
- Extended audit logging for authentication events (login, logout, session revoked)
- Server actions for user profile updates

New pages:
- /verify-email - Email verification status
- /forgot-password - Password reset flow
- /dashboard/settings/account - Profile management
- /dashboard/settings/security - Password and 2FA settings

Note: T022 requires manual Clerk dashboard configuration to enable
email/password authentication.
Add complete organization management functionality enabling users to create
multiple organizations, switch between them, manage settings, and delete
organizations with a 30-day grace period.

New components:
- Organization settings page at /dashboard/org/[orgId]/settings
- New Organization modal for creating organizations
- Organization logo upload with preview and validation
- Delete organization modal with confirmation flow

Server actions:
- deleteOrganization() with 30-day soft delete grace period
- cancelOrganizationDeletion() to restore scheduled deletions
- Enhanced updateOrganization() with logo support

Auth & permissions:
- Role constants (OWNER, ADMIN, MEMBER, VIEWER) and hierarchy
- Permission helpers: canManageOrg(), isOrgOwner(), hasOrgPermission()
- ORG_PERMISSIONS mapping for granular access control
- Filter soft-deleted orgs from getUserOrganizations()

Database:
- Added logoUrl, deletedAt, scheduledDeletionAt to Organization model
- Index on deletedAt for efficient soft-delete queries

Audit events:
- organization.switched for context switching
- organization.deletion_cancelled for restored orgs

Completes Phase 5 tasks T032-T042.
Add team management functionality for organization collaboration:

- Add Invitation model to Prisma schema with token-based acceptance
- Add lastActiveAt tracking to OrganizationMembership
- Create team management page with member list and role badges
- Implement invite member modal with role selection
- Create invitation acceptance flow with sign-in redirect for guests
- Add pending invitations display with resend/revoke options
- Implement role change and member removal dialogs
- Create audit log viewer page with filtering and pagination
- Add server actions for invitations (send, resend, revoke, accept)
- Add server actions for memberships (change role, remove, leave org)
- Implement team member limits by plan (Free: 1, Pro: 5, Enterprise: unlimited)
- Add last owner protection (prevent removal/demotion of last owner)
- Create email service module for invitation emails
- Add invitation cleanup cron job (7-day expiration)
- Update dashboard navigation with Team and Audit links
- Update middleware to allow public access to invitation acceptance

Completes tasks T043-T059 for User Story 4.
…y 5)

Add TOTP-based two-factor authentication with recovery codes and
organization-level 2FA enforcement for Enterprise plans.

New features:
- 2FA settings page with enable/disable flows
- QR code generation for authenticator app setup
- 10 recovery codes with download/copy functionality
- 2FA verification page during login
- Recovery code usage flow for lost authenticators
- Account lockout after 5 failed attempts (15 minutes)
- 2FA status indicator badge in navigation
- Organization-level 2FA enforcement (Enterprise only)

Files added:
- web/app/(dashboard)/settings/security/two-factor/page.tsx
- web/app/(auth)/verify-2fa/page.tsx
- web/app/(auth)/use-recovery-code/page.tsx
- web/components/enable-2fa.tsx
- web/components/disable-2fa.tsx
- web/components/recovery-codes-download.tsx
- web/components/two-factor-status.tsx
- web/lib/actions/two-factor.ts
- web/lib/security.ts

Schema changes:
- Added require2FA field to Organization model

Audit events added:
- auth.2fa_lockout
- auth.2fa_recovery_code_used
- auth.2fa_codes_regenerated
Add comprehensive polish features for production readiness:

- Error handling: ErrorBoundary component, global error/404 pages, user-friendly messages
- Loading states: Skeleton and spinner components in web/components/ui/
- Toast notifications: ToastProvider with success/error/warning/info variants
- Database optimization: 15+ composite indexes on frequently queried columns
- Input validation: Zod schemas for all forms with sanitization helpers
- Rate limiting: In-memory limiter for auth (5/min) and API (60/min) routes
- Analytics: Provider-agnostic tracking (GA, Mixpanel, PostHog ready)
- Onboarding: Interactive tour component with keyboard navigation
- Accessibility: ARIA helpers, focus management, keyboard utilities
- Image optimization: OptimizedImage, Avatar, Logo components with lazy loading
- Logging: Structured logger with colored dev output, JSON production output
- GDPR compliance: Data export (Article 20) and account deletion (Article 17)
- Email templates: HTML/text templates for invitations, welcome, scan completed
- Security headers: CSP, HSTS, X-Frame-Options, Referrer-Policy in next.config.ts
- Documentation: Comprehensive README with setup, structure, and troubleshooting
- Add "use client" directive to not-found.tsx to fix onClick handler error
- Increase auth rate limit from 5 to 20 requests/minute to accommodate
  Clerk's multi-request auth flows (page loads, form submissions,
  internal checks, redirects)
- Exclude SSO callback routes from rate limiting since OAuth flows
  make multiple rapid internal requests
…on plan

Add comprehensive specification for Epic 2: Running Security Scans feature.

## Specification (spec.md)
- 5 prioritized user stories: Quick Scan (P1), Authenticated Testing (P2),
  Scan History (P3), Scheduled Scans (P4), CI/CD Integration (P5)
- 23 functional requirements covering scan execution, auth config, scheduling
- 9 measurable success criteria
- Clarifications: org-specific encryption, 12-month retention, 3 concurrent
  scans, 60-min timeout, GitHub-only MVP

## Implementation Plan (plan.md)
- Technical context: Next.js 16, Prisma 7, Temporal SDK, PostgreSQL
- Constitution check: all 7 principles pass
- Project structure with file paths

## Research (research.md)
- SSE for real-time progress (not WebSocket)
- AES-256-GCM with org-derived keys for credentials
- Temporal Schedules API for recurring scans
- GitHub App + webhooks for CI/CD
- Temporal semaphore pattern for scan queue

## Data Model (data-model.md)
- 6 new Prisma models: Project, Scan, ScanResult, AuthenticationConfig,
  ScanSchedule, CICDIntegration
- Multi-tenant with organizationId scoping

## API Contracts (contracts/scans-api.yaml)
- OpenAPI 3.1 specification
- 25+ endpoints for scans, projects, schedules, GitHub integration

## Tasks (tasks.md)
- 47 tasks for User Story 1 (Quick Scan MVP)
- Organized by phase: Setup, Foundational, US1 Implementation, Polish
…nal infrastructure for security scans

Add database schema, Temporal client integration, and server actions
foundation for the security scans feature (US1 + US2).

Database Schema:
- Add Project model for target applications
- Add Scan model with status tracking and progress fields
- Add ScanResult model for completed scan artifacts
- Add ScanStatus enum (PENDING, RUNNING, COMPLETED, FAILED, CANCELLED, TIMEOUT)
- Add ScanSource enum (MANUAL, SCHEDULED, CICD, API)
- Add Organization relations for multi-tenant isolation

Temporal Client (web/lib/temporal/client.ts):
- getTemporalClient() singleton connecting to TEMPORAL_ADDRESS
- getWorkflowProgress() for querying workflow state
- startScanWorkflow() for initiating pentestPipelineWorkflow
- cancelScanWorkflow() for stopping running scans

Server Actions:
- web/lib/actions/projects.ts with CRUD operations
- web/lib/actions/scans.ts with placeholder functions for US1

Refs: specs/002-security-scans/tasks.md (Phase 1, 2)
Add core scan management functionality with real-time progress tracking.

API Routes:
- GET/POST /api/projects - List and create projects
- GET /api/projects/[projectId] - Project details with recent scans
- GET/POST /api/scans - List scans with filtering, start new scans
- GET/DELETE /api/scans/[scanId] - Scan details and cancellation
- GET /api/scans/[scanId]/progress - SSE endpoint for real-time updates
- POST /api/webhooks/temporal - Workflow completion callbacks

UI Components:
- StartScanForm - Project selection and scan initiation
- ScanProgress - Real-time SSE-based progress tracking
- ScanDetailCard - Comprehensive scan information display
- ScanHistoryTable - Filterable scan history with pagination
- CancelScanButton - Scan cancellation with confirmation

Pages:
- /dashboard/scans - Scan history list
- /dashboard/scans/new - New scan creation
- /dashboard/scans/[scanId] - Scan detail view

Temporal Integration:
- Extended PipelineInput/PipelineProgress with scanId, organizationId
- Dynamic imports for optional Temporal SDK dependency
- Web-specific types to avoid build-time dependencies

Utilities:
- Concurrent scan limit checking per organization
- Queue position tracking for pending scans

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add polish and cross-cutting improvements for User Story 1 delivery.

Error Handling:
- Add error boundary (error.tsx) with retry functionality and helpful guidance
- Add consistent error codes to all scan API responses (INTERNAL_ERROR,
  NO_ORGANIZATION, NOT_FOUND, VALIDATION_ERROR, CONCURRENT_LIMIT)

Loading States:
- Add scan-history-skeleton.tsx for table loading state
- Add scan-detail-skeleton.tsx for detail card loading state
- Add loading.tsx pages for /scans and /scans/[scanId] routes

Audit Logging:
- Add scan.completed and scan.failed events to Temporal webhook handler
- Include metadata: projectName, durationMs, findings counts, error info

Optimistic Updates:
- Enhance start-scan-form.tsx with immediate visual feedback
- Show "Starting Security Scan" state with project info while API processes
- Show "Scan Started" success state before redirect
- Use React useTransition for smoother navigation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add authentication configuration support for security scans:

Database & Security:
- Add AuthMethod enum (NONE, FORM, API_TOKEN, BASIC, SSO) to Prisma schema
- Add AuthenticationConfig model with encrypted credentials storage
- Create AES-256-GCM encryption utility with org-specific key derivation

API & Server Actions:
- Add auth config API routes (GET/PUT/DELETE) at /api/projects/[projectId]/auth
- Add auth validation endpoint at /api/projects/[projectId]/auth/validate
- Create server actions for auth config CRUD operations

Temporal Integration:
- Add validateAuthentication activity with Playwright-based auth validation
- Support form login, API token, Basic Auth, and TOTP generation
- Update scan workflow to accept and pass auth configuration

UI Components:
- Create AuthMethodSelector, FormAuthConfig, ApiTokenConfig, BasicAuthConfig
- Create TotpConfig for 2FA support with TOTP secret input
- Create TestAuthButton with validation status display
- Create AuthConfigForm combining all auth configuration options
- Add project settings page at /projects/[projectId]/settings

Scan Flow Integration:
- Update startScan to fetch and decrypt project auth config
- Display auth method badge in scan detail card
- Add auth-specific error handling with guidance to check settings

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add polish and cross-cutting improvements for User Story 2:

Validation & Error Handling:
- Add URL validation for login URL field (http/https protocol check)
- Add CSS selector validation with syntax error detection
- Display inline error messages for invalid inputs on blur

Toast Notifications:
- Create reusable toast notification system (ToastProvider, useToast hook)
- Add success/error toasts for auth config save operations
- Add success/error toasts for auth validation results
- Create DashboardProviders wrapper for client-side context

Infrastructure:
- Add toast.tsx component with configurable duration and dismiss
- Add dashboard-providers.tsx for provider composition

All Phase 6 tasks (T082-T086) complete. Epic US1+US2 fully implemented.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add comprehensive scan history features including filtering, pagination,
and multi-format export capabilities:

- Create export utilities: PDF generator (Puppeteer + Marked), SARIF v2.1.0
  exporter for GitHub Code Scanning compatibility
- Add export API route supporting PDF, JSON (SARIF), and HTML formats
- Create scan-filters component with status multi-select and date range picker
- Create pagination-controls component with load more and page size options
- Create findings-breakdown component with severity badges
- Create export-button dropdown for report downloads
- Add scans-page-client for client-side filtering and pagination state
- Add scan-findings-section for detailed findings view on completed scans
- Enhance scan-detail-card with export button and findings breakdown
- Add getScanWithFindings and getExportUrl server actions
- Update tasks.md marking Phase 7 complete (104/180 tasks done)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Rename (dashboard) route group to dashboard/ for proper /dashboard/* URLs
- Fix broken route references to non-existent /dashboard/projects pages
- Update db.ts to use @prisma/adapter-pg for Prisma 7 compatibility
- Add @prisma/adapter-pg and pg dependencies

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Resolve conflicts:
- dashboard-nav.tsx: Keep main's enhanced navigation with settings section and 2FA status
- scans.ts: Keep Epic 2's full implementation with Temporal integration, add getScanStats
- schema.prisma: Merge Epic 2 models (ScanStatus/ScanSource enums, ScanResult, AuthenticationConfig) with main's additions (Invitation, Finding, Organization indexes)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
 feat(web): Epic 2 - Running Security Scans
…iation

This commit adds the full specification suite for the Findings & Remediation
Management feature (Epic 3), including:

Specification Documents:
- spec.md: Feature specification with 4 user stories (P1-P4)
- plan.md: Implementation plan with technical context
- research.md: Technical decisions and patterns
- data-model.md: Entity definitions (Finding, FindingNote, AuditLog)
- contracts/api.md: 8 API endpoint definitions
- quickstart.md: Implementation guide with testing scenarios
- tasks.md: 50 implementation tasks organized by user story
- checklists/requirements.md: Quality validation checklist

Key Clarifications Resolved:
- Cross-scan findings view with dashboard widget entry point
- 10,000 character note limit
- 2-year audit log retention with auto-purge job
- Cascade-delete for notes (only audit logs retained)
- Performance targets validated at 10K findings scale
- Manual DevTools validation for performance criteria

Also includes dashboard compatibility helpers in scans.ts for the
upcoming findings widget integration.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Phase 1 (Setup):
- Add FindingNote model to Prisma schema with cascade delete
- Add notes relation to Finding model
- Add findingNotes relation to User model
- Add composite index [status, severity] for cross-scan queries
- Create database migration for FindingNote table
- Create shared TypeScript types for findings feature

Phase 2 (Foundational):
- Create findings server actions with org access validation
- Implement getFinding() server action with full detail
- Implement updateFindingStatus() with audit logging
- Create findings components directory structure
- Create findings route group with layout

Tasks T001-T012 complete per specs/003-findings-remediation/tasks.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…t (US1)

- Add FindingStatusSelect component with dropdown, justification modal,
  optimistic updates, and error handling with rollback
- Add FindingDetail component displaying severity, description, evidence,
  remediation, CWE links, CVSS score visualization, and timeline
- Add EvidenceDisplay component with collapsible sections for steps,
  payloads, screenshots, proof of impact, and copy-to-clipboard
- Create finding detail page at /dashboard/findings/[findingId]
- Add "View Details" link to scan detail page for each finding
- Update getScanWithFindings to include findings and fix status enum usage

Tasks completed: T013, T014, T015, T016, T017, T018

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…US2)

- Add addFindingNote server action with validation and audit logging
- Add getFindingActivity server action merging notes + status changes
- Create FindingNoteForm component with character count and validation
- Create ActivityEntry component for timeline items (notes and status changes)
- Create FindingActivity component with timeline display and refresh
- Integrate activity section into finding detail page
- Add optimistic updates with useOptimistic for instant note feedback
- Show pending state visually while saving notes

Tasks completed: T019, T020, T021, T022, T023, T024, T025

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…(US3)

- Add listFindings server action with cursor pagination, severity/status/
  category filters, and search across title/description
- Add getFindingsSummary server action for dashboard widget stats
- Create FindingsFilters component with dropdown menus and checkbox selection
- Create FindingsSearch component with 300ms debounced input
- Create FindingsListItem component showing severity, status, metadata
- Create FindingsList component with pagination, loading states, filter
  chips display, and empty state handling
- Create findings page at /dashboard/findings for cross-scan view
- Create FindingsWidget dashboard component with severity bars and status
  breakdown
- Integrate FindingsWidget into main dashboard page

Tasks completed: T026, T027, T028, T029, T030, T031, T032, T033, T034, T035, T036

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add bulkUpdateFindingStatus server action with max 50 findings limit
- Create BulkStatusModal component with justification support
- Create FindingsBulkActions toolbar with action buttons
- Add selection state management to FindingsList
- Individual audit log entries for each finding in bulk operation

Tasks completed: T037-T042

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Dumorro and others added 28 commits January 17, 2026 18:37
feat(reports): add reporting & compliance framework (US1 + US2)
- Fix race condition in user creation with P2002 error handling
- Fix navigation links for route group paths (remove /dashboard prefix)
- Fix db.membership → db.organizationMembership in findings.ts
- Fix Server Actions sync function export in invitations.ts
- Extract auth types to auth-types.ts for client component compatibility
- Add @react-pdf/renderer dependency for PDF report generation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add layout.tsx to (dashboard) route group to provide consistent
header, sidebar navigation, and styling for all pages under this
group (findings, reports, team, settings, audit).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Complete 001-onboarding-setup/plan.md with retrospective technical context
- Add 005-shannon-service spec for transforming core into standalone service
- Add 006-container-isolation spec for per-scan containerized sandbox

These specifications address the architecture requirements for:
- Shannon core as a consumable service with REST API contracts
- Per-scan container isolation with resource limits and network policies
- Multi-tenant security through container-based separation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Comprehensive architecture document covering:
- System context and high-level architecture diagrams
- Component architecture for web, service, and container layers
- Data model ERD with entity relationships
- Security architecture (multi-tenant isolation, auth, encryption)
- Scan execution sequence diagram
- Infrastructure deployment topology
- Epic dependency graph with implementation status

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add complete REST API service for programmatic access to Shannon's
penetration testing capabilities, enabling SaaS transformation.

Core implementation:
- Fastify-based HTTP server with OpenAPI/Swagger documentation
- RESTful endpoints for scans, configs, reports, and health checks
- Temporal workflow integration for scan orchestration
- Prisma ORM with PostgreSQL for data persistence

API routes:
- POST /api/v1/scans - Start new penetration test
- GET /api/v1/scans/:id - Get scan status and results
- POST /api/v1/scans/:id/cancel - Cancel running scan
- GET /api/v1/reports/:scanId - Retrieve scan reports
- POST /api/v1/configs/validate - Validate configuration
- GET /api/v1/health - Health and readiness checks

Infrastructure:
- Docker configuration for containerized deployment
- Kubernetes manifests for orchestrated deployment
- Database migrations for service models

Also includes:
- Web client library for dashboard integration
- OpenAPI contract specification
- Comprehensive specification documents

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
feat(service): implement Shannon HTTP API service layer
- Add spec.md with user stories for Shannon/GhostShell isolation
- Add plan.md with technical context and constitution check
- Add research.md with npm workspaces and migration decisions
- Add data-model.md with file movement mapping
- Add quickstart.md with step-by-step migration guide
- Add tasks.md with 48 implementation tasks
- Add requirements checklist (all items passed)

Feature: 007-monorepo-restructure

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit restructures the repository as a monorepo with npm workspaces:

Shannon Package (shannon/):
- Penetration testing engine with Temporal workflows
- Moved src/, configs/, prompts/, docker/, mcp-server/
- Created package.json with all Shannon dependencies
- Independent build: `cd shannon && npm run build`

GhostShell Package (ghostshell/):
- Web application (renamed from web/)
- Next.js app with Prisma database
- Renamed database from "shannon" to "ghostshell"
- Independent build: `cd ghostshell && npm run build`

Root Orchestration:
- npm workspaces configuration in package.json
- Updated docker-compose.yml with new build contexts
- Updated DATABASE_URL to use ghostshell database
- Workspace commands: npm run build, npm run dev:shannon, npm run dev:ghostshell

Documentation:
- Updated README.md with repository structure and workspace commands
- Updated CLAUDE.md with new file paths
- Added database migration guide for existing deployments

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Docker changes:
- Update shannon-service Dockerfile for monorepo context (context: root)
- Add GhostShell Dockerfile for Next.js standalone deployment
- Add standalone output and TypeScript error skip for build

TypeScript fixes in GhostShell (pre-existing issues):
- Fix Buffer type in NextResponse (use Uint8Array)
- Fix getScan function call to use getScanWithFindings
- Add null checks for scan and stats
- Fix ScanStatus enum casing (COMPLETED, RUNNING)
- Add disabled property type to navigation items

Verified:
- postgres, temporal, shannon-service, worker containers start successfully
- Database correctly named "ghostshell"
- Shannon service health endpoint responding

Note: GhostShell Docker build requires Clerk publishable key at build time

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
refactor: restructure as monorepo with shannon and ghostshell packages
Add feature specification for implementing automated testing infrastructure
for the Shannon monorepo with Vitest, Testing Library, and GitHub Actions CI.

Includes:
- User scenarios for local testing, CI validation, test authoring, and coverage
- 12 functional requirements covering both packages
- Measurable success criteria (60s local run, 5min CI feedback)
- Quality checklist validating spec completeness
Add Kubernetes container isolation for scan execution:

- Add container module with types, K8s client, and resource limits
- Implement ContainerManager for pod lifecycle (create, watch, terminate)
- Add Temporal activities for container creation and termination
- Integrate container lifecycle into pentest pipeline workflow
- Update scan service API to accept containerIsolation config
- Add Prisma schema for ScanContainer and related models

This completes User Story 1 (MVP): scans can now execute in isolated
Kubernetes pods with proper security contexts and resource limits.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Session 2026-01-18 clarification:
- Coverage reports are informational only, no enforcement threshold
- Updated FR-009 and SC-006 to reflect this decision
…w code

Session 2026-01-18 clarification updated:
- Coverage threshold (70-80%) enforced for new/changed code only
- Updated FR-009 and SC-006 to reflect enforcement policy
Session 2026-01-18 clarification:
- Test timeout set to 30 seconds per test
- Updated Edge Cases section with specific timeout value
Phase 0 - Research:
- research.md: Technology decisions (Vitest, Testing Library, happy-dom, GitHub Actions)

Phase 1 - Design:
- plan.md: Implementation plan with technical context and constitution check
- data-model.md: Configuration entities and test lifecycle
- quickstart.md: Developer guide for using testing infrastructure
- contracts/: Configuration schemas and CI workflow specification

All artifacts ready for task generation via /speckit.tasks
Phase 1: Setup (4 tasks)
Phase 2: Foundational (5 tasks)
Phase 3: US1 - Local Tests MVP (6 tasks)
Phase 4: US2 - CI Validation (7 tasks)
Phase 5: US3 - Test Patterns (5 tasks)
Phase 6: US4 - Coverage Monitoring (6 tasks)
Phase 7: Polish (5 tasks)

Total: 38 tasks, 15 parallelizable
MVP: Phases 1-3 enable local test execution
- Add vitest workspace configuration for unified test execution
- Configure Shannon package with Vitest for Node.js testing
- Configure GhostShell package with happy-dom for React testing
- Add Testing Library setup with jest-dom matchers
- Create GitHub Actions CI workflow for automated testing
- Add example tests demonstrating unit, integration, and component patterns
- Add mocking patterns example with vi.fn(), vi.spyOn(), and fake timers
- Update package.json files with test scripts and dependencies

Implements US1 (Local Tests), US2 (CI Validation), and partial US3 (Patterns)
- Add coverage thresholds (70%) to both package vitest configs
- Add coverage and .vitest-cache directories to .gitignore
- Update CLAUDE.md with comprehensive testing documentation
- Add test:coverage scripts to package.json files
- Fix test setup with DOM cleanup between tests
- Add React hook testing examples (useCounter, useDebounce, useAsync, etc.)
- Add async component testing examples (UserProfile, SearchResults, Form)
- Configure npm workspaces to run tests across all packages
- Simplify debounced search tests to avoid fake timer issues with React 18

All 62 tests pass (18 Shannon + 44 GhostShell)

Completes User Stories US1-US4 for testing infrastructure
Update Zod to v4.3.5 across shannon and mcp-server packages to resolve
compatibility issues with Claude Agent SDK which requires Zod 4.

Breaking changes fixed:
- ZodError.errors → ZodError.issues
- z.record(schema) → z.record(z.string(), schema)

Also added missing ghostshell dependencies (marked, puppeteer).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…ostShell naming

- Update architecture.md with GhostShell naming, new epics 007-008, and monorepo structure
- Update idea.md status to "Em Implementação" with monorepo context note
- Update prd.md with Platform Architecture section describing Shannon/GhostShell packages
- Align documentation with specs/007-monorepo-restructure and specs/008-setup-monorepo-testing

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
CRITICAL fixes:
- Update all web/ paths to ghostshell/ in plan.md, tasks.md, data-model.md
- Update structure decision to reference shannon/src/ and ghostshell/

Spec clarifications:
- FR-003: Specify organizationId filter requirement for all queries
- FR-006: Clarify 403 vs 404 behavior to prevent enumeration
- FR-007 (NEW): Formalize rate limiting requirement (1000 req/hr)
- FR-015: Add queue limits (max 10, 30min timeout, QUEUE_FULL error)
- NFR-003: Replace vague "without degradation" with measurable p95 targets
- NFR-005: Add stateless design requirement for horizontal scaling

Architecture update:
- Add APIKey and ReportJob entities to data model diagram
- Extend Scan entity with parentScanId, apiKeyId, queuedAt fields

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…n tasks

- spec.md: Add 1-year retention policy to FR-024, measurement period to NFR-006
- spec.md: Reference NFR-003 in edge cases instead of duplicating
- tasks.md: Add T101-T103 for NFR validation (overhead, latency, success rate)
- architecture.md: Add ScanContainer, EphemeralVolume, NetworkPolicy entities
- constitution.md: Bump to v1.1.0, add Package-Specific Testing Requirements
  - GhostShell: Tests REQUIRED (70% coverage target)
  - Shannon: Tests RECOMMENDED

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…arifications

Define Terraform infrastructure deployment structure (IaaS) specification:
- 5 user stories covering provisioning, environments, state, modules, auditing
- 14 functional requirements for AWS infrastructure components
- 10 clarifications covering cloud scope, recovery, drift, versioning, security
- Edge cases for failures, drift detection, and state corruption

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implement Phases 1-4 of Terraform infrastructure deployment:

Phase 1 - Setup:
- Add .terraform-version (1.6.0) and .tflint.hcl configuration
- Add infrastructure README with project documentation
- Update .gitignore with Terraform patterns

Phase 2 - Bootstrap:
- Create bootstrap module for S3 state bucket and DynamoDB lock table
- Configure encryption, versioning, and public access blocking

Phase 3 - Networking Module + Dev Environment:
- Implement networking module with VPC, subnets, gateways, route tables
- Add security groups for ALB, app servers, and databases
- Create dev environment with module composition

Phase 4 - Staging + Production Environments:
- Add staging environment (t3.small, single NAT, 10.1.0.0/16)
- Add production environment (t3.medium, multi-AZ NAT, 3 AZs, 10.2.0.0/16)

Also updates spec.md with 5 additional clarifications and marks 33 tasks
complete in tasks.md.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@Dumorro Dumorro closed this Jan 19, 2026
@Dumorro Dumorro deleted the 009-terraform-infrastructure branch January 19, 2026 16:58
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.

2 participants