Commit Graph

27 Commits

Author SHA1 Message Date
Lee Chagolla-Christensen 8b4b68f552 consolodate API models, fix env vars for containers, fix workflow enrichments 2026-01-15 11:44:56 -08:00
Lee Chagolla-Christensen 474e0a1d14 Various small optimizations & docs (#96)
* dpapi masterkey comment

* more verbose CLI errors, ignore swp files

* update enrichment modules doc

* update traefik

* Infra and perf improvements

- Switched to debian postgres image after benchmarking it faster
- Upgraded PostgreSQL to v18.1
- Made postgres port configurable
- Upgraded RabbitMQ to v4.2.0
- Added RabbitMQ detailed rates for better prom metrics
- Jaeger config changes to reduce memory consumption over time

* fix jaeger, fixate image versions, optimize dapr tables

* cadvisor: only docker metrics, reduce storage

* update postgres shared buffers

* aggressive postgres keep alives

* update nosey setting

* update perf docs for noseyparker

---------

Co-authored-by: Lee Chagolla-Christensen <lee@localhost>
2025-11-18 11:25:56 -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
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 672fbb3550 Initial Chatbot commit
- Initial Chatbot commit
2025-11-06 18:30:11 -08:00
harmj0y 411a818776 Findings/alert triage mods
- Findings/alert filtering options when LLM functionality enabled
- Fixed race-condition for noseyparker/dotnet analysis findings + alerts when these containers insert findings _after_ the main file_enrichment workflow completes
- Changed layout of alerting settings display
2025-10-29 12:32:49 -07:00
harmj0y f9e6e7bff1 Alerting changes
- Move JWT from agents noseyparker subscription in file_enrichment
- Add new fields to published alert in publish_findings.py
- Store alerting settings in database, accessible from Settings.jsx page
- Have alerting apply alerting settings before publishing
- Move Arize Phoenix and Agents into `llm` docker compose profile
2025-10-28 18:55:03 -07:00
harmj0y dc26e4959f Fixed container extraction status updates
- Fixed container extraction status updates
2025-10-28 11:18:36 -07:00
harmj0y c29d245968 Retro decryption working for statekeys
- Retro decryption working for statekeys (including factoring in chromekeys)
2025-10-20 11:49:29 -07:00
harmj0y 81fae70fc6 Fix for retroactive masterkey decryption
- Fix for retroactive masterkey decryption
2025-10-16 15:50:17 -07:00
harmj0y b129422e8f ABE v3 fixes and state key retroactive decryption
- Fixed decryption of v3 ABE keys via the CNG chromekey
- Schema mod w/ indexes for ABE mks
- New masterkeys now used to retroactively decrypt Local State keys
    - added retry_decrypt_state_keys_for_masterkey for retroactive decryption
- Added more references
2025-10-16 12:01:34 -07:00
Lee Chagolla-Christensen 14e8147d76 chromium FK constraints, delete faster, retries+timeouts 2025-10-15 17:24:56 -07:00
harmj0y 87dacba761 Start of CNG Google Chromekey1/AES key ABE
- Start of CNG Google Chromekey1/AES key decryption for v3 of ABE key
- Added cng file enrichment module
- Entropy can now be passed through for blob decryption
2025-10-14 16:28:58 -07:00
Lee Chagolla-Christensen 95f158225d update guids to be text so they're seachable 2025-10-14 12:54:17 -07:00
Lee Chagolla-Christensen acc5e9f2b3 add domain backup key ID 2025-10-11 23:46:45 -07:00
Lee Chagolla-Christensen 51f05a3acd add write-once constraints to DPAPI columns 2025-10-11 02:11:14 -07:00
Lee Chagolla-Christensen 3b969b2d01 rename UserAccountType to MasterKeyType 2025-10-10 23:49:26 -07:00
Lee Chagolla-Christensen 2b2ac94c23 add created/update timestamps to DPAPI 2025-10-10 23:23:50 -07:00
Lee Chagolla-Christensen 5afb864fca update masterkey parsing 2025-10-09 08:55:20 -07:00
Lee Chagolla-Christensen 2baa7d5d6a add CLI --folder option, linkings foreign key, linkage UI bug, plaintext checks in analyzers 2025-10-02 23:02:36 -07:00
Lee Chagolla-Christensen e31239a8b3 fix constrain problem, decryption perf logging 2025-09-24 00:00:28 -07:00
Lee Chagolla-Christensen 91cc2b4028 dpapi postgres hookups, backup key validation 2025-09-23 15:45:32 -07:00
harmj0y 6f59fd0128 Moved file_linking code from file_enrichment into a library
-Moved `file_linking` code from `file_enrichment` into a library
-Added windows dpapi_master_keys.yaml file link rule
-Started integrating `nemesis_dpapi` library into chromium parser code
2025-09-04 15:07:58 -07:00
harmj0y 40902d9d8f Version 2.1.3
- See CHANGELOG.md for summary of changes
2025-08-29 15:24:32 -07:00
au70ma70n d00e24b734 Update search_documents to support fuzzy search
change the WHERE clause to include the following fuzzy searches
content ILIKE '%' || search_query || '%'
file_name ILIKE '%' || search_query || '%'
2025-07-24 15:28:52 -05:00
Lee Christensen 8035a6a168 add code 2025-06-13 11:33:07 +02:00