216 Commits

Author SHA1 Message Date
Lee Chagolla-Christensen 4ae0694576 chore: bump dapr versions
Update Docker Compose and Kubernetes deployment paths to use Dapr 1.17.7 consistently, including Helm setup scripts and sidecar image annotations.
2026-05-21 18:07:37 -07:00
harmj0y d5942b3a62 dependabot fixes 2026-04-02 12:47:37 -07:00
Will Schroeder ec410a511a EKS implementation (#114)
* Initial EKS deployment work

- Initial EKS deployment documentation and scripts

* Added EFS for EKS `/mounted-containers`

- Added EFS for EKS `/mounted-containers` for large container processing

* Fix EKS Helm deployment bugs and agents API change (#109)

* fix: pods crash on startup due to psql credential path mismatch

templates referenced .Values.postgres which don't exist in values. Updated to .Values.credentials.postgres.

* fix: jaeger container crash backoff due to v1 vs v2 service config diff

* fix: pod crash back off due to loki require of delete_request_store also securityContext updated

* fix: pod crash back off due to non valid config keys

* fix: chatbot 503 mcp cannot start due to chatbot_readonly missing

* nit: add aws session token for STS creds for testing if blank should not make a difference

* fix: deps issue with pydantic-ai getting modelmanager fail with unexpected keywaord ardument controller

* Change default action build trigger

---------

Co-authored-by: Jake <93880195+aggr0cr4g@users.noreply.github.com>
2026-03-19 11:55:08 -07:00
Will Schroeder 6525ce7140 SeaweedFS (#107)
Replace Minio backend storage with SeaweedFS (as Minio has been deprecated).
2026-03-06 15:27:12 -08:00
Will Schroeder a36be30b39 K8s k3d/k3s support (#106)
* Add k8s/k3d/k3s deployment with Helm, KEDA autoscaling, and connection pool fixes

- Helm chart for full Nemesis deployment (Traefik, Dapr, KEDA, all services)
- KEDA autoscaling for file-enrichment and document-conversion on RabbitMQ queue depth
- Fix PostgreSQL connection exhaustion: configurable pool size (default 20, was 100)
- Cap Dapr statestore connections (maxConns=10), increase postgres max_connections to 300
- Add Prometheus metrics and /system/pool-stats endpoint for connection pool monitoring
- Background pool stats logger with pressure warnings
- Fix Prometheus scrape targets to correct service ports
- Helm-based Dapr install (v1.16.9) instead of CLI
- k8s setup/deploy/build/verify/teardown scripts
- Kubernetes deployment docs and references in CLAUDE.md, AGENTS.md, mkdocs

* Add KEDA autoscaling for titus-scanner and dotnet-service

* Add PgBouncer connection pooling, KEDA gotenberg CPU scaling, and tuning

- Add PgBouncer deployment between services and PostgreSQL (transaction pooling)
- Route all DB connections through pgbouncer instead of postgres directly
- Add KEDA CPU-based autoscaling for gotenberg (1-3 replicas)
- Mirror external images (pgbouncer) into k3d registry via build-and-push.sh
- Reduce queue-based cooldowns to 60s, gotenberg stabilization to 30s
- Add 180s terminationGracePeriodSeconds to gotenberg for in-flight conversions
- Update docs with PgBouncer architecture, connection tuning, and troubleshooting

* Add k3s support, unify Traefik on port 7443, rename scripts

- Add setup-cluster-k3s.sh and teardown-cluster-k3s.sh for native k3s
- Rename scripts with -k3d suffix to distinguish runtimes
- Unify k3s Traefik to HTTPS-only on port 7443 (matching k3d)
- Add k3d registry check for --build flag in deploy.sh
- Fix verify.sh arithmetic under set -e with || true
- Update docs with k3s quick start, comparison table, and teardown
- Add image-sync workflow and pgbouncer registry override for values-dev

* Add monitoring, Jupyter, and LLM optional stacks to Helm chart

- Monitoring: Prometheus, Grafana (with dashboards), Loki, Promtail,
  Jaeger, OTEL Collector, Node Exporter, Postgres Exporter
- Jupyter: notebook service with Hasura integration
- LLM: Agents (Dapr-enabled), LiteLLM proxy, Phoenix observability
- Add ingress routes, strip-prefix middleware, litellm database
- Update deploy.sh, build script, README, and test connectivity checks

* Add k3s --build support with auto-detection in deploy.sh

- deploy.sh --build auto-detects k3d registry vs k3s and uses appropriate build script
- Add build-and-load-k3s.sh for building and importing images into k3s containerd
- Add values-dev-k3s.yaml with imagePullPolicy: Never (no pgbouncer registry override)
- Fix jupyter Dockerfile context path in build-and-push-k3d.sh
- Update docs for k3s local build support

---------

Co-authored-by: Lee Chagolla-Christensen <lee@localhost>
2026-03-05 10:29:03 -08:00
Will Schroeder 79682c8aa9 Titus scanner + EVTX parsing (#105)
* Conversion of NoseyParker scanner to Titus

- Old `noseyparker_scanner` project removed, new `titus_scaner` Golang project built
- Replaced `noseyparker` references with `titus` as appropriate
- Bumped various built-in docker image versions (Dapr, Gotenberg, etc.)

* Replace ZIP-only extraction with Titus library archive support

Replace custom ZIP extraction code with Titus library's enum.ExtractText()
to support scanning secrets inside zip, jar, war, ear, apk, ipa, xpi, crx,
tar, tar.gz/tgz, and 7z archives. Document formats (xlsx, docx, pdf, etc.)
are intentionally excluded since Nemesis handles those via document_conversion.

- Add original_path to TitusInput so Titus can dispatch by file extension
  (MinIO stores files by UUID without extensions)
- Add magic-byte fallback detection for ZIP, 7z, gzip, and tar
- Preserve git-repo-in-ZIP detection as a special case before archive scan
- Rename env vars: DECOMPRESS_ZIPS -> EXTRACT_ARCHIVES,
  MAX_EXTRACT_SIZE_MB -> EXTRACT_MAX_TOTAL_SIZE_MB, and add
  EXTRACT_MAX_FILE_SIZE_MB and EXTRACT_MAX_DEPTH
- Add unit tests for archive detection and config loading

* Integrated (optional) Titus secret validation

- Integrated (optional) Titus secret validation that can be enabled

* Added Titus rule ID display and ability to disable specific rules

- Added Titus rule ID display and ability to disable specific built-in rules (by ID)

* `titus_scanner` fixes

- One scanner per concurrent file to prevent timeouts
- Fix custom rule regexes to prevent timeouts
- Exclude a few default run-away rules causing timeouts
- Bumped cores for titus scanner to 2

* Enable Vectorscan/Hyperscan acceleration for titus_scanner

Switch from the pure-Go regexp2 engine to the Vectorscan (Hyperscan)
SIMD-accelerated engine, using a fork with parallelized regexp2
confirmation and content-based deduplication

Key changes:
- Dockerfile: install libvectorscan-dev/libvectorscan5, build with
  CGO_ENABLED=1 and -tags vectorscan
- go.mod: replace praetorian-inc/titus with HarmJ0y/titus fork that
  parallelizes the regexp2 confirmation loop and uses content-based
  dedup (matching portable engine behavior)
- Add bounded-concurrency semaphore in handler to prevent OOM from
  unbounded goroutines while still returning 200 to Dapr immediately
- Add content-based deduplication, match count cap, snippet truncation,
  and payload size logging to prevent oversized publishes
- Replace O(N*M) line/column computation with precomputed line index
  using binary search
- Add GOMEMLIMIT and memory limit to container resources

* Update README.md

* remove `noseyparker_scanner` container

* Add EVTX (Windows Event Log) enrichment module

Parses .evtx files and extracts security-relevant data:
- Markdown summary transform with event counts, timeline, unique accounts/IPs
- Downloadable CSV transforms for account changes, group membership changes,
  explicit credential use (4648), process creation (4688), and task changes
- Findings for high-signal events: audit log cleared, new services, admin group
  changes, account changes, explicit creds, scheduled tasks, PS script blocks
- PowerShell 4104 script blocks reassembled and resubmitted to enrichment
  pipeline as child .ps1 files for full Titus/YARA scanning

- Added de-duping for duplicate PS scripts carved from EVTXs (hash-based)

* EVTX mods

- Power timelining done for SYSTEM
- Inbound/outbound auth for SECURITY
- Filtering for default system accounts
- CSV viewer now can download files, transforms for EVTX transformed to the viewer

* Convert titus scanner to Dapr bulk subscribe for batch processing

- Add bulk subscribe types to models (BulkMessagePayload, BulkResponse, etc.)
- Replace async single-event handler with synchronous HandleBulkEvent
- Process batches with bounded concurrency via semaphore + WaitGroup
- Handle edge cases: duplicate entryId, empty objectID/entryId, panic recovery
- Add BulkMaxMessages and BulkMaxAwaitDurationMs config with clamping
- Set app-max-concurrency to 1 (parallelism within work batch via scanner pool)

---------

Co-authored-by: Lee Chagolla-Christensen <lee@localhost>
2026-03-03 15:34:56 -08:00
harmj0y cdff6e162d Updated module development guide 2026-02-24 15:46:15 -08:00
leechristensen 197dec2fc3 docs: update API documentation [skip ci] 2026-02-05 22:35:42 +00:00
Lee Chagolla-Christensen e7adf3d2e3 yara clarifications 2026-02-03 22:02:17 -08:00
Lee Chagolla-Christensen 3d8336977d Python 3.13, linting/quality, and agent reliability
- Raise requires-python to >=3.13 across all projects/libs; set ruff target to py313
- Fix bare excepts, unused variables/imports, Optional→union syntax, and import ordering
- Refactor chatbot MCP server to async subprocess with health checks and graceful shutdown
- Simplify file-enrichment prod Dockerfile to use uv sync with UV_PROJECT_ENVIRONMENT
- Fix module_loader to use fully qualified analyzer module name
- Make YARA _analyze_yara async and fix rule_manager access in workflow
- Enable LiteLLM healthcheck and add agents→litellm dependency
- Add PE analyzer tests with PyInstaller fixture;
- Update PDF tests for nested metadata
- Suppress third-party DeprecationWarnings, use async-lru for LLM status cache
- Add PHOENIX_ENABLED validation to nemesis-ctl.sh; remove debug pprint in agents
- Add Claude Code managing-packages skill, update CLAUDE.md guidance
2026-02-03 20:36:12 -08:00
Lee Chagolla-Christensen b5b00ca72a Migrate to uv from poetry (#99)
* initial uv migration

* update github workflows

* use python module not system commands

* remove poetry references

* fix uv in prod images

---------

Co-authored-by: Lee Chagolla-Christensen <lee@localhost>
2026-01-14 15:20:31 -08:00
Lee Chagolla-Christensen dccf1adb5a fix docs 2026-01-14 09:25:11 -08:00
Pablo A. Zurro c8e469baea Cobalt Strike Connector (#97)
* Added Cobalt Strike Connector

* Updated cli readme

* Add Cobalt Strike to C2 connectors list in README

Updated README to include Cobalt Strike in C2 connectors.

* Update usage guide to include Cobalt Strike

* Document Cobalt Strike Connector setup and usage

Added Cobalt Strike Connector section with configuration and usage instructions.

* Updated documentation on REST API startup and modified Path to include the file name

* Update Cobalt Strike URL to include port 50443

* adding code 403 to force reauthentication to mathc with the CS response
2026-01-06 09:36:09 -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 f0317b637b Perf docs (#95)
* 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

* perf docs, jaeger fix
2025-11-17 08:20:36 -08:00
harmj0y 726ebc6e3b Update file_enrichment_modules.md 2025-11-14 15:05:54 -08:00
harmj0y 6a17958e7b Enable/Disable Tika OCR via ENV variable
- Enable/Disable Tika OCR via ENV variable
2025-11-14 09:40:21 -08:00
Lee Chagolla-Christensen fe743d794d Minor fixes updates (#94)
* workflow purge errors with replicas, doc updates

* fix masterkeys page

* update readme

* path linking bug in UI

---------

Co-authored-by: Lee Chagolla-Christensen <lee@localhost>
2025-11-13 12:06:26 -08:00
Lee Chagolla-Christensen 62fe355d89 collapse metadata in FileViewer, remove P key handler (only tab now), update docs 2025-11-12 16:05:25 -08:00
Lee Chagolla-Christensen c8f50fbb72 doc/screenshot updates, dashboard tooltip updates 2025-11-12 15:07:51 -08:00
Lee Chagolla-Christensen fd0fb014b5 reorganize docs a bit 2025-11-12 14:16:49 -08:00
Lee Chagolla-Christensen 0418f06ba5 combine dapr.md with overivew, move overview to dev section 2025-11-12 14:09:07 -08:00
Lee Chagolla-Christensen f2bc83a5fa spelling/grammar in quickstart.md 2025-11-12 13:57:58 -08:00
Lee Chagolla-Christensen c53b85092b spelling/grammar in usage_guide.md 2025-11-12 13:54:52 -08:00
Lee Chagolla-Christensen 57ef9a905e CPU limits and doc updates
- Added CPU limits to noseyparker container
- Updated some of the docs (perf, troubleshooting, usage guide)
- Updated triage usage in frontend
2025-11-12 13:40:41 -08:00
harmj0y f0dc011b3e Update agents.md 2025-11-09 15:40:34 -08:00
harmj0y 3b652ed792 Update docs
- Update docs
2025-11-09 15:29:26 -08:00
harmj0y f0711bea55 Chatbot documentation
- Chatbot documentation
2025-11-08 15:02:17 -08:00
HarmJ0y d59d77c2e5 docs: update API documentation [skip ci] 2025-11-07 21:50:13 +00:00
harmj0y 46f9c8986a Update enrichment_configuration.md 2025-11-06 11:16:52 -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 6ec0a3b61a Workflow performance improvements (#87)
* upgrade to dapr postgresv2 statestore

* actually make it v2

* dapr state table name, cleanup subscriptions/globals

* proper exceptions

* formatting/lint

* Refactor workflow tracking and improve activity input handling

- Extract workflow tracking logic into dedicated WorkflowTrackingService
- Simplify activity signatures to accept specific parameters instead of generic dicts
- Remove unused asyncio event loop references from enrichment modules
- Update YaraRuleManager initialization and method names

* re-added workflow tracking in the DB

* update uvicorn prod options

* enrichment work parallelism, convert queues from broadcast to task queues

* Refactor pubsub and improve workflow parallelism

- Split Dapr pubsub Dapr yaml components into topic-specific queues (alerting, dotnet, dpapi, files, noseyparker, workflow_monitor)
- Update all Dapr volume mounts to reference new topic-specific pubsub components
- Converted queues to task queues
- Use YAML anchors to reduce duplication for file-enrichment replicas
- Pass asyncpg pool to enrichment modules instead of creating connections
- Add asyncpg_pool parameter throughout chromium and enrichment module analyzers
- Update VSCode workspace (removed InspectAssembly, renamed dotnet_api to dotnet_service)
- Added curl commands for Jaeger API to performance docs to help with perf troubleshooting
- Created common.queues module to centralize pubsub/topic names (eases
  future refactoring)

* worker mods

* Workflow performance tuning, fix pubsub config, CLI arg changes

- Fix pubsub deleteWhenUnused typo (deletedWhenUnused)
- Add LOG_LEVEL environment variable support across services
- CLI: Rename --repeat to --times, add --max-files option
- Increase files pubsub prefetchCount from 25 to 50
- Add MAX_PARALLEL_WORKFLOWS configuration
- Fix DotNetAssemblyAnalysis null handling with field validators
- Update dashboard to show cumulative files/findings over time
- Add RUST_LOG environment variable support to noseyparker
- Update CHANGELOG for 2.1.4 release notes

* Dapr 1.16.2 and use db transactions

- Upgrade all Dapr containers from 1.16.1 to 1.16.2
- Reduce enrichment parallelism default from 25 to 5 workflows
- Reduce healthcheck intervals from 10s to 5s for alerting and document conversion
- Fixed DPAPI eventing to use new pubsubs
- Refactor file_linking database operations to use atomic upserts and avoid deadlocks
- Add WriteOnceViolationError handling in DPAPI masterkey analyzer
- Wrap database operations in transactions for enrichment storage and plaintext indexing
- Fix postgres notification handler closure variable capture

* remove unused start_time

* Scheduler persistence, workflow concurrency tuning, and config cleanup

- Add volume for Dapr scheduler and init service
- Add scheduler dependency to file enrichment service
- Add async workflow client libraries
- Format and cleanup compose.yaml (spacing, indentation, empty lines)

* Migrate file_enrichment to async Dapr client and optimize Dockerfile

- Use async DaprClient where possible in file_enrichment
- Improve Dockerfile caching
- Add asyncpg connection pool helper and fix typo in secret store name
- Include VS Code debug configuration for document_conversion
- Remove unused dapr_client from DpapiBlobAnalyzer
- Clean up activity return types and better handle exceptions

* Enrichment tracking for NoseyParker and logging cleanup

- Add workflow_id to NoseyParkerInput and NoseyParkerOutput models
- Remove workflow lookup query in noseyparker subscription handler
- Adjust jaeger_perf_stats.sh output formatting and precision
- Add type hints for async functions

* noseyparker scanner perf, tracing for update_enrichment_results

---------

Co-authored-by: Lee Chagolla-Christensen <lee@localhost>
2025-11-04 14:06:59 -08:00
HarmJ0y cf63a3446e docs: update API documentation [skip ci] 2025-10-31 22:24:07 +00:00
harmj0y bfeb234e06 Update documentation
- Added `alerting` and `reporting` pages
- Updated `agents` page
2025-10-30 09:50:59 -07:00
harmj0y 2f24fea869 Update blog references in docs
-Update blog references in docs
2025-10-27 16:58:26 -07:00
HarmJ0y cd9e054116 docs: update API documentation [skip ci] 2025-10-27 23:41:04 +00:00
harmj0y d55076fd8e doc update
doc update
2025-10-27 13:58:01 -07:00
harmj0y 1e8e4f52e1 Merge branch 'nemesis-2.1.3' of https://github.com/SpecterOps/Nemesis into nemesis-2.1.3 2025-10-27 10:17:33 -07:00
harmj0y baa341be2b Update file_enrichment_modules.md 2025-10-27 10:17:31 -07:00
Lee Chagolla-Christensen b0799541c3 DpapiManager: use pg conn pool 2025-10-25 16:29:45 -07:00
Lee Chagolla-Christensen 003883c1cb remove max parallel workflows, extract DB from WorkflowManager 2025-10-24 01:57:38 -07:00
Lee Chagolla-Christensen c2dac2e8a7 Change DB access and update alerting
- Switch from using POSTGRES_CONNECTION_STRING to
  POSTGRES_USER/POSTGRES_PASSWORD/POSTGRES_DATABASE/etc.
- When no apprise URL is configured, use the test echo'ing endpoint
2025-10-18 21:36:27 -07:00
harmj0y e544d617af Added DPAPI documentation
- Added DPAPI documentation
2025-10-18 18:32:22 -07:00
harmj0y 0748f5abbc Added "Text Translator" agent
-Added "Text Translator" agent
2025-10-02 21:05:07 +09:00
harmj0y d46bff63f3 Updated chromium docs
-Updated `chromium` docs
2025-09-25 20:16:03 -07:00
harmj0y 1b48db7603 Updated agents.md documentation
-Updated `agents.md` documentation
2025-09-17 12:19:04 +03:00
harmj0y 90c430523a Delete .gitkeep 2025-09-02 18:35:16 -07:00
harmj0y f2feea47bc Some preemptive fixes for API doc generation 2025-09-02 18:14:53 -07:00
harmj0y 9b2dd9b43d Start of OpenAPI markdown doc generation (needs testing)
-Start of OpenAPI markdown doc generation (needs testing once merged to `main`)
2025-08-30 15:00:49 -07:00