Commit Graph

1072 Commits

Author SHA1 Message Date
Lee Chagolla-Christensen fa4f1b05bd Merge remote-tracking branch 'origin/main' into perf_updates 2025-11-12 00:07:15 -08:00
Lee Chagolla-Christensen 5de5e23a30 Centralize workflow management and improve resource cleanup
Workflow Client Simplification:
- Removed async_workflow_client.py
- Removed taskhub_client.py
- Renamed set_fastapi_loop to set_workflow_runtime_loop

Workflow Purger Enhancement (+354 lines):
- Added configurable timeout detection for workflows
- Implemented database cursor streaming for batches
- Parallelized Dapr purge operations

Database Schema Changes:
- Added TIMEOUT status to workflow enum

Resource Management Refactor:
- Use AsyncExitStack in lifespan function
- Added cancel_task helper for graceful shutdowns
- Registered cleanup callbacks for automatic teardown

File Enrichment Controller:
- Moved event loop setup before FastAPI
- Extracted health endpoint to separate router

Performance Improvements:
- Changed DPAPI monitor interval: 5s to 30s
- Implemented parallel workflow purge operations
- Added DB cursor for workflow purging
- Removed PID logging

New Features:
- Refactored timeout termination for workflows

Configuration Updates:
- MAX_PARALLEL_WORKFLOWS: 2 to 1 (debug)
- WORKFLOW_CLIENT_LOG_LEVEL: INFO to DEBUG
- Enhanced README debugging instructions for file enrichment
- Disabled structlog timestamp processor

Web API Changes:
- Changed TERMINATED to TIMEOUT in queries
- Updated reporting routes for new status

Infrastructure:
- Added jq and iputils-ping to dev Dockerfile
2025-11-11 23:59:43 -08:00
harmj0y a01c2de9b8 Update eventing.py 2025-11-09 22:00:08 -08:00
harmj0y 37402f0129 Update compose.yaml 2025-11-09 21:41:02 -08:00
harmj0y 416d8fde2c Prod image build fix 2025-11-09 21:30:00 -08:00
harmj0y f0dc011b3e Update agents.md 2025-11-09 15:40:34 -08:00
harmj0y dee08355a8 Changed mkdocs 2025-11-09 15:34:18 -08:00
Will Schroeder 6243a0a185 Merge pull request #92 from SpecterOps/frontend_mods
Frontend mods
2025-11-09 15:30:15 -08:00
harmj0y 3b652ed792 Update docs
- Update docs
2025-11-09 15:29:26 -08:00
harmj0y bf52bc62af Moved Agents to Settings page, combined Chrome+DPAPI
- Moved `Agents` to Settings page
- Combined Chromium + DPAPI pages
2025-11-09 14:17:54 -08:00
Lee Chagolla-Christensen 50a8e4e25f Merge branch 'main' of github.com:SpecterOps/Nemesis 2025-11-08 16:15:14 -08:00
Lee Chagolla-Christensen 5d7b9bb31d Centralized workflow purging/tracking, perf improvements
Infrastructure:
- Enable pg_stat_statements extension for query monitoring
- Increase Postgres max connections and shared buffers
- Bump RabbitMQ prefetchCount to 100
- Add curl/netstat/htop to dev Docker image

Database:
- Add indexes for findings and workflows
- Add workflow status constraint and is_purged column
- Index workflows by object_id for active workflows

Workflow tracking:
- Add WorkflowStatus enum
- Added finalize_workflow activity
- Generate instance IDs with name prefix pattern
  (<name>.<instance>.<object_id>)

Workflow purging:
- Create WorkflowPurger to purge Dapr workflow data (kills perf over
  time)
- added to file_enrichment/document_conversion
- New workflows column to track purge workflows

File linking:
- Optimize upserts to single query (perf)

