-
Notifications
You must be signed in to change notification settings - Fork 16
feat: Add Workflow Analytics Dashboards with OpenSearch integration #229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 42044b8c24
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
0284482 to
8c83d0b
Compare
801f152 to
f9a14b3
Compare
- Fix webhook URLs to include global API prefix (ENG-115) - Add proper connectionType for list variable types in logic-script - Allow components with optional inputs to proceed without values - Add tests for optional input handling Signed-off-by: Aseem Shrey <LuD1161@users.noreply.github.com>
…gration
Add a comprehensive analytics system that transforms workflow scan outputs
into searchable, visualizable security intelligence:
**Analytics Sink Component** (`core.analytics.sink`):
- Indexes output data from any upstream node to OpenSearch
- Auto-detects asset correlation keys (host, domain, url, ip, etc.)
- Fire-and-forget with retry logic (3 attempts, exponential backoff)
- Configurable index suffix and fail-on-error modes
**OpenSearch Integration**:
- Daily index rotation: `security-findings-{orgId}-{YYYY.MM.DD}`
- Index template with standard metadata fields
- Multi-tenant data isolation per organization
**Analytics API**:
- POST /api/v1/analytics/query - OpenSearch DSL queries
- Auto-scopes queries to organization's index pattern
- Rate limiting: 100 req/min per user
**UI Integration**:
- Analytics Settings page with tier-based retention
- Results output port on nuclei, trufflehog, supabase-scanner
- Workflow context passed to all components
**Component SDK Extensions**:
- generateFindingHash() for deduplication
- Workflow context (workflowId, workflowName, organizationId)
Signed-off-by: Aseem Shrey <LuD1161@users.noreply.github.com>
Add new execution status and improve handling of orphaned workflow runs: **STALE Status**: - New status for orphaned run records (DB exists, no Temporal workflow) - Indicates data inconsistency (fresh Temporal with old DB, failed start) - Amber badge color to draw attention **Improved Status Inference**: - When Temporal returns NOT_FOUND, infer status from trace events: - No STARTED events → STALE (orphaned record) - Any FAILED events → FAILED - All nodes COMPLETED → COMPLETED - Partial completion → FAILED (crashed) - Use correct TraceEventType values (NODE_STARTED, NODE_COMPLETED, NODE_FAILED) **Documentation**: - Comprehensive execution status documentation - Status transition diagram - Frontend badge color reference Signed-off-by: Aseem Shrey <LuD1161@users.noreply.github.com>
Add unified entry point and production-ready deployment infrastructure:
**Nginx Reverse Proxy**:
- Unified access at http://localhost
- Routes: / (frontend), /api (backend), /analytics (OpenSearch Dashboards)
- Proper CORS and proxy headers (X-Real-IP, X-Forwarded-*)
**OpenSearch Dashboards basePath**:
- Configured with /analytics base path for reverse proxy
- Updated init scripts and health checks
**Production Security** (docker-compose.prod.yml):
- TLS encryption for transport and HTTP layers
- Security plugin with role-based access control
- SaaS multitenancy with per-customer tenant isolation
- Index patterns scoped by customer ID ({customer_id}-*)
- Certificate generation script (just generate-certs)
**New Commands**:
- just dev - Start with nginx reverse proxy
- just prod-secure - Start with security & multitenancy
- just generate-certs - Generate TLS certificates
**Documentation**:
- docker/PRODUCTION.md - Deployment guide with customer provisioning
Signed-off-by: Aseem Shrey <LuD1161@users.noreply.github.com>
f9a14b3 to
42a405d
Compare
Summary
This PR adds a Security Analytics platform to ShipSec Studio that enables users to index workflow output data into OpenSearch and visualize it through dashboards. This transforms raw scan outputs into actionable intelligence for security teams.
Key Features
Analytics Sink Component: New workflow node (
core.analytics.sink) that indexes output data from any upstream node to OpenSearchOpenSearch Integration:
security-findings-{orgId}-{YYYY.MM.DD}Analytics API:
POST /api/v1/analytics/queryendpoint supporting OpenSearch DSLAnalytics Settings Page:
UI Integration:
Nginx Reverse Proxy:
http://localhost/(frontend),/api(backend),/analytics(OpenSearch Dashboards)OpenSearch Dashboards basePath:
/analyticsbase path for reverse proxy compatibilityProduction Security Infrastructure:
{customer_id}-*)just generate-certs)docker/PRODUCTION.md)Workflow Status Improvements:
STALEstatus for orphaned run records (DB/Temporal mismatch)Component SDK Extensions:
generateFindingHash()utility for deduplicationNew Commands
Files Changed
75+ files across backend, frontend, worker, component-sdk, docker, and documentation.
Test plan
npm run typecheckto verify no type errorsnpm run lintto verify code qualityjust devordocker compose -f docker/docker-compose.infra.yml up -dOPENSEARCH_URL=http://localhost:9200 npm run --prefix backend setup:opensearchPOST /api/v1/analytics/query(requires Basic Auth: admin:admin)http://localhost/analyticsjust prod-secure