Configuration:
- PII info in env.example
2025-11-08 16:08:11 -08:00
harmj0y f0711bea55 Chatbot documentation
- Chatbot documentation
2025-11-08 15:02:17 -08:00
harmj0y 75037a4b5d Exposed Nemesis MCP
- Exposed Nemesis Postgres MCP on /mcp route
- Added `tools/mcp_bridge.py`
2025-11-08 14:54:44 -08:00
harmj0y ac6704cd71 Poetry fixes
- Poetry fixes
2025-11-07 15:13:25 -08:00
HarmJ0y d59d77c2e5 docs: update API documentation [skip ci] 2025-11-07 21:50:13 +00:00
Will Schroeder 1339efabbd Merge pull request #91 from SpecterOps/llm_chat_over_data
Llm chat over data
2025-11-07 13:48:45 -08:00
harmj0y 21e75426d3 npm fix for frontend
npm fix for frontend
2025-11-07 13:30:32 -08:00
harmj0y ff80fcdc35 Update poetry.lock 2025-11-07 13:24:01 -08:00
Will Schroeder 3628bf18d7 Merge branch 'main' into llm_chat_over_data 2025-11-07 13:22:16 -08:00
harmj0y 8b7ec6540d Update poetry.lock 2025-11-07 13:20:33 -08:00
harmj0y a706b50816 Update poetry.lock 2025-11-07 13:10:37 -08:00
harmj0y a014c52338 missed library
-missed library
2025-11-07 13:03:06 -08:00
harmj0y cf8b72b955 Added additional tools for searching for host access
- Added additional tools for searching for host access
2025-11-07 13:01:37 -08:00
harmj0y 09129e4bf1 frontend package fix
frontend package fix
2025-11-07 12:30:33 -08:00
harmj0y cd215a5255 Fixed UUID casting for chatbot tools
- Fixed UUID casting for chatbot tools
2025-11-07 12:17:00 -08:00
Lee Chagolla-Christensen b92f56a8a7 fix presidio on prod, debug logs 2025-11-07 10:55:12 -08:00
Lee Chagolla-Christensen caf9815890 Merge branch 'main' of github.com:SpecterOps/Nemesis 2025-11-07 10:54:45 -08:00
harmj0y 7de1e17e76 Added text searching tool
- Added text searching tool
2025-11-07 09:24:08 -08:00
Lee Chagolla-Christensen 562a4e71ca Optimize observability stack and workflow throughput
Performance and configuration improvements:
- Tune OpenTelemetry Collector with batching, queuing, and memory limits
- Optimize Jaeger for write-heavy workloads with consistency disabled
- Add Prometheus scraping for OTel Collector internal metrics
- Increase document conversion prefetch count from 1 to 5
- Add CPU limit (2 cores) for document-conversion service
- Disable Tesseract OCR in default Tika config for faster processing

Workflow tracking enhancements:
- Add WorkflowTrackingService for centralized workflow state management
- Implement finalize_workflow activities for both services
- Track enrichment success/failure per workflow instance
- Support updating workflow status by object_id for subscriptions

Code improvements:
- Refactor PDF analyzer with modular extraction functions
- Add Unicode surrogate sanitization to prevent JSONB errors
- Update PII analyzer with improved error handling
- Add documentation links to Tika and Tesseract configuration

Frontend:
- Update StatsOverview component for workflow metrics display
2025-11-07 00:58:58 -08:00
harmj0y 5991024e94 token warning for chatbot
- token warning for `chatbot`
2025-11-06 20:05:11 -08:00
harmj0y d9dc7ffb6e Changed the chatbot verboseness
-Changed the chatbot verboseness
2025-11-06 19:48:18 -08:00
harmj0y 7c99097c3a Update ChatbotPage.jsx 2025-11-06 19:30:47 -08:00
harmj0y 68586c008b Update ChatbotPage.jsx 2025-11-06 19:22:30 -08:00
harmj0y 61b1199e4d Update ChatbotPage.jsx 2025-11-06 19:21:25 -08:00
harmj0y e23411de22 Tools/MCP working
- Tools/MCP working
- Changed layout of chat interface a bit
2025-11-06 19:16:28 -08:00
harmj0y 672fbb3550 Initial Chatbot commit
- Initial Chatbot commit
2025-11-06 18:30:11 -08:00
harmj0y 46f9c8986a Update enrichment_configuration.md 2025-11-06 11:16:52 -08:00
Will Schroeder bd9d19c800 Merge pull request #88 from SpecterOps/pii_presidio
PII Presidio
2025-11-06 11:13:58 -08:00
harmj0y cc17f5ab0a Update enrichment_configuration.md 2025-11-06 11:13:05 -08:00
harmj0y 78390b410b PII analyzer disabled by default, added documentation
- PII analyzer disabled by default, can be enabled via ENV variable
- Created `enrichment_configuration.md` documentation documenting all enrichment module configurations
2025-11-06 11:08:59 -08:00
Lee Chagolla-Christensen 58dd461532 Refactor document conversion service into Dapr workflow
- Restructure document_conversion to match into workflow structure
- PDF analyzer: use PyMuPDF and extract extensive metadata
- Add PDF test suite with encrypted/unencrypted fixtures
- Add Tika Tesseract OCR configuration support example
- Update Dapr configurations for new document_conversion component
- Remove deprecated helpers from common lib
- Update queue constants and workflow setup
2025-11-06 01:30:10 -08:00
harmj0y afa4982658 Update analyzer.py 2025-11-05 20:51:11 -08:00
harmj0y e621901c20 First pass at presidio for PII detection
- First pass at presidio for PII detection
2025-11-05 20:17:13 -08:00
harmj0y 2314f52991 Fixes for container status updates
- Fixes for container status updates
2025-11-05 19:32:36 -08:00
harmj0y a7a24d752e Added shadow file_enrichment_module
- Added `shadow` file_enrichment_module
2025-11-05 15:12:42 -08:00
harmj0y 8a2462c1bc Additional file_enrichment_modules
- Ported `group_policy_preferences` and `mcafee_sitelist` from Nemesis 1.0.0
2025-11-05 14:41:27 -08:00
harmj0y deab3b0436 Temp disable yara re-running button
- Temp disable yara re-running button until we work out the proper internals for re-running a single enrichment with the new architecture
2025-11-05 13:38:58 -08:00
harmj0y e34d72434f Update eventing.py 2025-11-05 11:18:59 -08:00
harmj0y fe6988fb6b Update vuln package
- Update vuln package
2025-11-05 10:40:29 -08:00